Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
spec: CreateNonEnumerableDataProperty with [[DefineOwnProperty]]
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Mar 4, 2021
1 parent 6ae7217 commit 71e533d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"license": "MIT",
"devDependencies": {
"ecmarkup": "^4.0.0"
"ecmarkup": "^7.0.0"
}
}
17 changes: 9 additions & 8 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ contributors: Chengzhong Wu, Hemanth HM, Ecma International
<emu-clause id="sec-placeholder"><h1>Placeholder to ensure correct clause numbering</h1></emu-clause>
<emu-clause id="sec-placeholder"><h1>Placeholder to ensure correct clause numbering</h1></emu-clause>

<emu-clause id="sec-createnonenumerabledataproperty">
<h1><ins>CreateNonEnumerableDataProperty ( _O_, _P_, _V_ )</ins></h1>
<p><ins>The abstract operation CreateNonEnumerableDataProperty takes arguments _O_ (an Object), _P_ (a property key), and _V_ (an ECMAScript language value). It performs the following steps when called:</ins></p>
<emu-clause id="sec-createnonenumerabledatapropertyorthrow">
<h1><ins>CreateNonEnumerableDataPropertyOrThrow ( _O_, _P_, _V_ )</ins></h1>
<p><ins>The abstract operation CreateNonEnumerableDataPropertyOrThrow takes arguments _O_ (an Object), _P_ (a property key), and _V_ (an ECMAScript language value). It is used to create a new non-enumerable own property of an object. It throws a *TypeError* exception if the requested property update cannot be performed. It performs the following steps when called:</ins></p>
<emu-alg>
1. <ins>Assert: Type(_O_) is Object.</ins>
1. <ins>Assert: IsPropertyKey(_P_) is true.</ins>
1. <ins>Assert: IsPropertyKey(_P_) is *true*.</ins>
1. <ins>Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</ins>
1. <ins>Return ? DefinePropertyOrThrow(_O_, _P_, _newDesc_).</ins>
</emu-alg>
</emu-clause>
<emu-note>This abstract operation creates a property whose attributes are set to the same defaults used for properties created by the ECMAScript language assignment operator except they are not enumerable. Normally, the property will not already exist. If it does exist and is not configurable or if _O_ is not extensible, [[DefineOwnProperty]] will return *false* causing this operation to throw a *TypeError* exception.</emu-note>
</emu-clause>
</emu-clause>

Expand Down Expand Up @@ -93,7 +94,7 @@ contributors: Chengzhong Wu, Hemanth HM, Ecma International
1. Let _msg_ be ? ToString(_message_).
1. <del>Let _msgDesc_ be the PropertyDescriptor { [[Value]]: _msg_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</del>
1. <del>Perform ! DefinePropertyOrThrow(_O_, *"message"*, _msgDesc_).</del>
1. <ins>Perform ! CreateNonEnumerableDataProperty(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ? InstallErrorCause(_O_, _options_). </ins>
1. Return O.
</emu-alg>
Expand All @@ -120,7 +121,7 @@ contributors: Chengzhong Wu, Hemanth HM, Ecma International
1. Let _msg_ be ? ToString(_message_).
1. <del>Let _msgDesc_ be the PropertyDescriptor { [[Value]]: _msg_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</del>
1. <del>Perform ! DefinePropertyOrThrow(_O_, *"message"*, _msgDesc_).</del>
1. <ins>Perform ! CreateNonEnumerableDataProperty(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ? InstallErrorCause(_O_, _options_). </ins>
1. Return _O_.
</emu-alg>
Expand All @@ -145,7 +146,7 @@ contributors: Chengzhong Wu, Hemanth HM, Ecma International
1. Let _msg_ be ? ToString(_message_).
1. <del>Let _msgDesc_ be the PropertyDescriptor { [[Value]]: _msg_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</del>
1. <del>Perform ! DefinePropertyOrThrow(_O_, *"message"*, _msgDesc_).</del>
1. <ins>Perform ! CreateNonEnumerableDataProperty(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).</ins>
1. <ins>Perform ? InstallErrorCause(_O_, _options_). </ins>
1. Let _errorsList_ be ? IterableToList(_errors_).
1. Perform ! DefinePropertyOrThrow(_O_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: ! CreateArrayFromList(_errorsList_) }).
Expand All @@ -166,7 +167,7 @@ contributors: Chengzhong Wu, Hemanth HM, Ecma International
1. <ins>Assert: Type(_O_) is Object.</ins>
1. <ins>If Type(_options_) is Object and ? HasProperty(_options_, `"cause"`) is *true*, then</ins>
1. <ins>Let _cause_ be ? Get(_options_, `"cause"`).</ins>
1. <ins>Perform ! CreateNonEnumerableDataProperty(_O_, `"cause"`, _cause_).</ins>
1. <ins>Perform ! CreateNonEnumerableDataPropertyOrThrow(_O_, `"cause"`, _cause_).</ins>
1. <ins>Return NormalCompletion(*undefined*).</ins>
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 71e533d

Please sign in to comment.