Skip to content

Commit

Permalink
Integer-indexed elements should be configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkirsling committed Sep 11, 2020
1 parent 7a4127f commit d1523ce
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -9150,7 +9150,7 @@ <h1>MakeArgSetter ( _name_, _env_ )</h1>
<h1>Integer-Indexed Exotic Objects</h1>
<p>An Integer-Indexed exotic object is an exotic object that performs special handling of integer index property keys.</p>
<p><emu-xref href="#integer-indexed-exotic-object">Integer-Indexed exotic objects</emu-xref> have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], [[ContentType]], and [[TypedArrayName]] internal slots.</p>
<p>An object is an <dfn id="integer-indexed-exotic-object">Integer-Indexed exotic object</dfn> if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in <emu-xref href="#sec-ordinary-object-internal-methods-and-internal-slots"></emu-xref>. These methods are installed by IntegerIndexedObjectCreate.</p>
<p>An object is an <dfn id="integer-indexed-exotic-object">Integer-Indexed exotic object</dfn> if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in <emu-xref href="#sec-ordinary-object-internal-methods-and-internal-slots"></emu-xref>. These methods are installed by IntegerIndexedObjectCreate.</p>

<emu-clause id="sec-integer-indexed-exotic-objects-getownproperty-p">
<h1>[[GetOwnProperty]] ( _P_ )</h1>
Expand All @@ -9163,7 +9163,7 @@ <h1>[[GetOwnProperty]] ( _P_ )</h1>
1. If _numericIndex_ is not *undefined*, then
1. Let _value_ be ! IntegerIndexedElementGet(_O_, _numericIndex_).
1. If _value_ is *undefined*, return *undefined*.
1. Return the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *false* }.
1. Return the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }.
1. Return OrdinaryGetOwnProperty(_O_, _P_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -9196,7 +9196,7 @@ <h1>[[DefineOwnProperty]] ( _P_, _Desc_ )</h1>
1. If _numericIndex_ is not *undefined*, then
1. If ! IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *false*.
1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*.
1. If _Desc_ has a [[Configurable]] field and if _Desc_.[[Configurable]] is *true*, return *false*.
1. If _Desc_ has a [[Configurable]] field and if _Desc_.[[Configurable]] is *false*, return *false*.
1. If _Desc_ has an [[Enumerable]] field and if _Desc_.[[Enumerable]] is *false*, return *false*.
1. If _Desc_ has a [[Writable]] field and if _Desc_.[[Writable]] is *false*, return *false*.
1. If _Desc_ has a [[Value]] field, then
Expand Down Expand Up @@ -9233,6 +9233,22 @@ <h1>[[Set]] ( _P_, _V_, _Receiver_ )</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-integer-indexed-exotic-objects-delete-p">
<h1>[[Delete]] ( _P_ )</h1>
<p>When the [[Delete]] internal method of an Integer-Indexed exotic object _O_ is called with property key _P_, the following steps are taken:</p>
<emu-alg>
1. Assert: IsPropertyKey(_P_) is *true*.
1. Assert: _O_ is an Integer-Indexed exotic object.
1. If Type(_P_) is String, then
1. Let _numericIndex_ be ! CanonicalNumericIndexString(_P_).
1. If _numericIndex_ is not *undefined*, then
1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *true*.
1. If ! IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*.
1. Return *false*.
1. Return ? OrdinaryDelete(_O_, _P_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-integer-indexed-exotic-objects-ownpropertykeys">
<h1>[[OwnPropertyKeys]] ( )</h1>
<p>When the [[OwnPropertyKeys]] internal method of an Integer-Indexed exotic object _O_ is called, the following steps are taken:</p>
Expand Down Expand Up @@ -9261,6 +9277,7 @@ <h1>IntegerIndexedObjectCreate ( _prototype_ )</h1>
1. Set _A_.[[DefineOwnProperty]] as specified in <emu-xref href="#sec-integer-indexed-exotic-objects-defineownproperty-p-desc"></emu-xref>.
1. Set _A_.[[Get]] as specified in <emu-xref href="#sec-integer-indexed-exotic-objects-get-p-receiver"></emu-xref>.
1. Set _A_.[[Set]] as specified in <emu-xref href="#sec-integer-indexed-exotic-objects-set-p-v-receiver"></emu-xref>.
1. Set _A_.[[Delete]] as specified in <emu-xref href="#sec-integer-indexed-exotic-objects-delete-p"></emu-xref>.
1. Set _A_.[[OwnPropertyKeys]] as specified in <emu-xref href="#sec-integer-indexed-exotic-objects-ownpropertykeys"></emu-xref>.
1. Set _A_.[[Prototype]] to _prototype_.
1. Return _A_.
Expand Down

0 comments on commit d1523ce

Please sign in to comment.