Skip to content

Commit e231516

Browse files
committed
Editorial: Defer the TypedArray [[DefineOwnProperty]] immutable branch to ValidateAndApplyPropertyDescriptor
1 parent 342bae0 commit e231516

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

spec.emu

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,17 @@ contributors: Mark S. Miller, Richard Gibson
9999
1. Let _numericIndex_ be CanonicalNumericIndexString(_P_).
100100
1. If _numericIndex_ is not *undefined*, then
101101
1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *false*.
102-
1. <ins>If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*.</ins>
103-
1. <ins>If IsAccessorDescriptor(_Desc_) is *true*, return *false*.</ins>
104-
1. <ins>If IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *false*, then</ins>
105-
1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, return *false*.
106-
1. <del>If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*.</del>
107-
1. <del>If IsAccessorDescriptor(_Desc_) is *true*, return *false*.</del>
108-
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*.
109-
1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).
110-
1. Return *true*.
111-
1. <ins>Else,</ins>
112-
1. <ins>If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *true*, return *false*.</ins>
113-
1. <ins>If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *true*, return *false*.</ins>
102+
1. <ins>If IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, then</ins>
103+
1. <ins>Let _current_ be ! <emu-meta suppress-effects="user-code">_O_.[[GetOwnProperty]](_P_)</emu-meta>.</ins>
104+
1. <ins>Assert: _current_.[[Configurable]] and _current_.[[Writable]] are both *false*.</ins>
114105
1. <ins>NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value.</ins>
115-
1. <ins>If _Desc_ has a [[Value]] field and SameValue(_Desc_.[[Value]], TypedArrayGetElement(_O_, _numericIndex_)) is *false*, return *false*.</ins>
116-
1. <ins>Return *true*.</ins>
106+
1. <ins>Return ValidateAndApplyPropertyDescriptor(_O_, _P_, *false*, _Desc_, _current_).</ins>
107+
1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, return *false*.
108+
1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*.
109+
1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*.
110+
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*.
111+
1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).
112+
1. Return *true*.
117113
1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
118114
</emu-alg>
119115
</emu-clause>

0 commit comments

Comments
 (0)