diff --git a/spec.emu b/spec.emu index c3d88b7..475cd19 100644 --- a/spec.emu +++ b/spec.emu @@ -99,17 +99,16 @@ contributors: Mark S. Miller, Richard Gibson 1. Let _numericIndex_ be CanonicalNumericIndexString(_P_). 1. If _numericIndex_ is not *undefined*, then 1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *false*. - 1. Let _mutable_ be *true*. - 1. If IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, set _mutable_ to *false*. - 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false* not _mutable_, return *false*. + 1. If IsImmutableBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, then + 1. Let _current_ be ! _O_.[[GetOwnProperty]](_P_). + 1. Assert: _current_.[[Configurable]] and _current_.[[Writable]] are both *false*. + 1. NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value. + 1. Return ValidateAndApplyPropertyDescriptor(_O_, _P_, *false*, _Desc_, _current_). + 1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *false*, return *false*. 1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*. 1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*. - 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false* not _mutable_, return *false*. - 1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]). - 1. If _Desc_ has a [[Value]] field, then - 1. NOTE: Attempting to redefine an immutable value always fails, even if the new value would be cast to the current value. - 1. If _mutable_ is *false* and SameValue(_Desc_.[[Value]], TypedArrayGetElement(_O_, _numericIndex_)) is *false*, return *false*. - 1. If _mutable_ is *true*, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]). + 1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*. + 1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]). 1. Return *true*. 1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).