Skip to content

Commit

Permalink
spec for __define[GS]etter__ and __lookup[GS]etter__
Browse files Browse the repository at this point in the history
  • Loading branch information
claudepache committed Feb 11, 2016
1 parent 45a0bb1 commit ed66667
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -36111,6 +36111,64 @@ <h1>set Object.prototype.__proto__</h1>
</emu-alg>
</emu-annex>
</emu-annex>

<emu-annex id="sec-object.prototype.__defineGetter__">
<h1>Object.prototype.__defineGetter__ (_P_, _getter_)</h1>
<p>When the `__defineGetter__` method is called with arguments _P_ and _getter_, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. If IsCallable(_getter_) is *false*, throw a *TypeError* exception.
1. Let _desc_ be PropertyDescriptor{[[Get]]: getter, [[Enumerable]]: *true*, [[Configurable]]: *true*}.
1. Let _key_ be ? ToPropertyKey(_P_).
1. Perform ? DefinePropertyOrThrow(O, _key_, _desc_).
1. Return *undefined*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-object.prototype.__defineSetter__">
<h1>Object.prototype.__defineSetter__ (_P_, _setter_)</h1>
<p>When the `__defineSetter__` method is called with arguments _P_ and _setter_, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. If IsCallable(_setter_) is *false*, throw a *TypeError* exception.
1. Let _desc_ be PropertyDescriptor{[[Set]]: _setter_, [[Enumerable]]: *true*, [[Configurable]]: *true*}.
1. Let _key_ be ? ToPropertyKey(_P_).
1. Perform ? DefinePropertyOrThrow(O, _key_, _desc_).
1. Return *undefined*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-object.prototype.__lookupGetter__">
<h1>Object.prototype.__lookupGetter__ (_P_)</h1>
<p>When the `__lookupGetter__` method is called with argument _P_, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _key_ be ? ToPropertyKey(_P_).
1. Repeat
1. Let _desc_ be ? O.[[GetOwnProperty]](_key_).
1. If _desc_ is not *undefined*, then
1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Get]].
1. Return *undefined*.
1. Let _O_ be ? _O_.[[GetPrototypeOf]]().
1. If _O_ is *null*, return *undefined*.
</emu-alg>
</emu-annex>

<emu-annex id="sec-object.prototype.__lookupSetter__">
<h1>Object.prototype.__lookupSetter__ (_P_)</h1>
<p>When the `__lookupSetter__` method is called with argument _P_, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be ? ToObject(*this* value).
1. Let _key_ be ? ToPropertyKey(_P_).
1. Repeat
1. Let _desc_ be ? O.[[GetOwnProperty]](_key_).
1. If _desc_ is not *undefined*, then
1. If IsAccessorDescriptor(_desc_) is *true*, return _desc_.[[Set]].
1. Return *undefined*.
1. Let _O_ be ? _O_.[[GetPrototypeOf]]().
1. If _O_ is *null*, return *undefined*.
</emu-alg>
</emu-annex>
</emu-annex>

<!-- es6num="B.2.3" -->
Expand Down

0 comments on commit ed66667

Please sign in to comment.