On Mon, Jun 30, 2014 at 10:18 AM, raul mihaila <[email protected]>
wrote:

> While reading the SetPrototypeOf algorithm I noticed that some steps are
> repeated. At step 5, if O.[[Extensible]] is false, the method returns
> false. But at step 8, the same condition is checked again. It seems to me
> that between these steps neither the value of O, nor the value of
> O.[[Extensible]] changes. Aren't steps 7 and 8 redundant?
>

The second set of checks is needed because step 6 might change the results:
if one of the objects iterated over in step 6 is a proxy, then arbitrary
code can be executed through an invocation of its `getPrototypeOf` handler.
This code might make O inextensible or change its __proto__ to be the same
value as V.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to