From 98c67f2c2696652005ab7fb7284fe8b4661a5dbf Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Mon, 18 Apr 2016 18:01:25 -0700 Subject: [PATCH] Normative: Set this appropriately for class extends null 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. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index bdb0fd9555..1a9cf8bd07 100644 --- a/spec.html +++ b/spec.html @@ -19028,7 +19028,7 @@

Runtime Semantics: ClassDefinitionEvaluation

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_).