Skip to content

Commit

Permalink
Editorial: consistently test whether a field is present (tc39#2620)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 13, 2022
1 parent 6f4ff96 commit 497f99a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4379,8 +4379,8 @@ <h1>
1. Let _setter_ be ? Get(_Obj_, *"set"*).
1. If IsCallable(_setter_) is *false* and _setter_ is not *undefined*, throw a *TypeError* exception.
1. Set _desc_.[[Set]] to _setter_.
1. If _desc_.[[Get]] is present or _desc_.[[Set]] is present, then
1. If _desc_.[[Value]] is present or _desc_.[[Writable]] is present, throw a *TypeError* exception.
1. If _desc_ has a [[Get]] field or _desc_ has a [[Set]] field, then
1. If _desc_ has a [[Value]] field or _desc_ has a [[Writable]] field, throw a *TypeError* exception.
1. Return _desc_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -12617,15 +12617,15 @@ <h1>
1. Assert: _current_ is a fully populated Property Descriptor.
1. If every field in _Desc_ is absent, return *true*.
1. If _current_.[[Configurable]] is *false*, then
1. If _Desc_.[[Configurable]] is present and its value is *true*, return *false*.
1. If _Desc_.[[Enumerable]] is present and ! SameValue(_Desc_.[[Enumerable]], _current_.[[Enumerable]]) is *false*, return *false*.
1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *true*, return *false*.
1. If _Desc_ has an [[Enumerable]] field and ! SameValue(_Desc_.[[Enumerable]], _current_.[[Enumerable]]) is *false*, return *false*.
1. If ! IsGenericDescriptor(_Desc_) is *false* and ! SameValue(IsAccessorDescriptor(_Desc_), IsAccessorDescriptor(_current_)) is *false*, return *false*.
1. If ! IsAccessorDescriptor(_Desc_) is *true*, then
1. If _Desc_.[[Get]] is present and ! SameValue(_Desc_.[[Get]], _current_.[[Get]]) is *false*, return *false*.
1. If _Desc_.[[Set]] is present and ! SameValue(_Desc_.[[Set]], _current_.[[Set]]) is *false*, return *false*.
1. If _Desc_ has a [[Get]] field and ! SameValue(_Desc_.[[Get]], _current_.[[Get]]) is *false*, return *false*.
1. If _Desc_ has a [[Set]] field and ! SameValue(_Desc_.[[Set]], _current_.[[Set]]) is *false*, return *false*.
1. Else if _current_.[[Writable]] is *false*, then
1. If _Desc_.[[Writable]] is present and _Desc_.[[Writable]] is *true*, return *false*.
1. If _Desc_.[[Value]] is present and ! SameValue(_Desc_.[[Value]], _current_.[[Value]]) is *false*, return *false*.
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *true*, return *false*.
1. If _Desc_ has a [[Value]] field and ! SameValue(_Desc_.[[Value]], _current_.[[Value]]) is *false*, return *false*.
1. If _O_ is not *undefined*, then
1. If ! IsDataDescriptor(_current_) is *true* and ! IsAccessorDescriptor(_Desc_) is *true*, then
1. If _Desc_ has a [[Configurable]] field, let _configurable_ be _Desc_.[[Configurable]]; else let _configurable_ be _current_.[[Configurable]].
Expand Down Expand Up @@ -14221,7 +14221,7 @@ <h1>
1. Let _isMapped_ be HasOwnProperty(_map_, _P_).
1. Let _newArgDesc_ be _Desc_.
1. If _isMapped_ is *true* and IsDataDescriptor(_Desc_) is *true*, then
1. If _Desc_.[[Value]] is not present and _Desc_.[[Writable]] is present and its value is *false*, then
1. If _Desc_ does not have a [[Value]] field, and _Desc_ has a [[Writable]] field, and _Desc_.[[Writable]] is *false*, then
1. Set _newArgDesc_ to a copy of _Desc_.
1. Set _newArgDesc_.[[Value]] to Get(_map_, _P_).
1. Let _allowed_ be ? OrdinaryDefineOwnProperty(_args_, _P_, _newArgDesc_).
Expand All @@ -14230,10 +14230,10 @@ <h1>
1. If IsAccessorDescriptor(_Desc_) is *true*, then
1. Call <emu-meta effects="user-code">_map_.[[Delete]]</emu-meta>(_P_).
1. Else,
1. If _Desc_.[[Value]] is present, then
1. If _Desc_ has a [[Value]] field, then
1. Let _setStatus_ be Set(_map_, _P_, _Desc_.[[Value]], *false*).
1. Assert: _setStatus_ is *true* because formal parameters mapped by argument objects are always writable.
1. If _Desc_.[[Writable]] is present and its value is *false*, then
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, then
1. Call <emu-meta effects="user-code">_map_.[[Delete]]</emu-meta>(_P_).
1. Return *true*.
</emu-alg>
Expand Down Expand Up @@ -14786,11 +14786,11 @@ <h1>
1. If Type(_P_) is Symbol, return OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_).
1. If _current_ is *undefined*, return *false*.
1. If _Desc_.[[Configurable]] is present and has value *true*, return *false*.
1. If _Desc_.[[Enumerable]] is present and has value *false*, return *false*.
1. If _Desc_ has a [[Configurable]] field and _Desc_.[[Configurable]] is *true*, 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_.[[Writable]] is present and has value *false*, return *false*.
1. If _Desc_.[[Value]] is present, return SameValue(_Desc_.[[Value]], _current_.[[Value]]).
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*.
1. If _Desc_ has a [[Value]] field, return SameValue(_Desc_.[[Value]], _current_.[[Value]]).
1. Return *true*.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 497f99a

Please sign in to comment.