mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Removed abstract methods
This commit is contained in:
parent
dc57f042f5
commit
5b9b4f49e6
@ -81,10 +81,9 @@
|
|||||||
(deftag static)
|
(deftag static)
|
||||||
(deftag constructor)
|
(deftag constructor)
|
||||||
(deftag operator)
|
(deftag operator)
|
||||||
(deftag abstract)
|
|
||||||
(deftag virtual)
|
(deftag virtual)
|
||||||
(deftag final)
|
(deftag final)
|
||||||
(deftype member-modifier (tag none static constructor operator abstract virtual final))
|
(deftype member-modifier (tag none static constructor operator virtual final))
|
||||||
|
|
||||||
(deftype override-modifier (tag none true false undefined))
|
(deftype override-modifier (tag none true false undefined))
|
||||||
|
|
||||||
@ -396,13 +395,13 @@
|
|||||||
(final boolean))
|
(final boolean))
|
||||||
|
|
||||||
(defrecord instance-method
|
(defrecord instance-method
|
||||||
(code (union instance (tag abstract))) ;Method code
|
(code instance) ;Method code
|
||||||
(signature signature)
|
(signature signature)
|
||||||
(final boolean))
|
(final boolean))
|
||||||
|
|
||||||
(defrecord instance-accessor
|
(defrecord instance-accessor
|
||||||
(type class :opt-const)
|
(type class :opt-const)
|
||||||
(code (union instance (tag abstract))) ;Getter or setter function code
|
(code instance) ;Getter or setter function code
|
||||||
(final boolean))
|
(final boolean))
|
||||||
|
|
||||||
|
|
||||||
@ -1156,12 +1155,8 @@
|
|||||||
(:narrow instance-method
|
(:narrow instance-method
|
||||||
(return (new method-closure this m)))
|
(return (new method-closure this m)))
|
||||||
(:narrow instance-accessor
|
(:narrow instance-accessor
|
||||||
(const code (union instance (tag abstract)) (& code m))
|
(const code instance (& code m))
|
||||||
(case code
|
(return ((& call (resolve-alias code)) this (new argument-list (vector-of object) (list-set-of named-argument)) (& env code) phase)))))
|
||||||
(:narrow instance
|
|
||||||
(return ((& call (resolve-alias code)) this (new argument-list (vector-of object) (list-set-of named-argument)) (& env code) phase)))
|
|
||||||
(:select (tag abstract)
|
|
||||||
(throw property-access-error))))))
|
|
||||||
|
|
||||||
|
|
||||||
(define (read-static-member (m static-member-opt) (phase phase)) object-opt
|
(define (read-static-member (m static-member-opt) (phase phase)) object-opt
|
||||||
@ -1290,12 +1285,8 @@
|
|||||||
(throw property-access-error))
|
(throw property-access-error))
|
||||||
(:narrow instance-accessor
|
(:narrow instance-accessor
|
||||||
(const coerced-value object (assignment-conversion new-value (&opt type m)))
|
(const coerced-value object (assignment-conversion new-value (&opt type m)))
|
||||||
(const code (union instance (tag abstract)) (& code m))
|
(const code instance (& code m))
|
||||||
(case code
|
(exec ((& call (resolve-alias code)) this (new argument-list (vector coerced-value) (list-set-of named-argument)) (& env code) phase))
|
||||||
(:narrow instance
|
|
||||||
(exec ((& call (resolve-alias code)) this (new argument-list (vector coerced-value) (list-set-of named-argument)) (& env code) phase)))
|
|
||||||
(:select (tag abstract)
|
|
||||||
(throw property-access-error)))
|
|
||||||
(return ok))))
|
(return ok))))
|
||||||
|
|
||||||
|
|
||||||
@ -3168,9 +3159,6 @@
|
|||||||
|
|
||||||
|
|
||||||
(rule :nonexpression-attribute ((validate (-> (environment) void)) (eval (-> (environment phase) attribute)))
|
(rule :nonexpression-attribute ((validate (-> (environment) void)) (eval (-> (environment phase) attribute)))
|
||||||
(production :nonexpression-attribute (abstract) nonexpression-attribute-abstract
|
|
||||||
((validate (env :unused)))
|
|
||||||
((eval (env :unused) (phase :unused)) (return (new compound-attribute (list-set-of namespace) false false abstract none false false))))
|
|
||||||
(production :nonexpression-attribute (final) nonexpression-attribute-final
|
(production :nonexpression-attribute (final) nonexpression-attribute-final
|
||||||
((validate (env :unused)))
|
((validate (env :unused)))
|
||||||
((eval (env :unused) (phase :unused)) (return (new compound-attribute (list-set-of namespace) false false final none false false))))
|
((eval (env :unused) (phase :unused)) (return (new compound-attribute (list-set-of namespace) false false final none false false))))
|
||||||
@ -3402,16 +3390,12 @@
|
|||||||
"In this case, ignore the error and leave the value of the variable " (:tag inaccessible) " until it is defined at run time."))))
|
"In this case, ignore the error and leave the value of the variable " (:tag inaccessible) " until it is defined at run time."))))
|
||||||
(<- deferred-validators (append deferred-validators (vector deferred-static-validate)))
|
(<- deferred-validators (append deferred-validators (vector deferred-static-validate)))
|
||||||
(action<- (kind :variable-binding 0) static))
|
(action<- (kind :variable-binding 0) static))
|
||||||
(:narrow (tag abstract virtual final)
|
(:narrow (tag virtual final)
|
||||||
(const c class (assert-in (nth env 0) class))
|
(const c class (assert-in (nth env 0) class))
|
||||||
(function (eval-initial-value) object-opt
|
(function (eval-initial-value) object-opt
|
||||||
(return ((eval :variable-initialisation) env run)))
|
(return ((eval :variable-initialisation) env run)))
|
||||||
(var m (union instance-variable instance-accessor))
|
(var m (union instance-variable instance-accessor))
|
||||||
(case member-mod
|
(case member-mod
|
||||||
(:select (tag abstract)
|
|
||||||
(rwhen (has-initialiser :variable-initialisation)
|
|
||||||
(throw syntax-error))
|
|
||||||
(<- m (new instance-accessor :uninit abstract false)))
|
|
||||||
(:select (tag virtual)
|
(:select (tag virtual)
|
||||||
(<- m (new instance-variable :uninit eval-initial-value immutable false)))
|
(<- m (new instance-variable :uninit eval-initial-value immutable false)))
|
||||||
(:select (tag final)
|
(:select (tag final)
|
||||||
@ -3461,13 +3445,11 @@
|
|||||||
(&= value v coerced-value)))
|
(&= value v coerced-value)))
|
||||||
(:select (tag instance))))))
|
(:select (tag instance))))))
|
||||||
|
|
||||||
(rule (:variable-initialisation :beta) ((has-initialiser boolean) (validate (-> (context environment) void)) (eval (-> (environment phase) object-opt)))
|
(rule (:variable-initialisation :beta) ((validate (-> (context environment) void)) (eval (-> (environment phase) object-opt)))
|
||||||
(production (:variable-initialisation :beta) () variable-initialisation-none
|
(production (:variable-initialisation :beta) () variable-initialisation-none
|
||||||
(has-initialiser false)
|
|
||||||
((validate (cxt :unused) (env :unused)))
|
((validate (cxt :unused) (env :unused)))
|
||||||
((eval (env :unused) (phase :unused)) (return none)))
|
((eval (env :unused) (phase :unused)) (return none)))
|
||||||
(production (:variable-initialisation :beta) (= (:variable-initialiser :beta)) variable-initialisation-variable-initialiser
|
(production (:variable-initialisation :beta) (= (:variable-initialiser :beta)) variable-initialisation-variable-initialiser
|
||||||
(has-initialiser true)
|
|
||||||
((validate cxt env) ((validate :variable-initialiser) cxt env))
|
((validate cxt env) ((validate :variable-initialiser) cxt env))
|
||||||
((eval env phase) (return ((eval :variable-initialiser) env phase)))))
|
((eval env phase) (return ((eval :variable-initialiser) env phase)))))
|
||||||
|
|
||||||
@ -3497,7 +3479,7 @@
|
|||||||
((validate cxt env) ((validate :type-expression) cxt env))
|
((validate cxt env) ((validate :type-expression) cxt env))
|
||||||
((eval env) (return ((eval :type-expression) env)))))
|
((eval env) (return ((eval :type-expression) env)))))
|
||||||
;(production (:typed-identifier :beta) ((:type-expression :beta) :identifier) typed-identifier-type-and-identifier)
|
;(production (:typed-identifier :beta) ((:type-expression :beta) :identifier) typed-identifier-type-and-identifier)
|
||||||
(%print-actions ("Validation" name type-present immutable kind multiname has-initialiser validate) ("Evaluation" eval))
|
(%print-actions ("Validation" name type-present immutable kind multiname validate) ("Evaluation" eval))
|
||||||
|
|
||||||
|
|
||||||
(%heading 2 "Simple Variable Definition")
|
(%heading 2 "Simple Variable Definition")
|
||||||
@ -3561,7 +3543,7 @@
|
|||||||
(rwhen (and prototype (or (not-in kind (tag normal)) (in member-mod (tag constructor))))
|
(rwhen (and prototype (or (not-in kind (tag normal)) (in member-mod (tag constructor))))
|
||||||
(throw definition-error))
|
(throw definition-error))
|
||||||
(var compile-this (tag none inaccessible) none)
|
(var compile-this (tag none inaccessible) none)
|
||||||
(when (or prototype (in member-mod (tag constructor abstract virtual final)))
|
(when (or prototype (in member-mod (tag constructor virtual final)))
|
||||||
(<- compile-this inaccessible))
|
(<- compile-this inaccessible))
|
||||||
(const compile-frame function-frame (new function-frame (list-set-of static-binding) (list-set-of static-binding) plural compile-this prototype))
|
(const compile-frame function-frame (new function-frame (list-set-of static-binding) (list-set-of static-binding) plural compile-this prototype))
|
||||||
(const compile-env environment (cons compile-frame env))
|
(const compile-env environment (cons compile-frame env))
|
||||||
@ -3611,7 +3593,7 @@
|
|||||||
(<- f (instantiate-open-instance (assert-in f open-instance) env)))
|
(<- f (instantiate-open-instance (assert-in f open-instance) env)))
|
||||||
(const v variable (new variable function-class f true))
|
(const v variable (new variable function-class f true))
|
||||||
(exec (define-static-member env name (& namespaces a) (& override-mod a) (& explicit a) read-write v)))
|
(exec (define-static-member env name (& namespaces a) (& override-mod a) (& explicit a) read-write v)))
|
||||||
(:narrow (tag abstract virtual final)
|
(:narrow (tag virtual final)
|
||||||
(todo))
|
(todo))
|
||||||
(:select (tag constructor operator)
|
(:select (tag constructor operator)
|
||||||
(todo))))))))
|
(todo))))))))
|
||||||
@ -3712,7 +3694,7 @@
|
|||||||
(throw definition-error))
|
(throw definition-error))
|
||||||
(<- final false))
|
(<- final false))
|
||||||
(:select (tag final) (<- final true))
|
(:select (tag final) (<- final true))
|
||||||
(:select (tag constructor operator abstract virtual) (throw definition-error)))
|
(:select (tag constructor operator virtual) (throw definition-error)))
|
||||||
(const private-namespace namespace (new namespace "private"))
|
(const private-namespace namespace (new namespace "private"))
|
||||||
(const dynamic boolean (or (& dynamic a) (& dynamic superclass)))
|
(const dynamic boolean (or (& dynamic a) (& dynamic superclass)))
|
||||||
(const c class (new class (list-set-of static-binding) (list-set-of static-binding) (list-set-of instance-binding) (list-set-of instance-binding)
|
(const c class (new class (list-set-of static-binding) (list-set-of static-binding) (list-set-of instance-binding) (list-set-of instance-binding)
|
||||||
@ -3855,10 +3837,8 @@
|
|||||||
(// "Note that " (:global resolve-alias) " is not called when getting the " (:label instance env) " field.")
|
(// "Note that " (:global resolve-alias) " is not called when getting the " (:label instance env) " field.")
|
||||||
(return ((& call (resolve-alias a)) this args (& env a) phase)))
|
(return ((& call (resolve-alias a)) this args (& env a) phase)))
|
||||||
(:narrow method-closure
|
(:narrow method-closure
|
||||||
(const code (union (tag abstract) instance) (& code (& method a)))
|
(const code instance (& code (& method a)))
|
||||||
(case code
|
(return (call-object (& this a) code args phase)))))
|
||||||
(:narrow instance (return (call-object (& this a) code args phase)))
|
|
||||||
(:select (tag abstract) (throw property-access-error))))))
|
|
||||||
|
|
||||||
(define (construct-object (this object) (a object) (args argument-list) (phase phase)) object
|
(define (construct-object (this object) (a object) (args argument-list) (phase phase)) object
|
||||||
(case a
|
(case a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user