Skip to content

Commit 829319b

Browse files
committed
Editorial: Better explain TypedArray [[DefineOwnProperty]]
1 parent 94efda2 commit 829319b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec.emu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ contributors: Mark S. Miller, Richard Gibson
105105
1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*.
106106
1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*.
107107
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is <del>*false*</del> <ins>not _mutable_</ins>, return *false*.
108-
1. <ins>If _Desc_ has a [[Value]] field and _mutable_ is *false* and SameValue(_Desc_.[[Value]], TypedArrayGetElement(_O_, _numericIndex_)) is *false*, return *false*.</ins>
109-
1. If _Desc_ has a [[Value]] field <ins>and _mutable_ is *true*</ins>, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).
108+
1. <del>If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).</del>
109+
1. <ins>If _Desc_ has a [[Value]] field, then</ins>
110+
1. <ins>NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value.</ins>
111+
1. <ins>If _mutable_ is *false* and SameValue(_Desc_.[[Value]], TypedArrayGetElement(_O_, _numericIndex_)) is *false*, return *false*.</ins>
112+
1. <ins>If _mutable_ is *true*, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).</ins>
110113
1. Return *true*.
111114
1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
112115
</emu-alg>

0 commit comments

Comments
 (0)