archives

« Bugzilla Issues Index

#1213 — ES6 allows prototype of non-extensible object can be mutated


According to the spec draft, changing __proto__ does not check [[Extensible]].
This allows prototype of non-extensible object can be mutated. We want to know
if this is intentional ? If not can we get this addressed in the spec. Here is
the relevant section of the ES6 Dec draft spec :

>>Section B.3.1.2
The definition of the [[Put]] internal method given in 8.12.5 is replaced with
the following:
1. If P is the string value "__proto__" and UnderscoreProtoEnabled is true and
O is not the standard built-in Object prototype object, then
a. Let desc be the result of calling the [[GetProperty]] internal method of
O with property name P.
b. If desc is not undefined and was created by step 1.a to describe the
property defined in B.3.1.1 then,
i.If the type of V is neither Object or Null, return
ii.Set the value of the [[Prototype]] internal property of O to V.
iii.Return.
2. Continue by executing the steps of 8.12.5 starting with step 1.
>>

The references to 8.12.5 (for [[PUT]] ) is no more valid in the Dec 2012 draft as the section numbers were jumbled. The section number references need to be updated in B.3.1


This is now taken care of in the [[SetInheritance]] internal method


fixed in rev16 draft. July 15, 2013