Skip to content

Commit

Permalink
Layering: change SetImmutablePrototype to use [[GetPrototypeOf]]
Browse files Browse the repository at this point in the history
SetImmutablePrototype is meant for use by a variety of objects beyond the ECMA-262 spec. Some of those objects do not have a [[Prototype]], or have a [[Prototype]] but use custom [[GetPrototypeOf]] logic to act is they don't sometimes. (Respectively: HTML's WindowProxy and Location objects.) As such, SetImmutablePrototype should look up the prototype using [[GetPrototypeOf]] instead of trying to look at the possibly-nonexistant [[Prototype]] slot directly.

Some background:

* web-platform-tests/wpt#5015 (comment)
* whatwg/html#2400
  • Loading branch information
domenic committed Mar 7, 2017
1 parent 6390c2f commit 223cd38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -8451,7 +8451,7 @@ <h1>SetImmutablePrototype ( _O_, _V_ )</h1>
<p>When the SetImmutablePrototype abstract operation is called with arguments _O_ and _V_, the following steps are taken:</p>
<emu-alg>
1. Assert: Either Type(_V_) is Object or Type(_V_) is Null.
1. Let _current_ be _O_.[[Prototype]].
1. Let _current_ be ? _O_.[[GetPrototypeOf]]().
1. If SameValue(_V_, _current_) is *true*, return *true*.
1. Return *false*.
</emu-alg>
Expand Down

0 comments on commit 223cd38

Please sign in to comment.