Where is it specified that new objects are empty, if it is?

Erik Arvidsson erik.arvidsson at gmail.com
Fri Mar 15 20:09:50 PDT 2013


V8 now uses an accessor on Object.prototype.
On Mar 15, 2013 7:20 PM, "Brendan Eich" <brendan at mozilla.com> wrote:

> Kevin Reid wrote:
>
>> I'm doing a little maintenance on SES. Chrome has recently added a new
>> odd behavior:
>>
>>  var o = Object.create(null);
>>> Object.getOwnPropertyNames(o)
>>>
>> []
>>
>>> Object.**getOwnPropertyDescriptor(o, '__proto__');
>>>
>> Object {value: null, writable: true, enumerable: false, configurable:
>> false}
>>
>
> Oh come on! :-P
>
>  The two results are clearly non-conformant, in that gOPN and gOPD
>> should be consistent with each other. However, the problem that I'm
>> wanting to record accurately is the fact that Object.create(null) has
>> (however inconsistently) any properties at all (thus interfering with
>> table-like uses).
>>
>
> ES6 will specify __proto__ as "own" and configurable in Object.prototype.
> Whether magic data or accessor with censored or poisoned getter and setter
> I'm not sure at the moment, but the above will definitely not conform to
> ES6.
>
>  15.2.3.5 Object.create refers to 15.2.2.1 which specifies “a newly
>> created native ECMAScript object”. Where is the initial state of the
>> collection of properties of a “newly created” object specified? (8.6
>> defining the Object type doesn't say anything about the existence of
>> non-internal properties.)
>>
>
> Whoa, spec hole. Allen?
>
>  (I recognize that this behavior may well be a deliberate variance to
>> reconcile __proto__ and ES5/ES6. This is not a complaint; this is a
>> request to consult spec-lawyers.)
>>
>
> Ok, whew. Sorry for lawyering,
>
> /be
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130315/35bf9a21/attachment.html>


More information about the es-discuss mailing list