Skip to content

Commit

Permalink
Normative: Set this appropriately for class extends null
Browse files Browse the repository at this point in the history
Previously, the [[ConstructorKind]] slot was set to "derived"
which would not allow accessing this in the constructor. We now
set [[ConstructorKind]] to "base" so [[Construct]] allocates and
binds this in the function body (to Object.create(C.prototype),
which will be Object.create(null) as per CDI).

Fixes #543.
  • Loading branch information
bterlson committed Apr 19, 2016
1 parent e1cecfa commit 98c67f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -19028,7 +19028,7 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
1. Let _constructorInfo_ be the result of performing DefineMethod for _constructor_ with arguments _proto_ and _constructorParent_ as the optional _functionPrototype_ argument.
1. Assert: _constructorInfo_ is not an abrupt completion.
1. Let _F_ be _constructorInfo_.[[Closure]].
1. If |ClassHeritage_opt| is present, set _F_'s [[ConstructorKind]] internal slot to `"derived"`.
1. If |ClassHeritage_opt| is present and _protoParent_ is not *null*, then set _F_'s [[ConstructorKind]] internal slot to `"derived"`.
1. Perform MakeConstructor(_F_, *false*, _proto_).
1. Perform MakeClassConstructor(_F_).
1. Perform CreateMethodProperty(_proto_, `"constructor"`, _F_).
Expand Down

0 comments on commit 98c67f2

Please sign in to comment.