Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __defineGetter__ & friends to Annex B #381

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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