Are internal data properties ever inherited?

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Oct 8 08:10:13 PDT 2013


On Oct 8, 2013, at 6:36 AM, Nathan Wall wrote:

>> Allen Wirfs-Brock wrote:
>>> Nathan Wall wrote:
>>> 
>>> Set foo to bar.[[Baz]] 
>>> 
>>> Does `foo` ever result in a non-undefined value if `bar` doesn't have 
>>> an own `[[Baz]]` property but inherits from an object that has an 
>>> internal `[[Baz]]` property? 
>> 
>> 
>> I couldn't say, as this notation is never used in the ES specification. 
>> Hence it means whatever the person who wrote it wants it to mean. 
>> 
> 
> What do you mean?


Sorry, I should have been clearer.  The dot notation is never used in the spec to refer to internal data properties.

As Claude pointed out, it is used to refer to the fields of the record specification type: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-6.2.2 

Records are an abstract data structure used in the specification.  The do not correspond to ES Objects.  Their fields are neither object properties or internal data properties.


> 
> Here are some examples where this notation is used in Rev. 19:
> 
> + 9.1.15.1 [[Call]] (thisArgument, argumentsList)
>   + Step 9.b.i.1 Set thisValue to calleeRealm.[[globalThis]].
> + 9.2.2.1 [[DefineOwnProperty]] (P, Desc)
>   + Step 3.b Let oldLen be oldLenDesc.[[Value]].
> + 16.6.2.2 Runtime Semantics: LabelEvaluation
>   + Step 2.f ... let V = stmt.[[value]]
> + 14.1.13 Runtime Semantics: IndexedBindingInitialisation
>   + FunctionRestParameter : ... BindingIdentifier
>     + Step 3 Let argumentsLength be status.[[value]].

The above are all references to Record fields, not to internal data properties.

> 
> There acutlly appears to be only one occurance of "Set ... to ...".  Other occurrences say "Let ... be ...", so I should have used that terminology.  Apologies.
> 
> I think I have my answer, though.  Internal implies own.

Yes and no! That's really the wrong way to think about it.  Internal data properties are *not* object properties.  The definition of properties in http://people.mozilla.org/~jorendorff/es6-draft.html#sec-6.1.7 does not apply to them.  The concepts of own and inherited as defined in that section does not apply to them.  They are basically private per object state.  You will be on the road to confusion if you think about them as simply a specialization of ECMAScript object properties. 

"Internal" implies "this is not an property".;

Allen




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131008/c5f21bbe/attachment.html>


More information about the es-discuss mailing list