Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
fixes #115: @@toStringTag is an accessor now
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Aug 9, 2022
1 parent 3e24c09 commit a9e79fb
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,31 @@ <h1>Iterator.prototype.find ( _fn_ )</h1>

<emu-clause id="sec-iteratorprototype-@@tostringtag">
<h1>Iterator.prototype [ @@toStringTag ]</h1>
<p>The initial value of the @@toStringTag property is the String value "Iterator".</p>
<p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
<p>`Iterator.prototype[@@toStringTag]` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:</p>

<emu-clause id="sec-get-iteratorprototype-@@tostringtag">
<h1>get Iterator.prototype [ @@toStringTag ]</h1>
<p>The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:</p>
<emu-alg>
1. Return *"Iterator"*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-set-iteratorprototype-@@tostringtag">
<h1>set Iterator.prototype [ @@toStringTag ]</h1>
<p>The value of the [[Set]] attribute is a built-in function that takes an argument _v_. It performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be ? RequireObjectCoercible(*this* value).
1. If _O_ is %Iterator.prototype%, then
1. Return *undefined*.
1. Let _desc_ be ? _O_.[[GetOwnProperty]](@@toStringTag).
1. If IsDataDescriptor(_desc_) is *true* and _desc_.[[Writable]] is *false*, then
1. Return *undefined*.
1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _v_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1. Perform ? _O_.[[DefineOwnProperty]](@@toStringTag, _newDesc_).
1. Return *undefined*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>

Expand Down Expand Up @@ -952,8 +975,31 @@ <h1>AsyncIterator.prototype.find ( _fn_ )</h1>

<emu-clause id="sec-asynciteratorprototype-@@tostringtag">
<h1>AsyncIterator.prototype [ @@toStringTag ]</h1>
<p>The initial value of the @@toStringTag property is the String value "Async Iterator".</p>
<p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
<p>`AsyncIterator.prototype[@@toStringTag]` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:</p>

<emu-clause id="sec-get-asynciteratorprototype-@@tostringtag">
<h1>get AsyncIterator.prototype [ @@toStringTag ]</h1>
<p>The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:</p>
<emu-alg>
1. Return *"AsyncIterator"*.
</emu-alg>
</emu-clause>

<emu-clause id="sec-set-asynciteratorprototype-@@tostringtag">
<h1>set AsyncIterator.prototype [ @@toStringTag ]</h1>
<p>The value of the [[Set]] attribute is a built-in function that takes an argument _v_. It performs the following steps when called:</p>
<emu-alg>
1. Let _O_ be ? RequireObjectCoercible(*this* value).
1. If _O_ is %AsyncIterator.prototype%, then
1. Return *undefined*.
1. Let _desc_ be ? _O_.[[GetOwnProperty]](@@toStringTag).
1. If IsDataDescriptor(_desc_) is *true* and _desc_.[[Writable]] is *false*, then
1. Return *undefined*.
1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _v_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1. Perform ? _O_.[[DefineOwnProperty]](@@toStringTag, _newDesc_).
1. Return *undefined*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit a9e79fb

Please sign in to comment.