Are internal data properties ever inherited?

Nathan Wall nathan.wall at live.com
Mon Oct 7 21:56:56 PDT 2013


> Brendan Eich wrote:
>> Nathan Wall <mailto:nathan.wall at live.com>
>> October 7, 2013 8:05 PM
>> This should be a quick answer; I'm just looking for clarity. Are 
>> there any situations where internal data properties may be inherited? 
>> For example:
>>
>> 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?
> 
> How would you name the internal property?
> 
> If there's a symbol name, then use that, and yes: inherited just as for 
> string-equated property names.
> 
> If truly internal, then there's no way to write what you wrote above 
> with double-square-brackets.
> 
> /be

I mean as far as spec semantics go.

I'm pretty sure the answer is "no", but just wanted to double check and make sure that these properties can never be inherited under any situations.

For instance, in the section for Object.prototype.toString (ES6 draft), steps 9-13 check to see if "O has a [[X]] property", where "X" is some internal data property.  Based on my experience with Object.prototype.toString, I know that "has a" here really must mean "has an own"... or, put another way, the internal data properties seem to not inherit (so the word "own" isn't necessary).

>From this observation, I have concluded internal data properties aren't inherited when the phrase "has a" is used...  It seems to me that the obvious conclusion would be that they are never inherited under any situation, no matter the terminology used -- that internal data properties are only ever own properties.  I was asking for either confirmation or to be corrected.

Nathan 		 	   		  


More information about the es-discuss mailing list