Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 76 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,82 @@ <h1>Runtime Semantics: Evaluation</h1>
</emu-clause>
</emu-clause>

<emu-clause id="sec-fundamental-objects">
<h1>Fundamental Objects</h1>

<emu-clause id="sec-error-objects">
<h1>Error Objects</h1>

<emu-clause id="sec-error-constructor">
<h1>The Error Constructor</h1>

<emu-clause id="sec-error-message">
<h1>Error ( _message_ [ , _options_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Error.prototype%"*, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. Perform ? InstallErrorCause(_O_, _options_).
1. <ins>Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"snapshot"*, ? CreateAsyncContextSnapshotObject(AsyncContextSnapshot())).</ins>
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-nativeerror-object-structure">
<h1>_NativeError_ Object Structure</h1>

<emu-clause id="sec-nativeerror-constructors">
<h1>The _NativeError_ Constructors</h1>

<emu-clause id="sec-nativeerror">
<h1>_NativeError_ ( _message_ [ , _options_ ] )</h1>
<p>Each _NativeError_ function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. [id="step-nativeerror-ordinarycreatefromconstructor"] Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, <code>"%<var>NativeError</var>.prototype%"</code>, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. Perform ? InstallErrorCause(_O_, _options_).
1. <ins>Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"snapshot"*, ? CreateAsyncContextSnapshotObject(AsyncContextSnapshot())).</ins>
1. Return _O_.
</emu-alg>
<p>The actual value of the string passed in step <emu-xref href="#step-nativeerror-ordinarycreatefromconstructor"></emu-xref> is either *"%EvalError.prototype%"*, *"%RangeError.prototype%"*, *"%ReferenceError.prototype%"*, *"%SyntaxError.prototype%"*, *"%TypeError.prototype%"*, or *"%URIError.prototype%"* corresponding to which _NativeError_ constructor is being defined.</p>
</emu-clause>
</emu-clause>
</emu-clause>

<emu-clause id="sec-aggregate-error-objects">
<h1>AggregateError Objects</h1>

<emu-clause id="sec-aggregate-error-constructor">
<h1>The AggregateError Constructor</h1>

<emu-clause id="sec-aggregate-error">
<h1>AggregateError ( _errors_, _message_ [ , _options_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%AggregateError.prototype%"*, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. Perform ? InstallErrorCause(_O_, _options_).
1. Let _errorsList_ be ? IteratorToList(? GetIterator(_errors_, ~sync~)).
1. Perform ! DefinePropertyOrThrow(_O_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errorsList_) }).
1. <ins>Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"snapshot"*, ? CreateAsyncContextSnapshotObject(AsyncContextSnapshot())).</ins>
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>

<emu-clause id="sec-control-abstraction-objects">
<h1>Control Abstraction Objects</h1>

Expand Down Expand Up @@ -816,9 +892,6 @@ <h1>
1. Set _asyncSnapshot_.[[AsyncSnapshotMapping]] to _snapshotMapping_.
1. Return _asyncSnapshot_.
</emu-alg>
<emu-note>
<p>This abstract operation is meant for hosts to use, and it is not used in this specification.</p>
</emu-note>
</emu-clause>
</emu-clause>

Expand Down