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

Commit

Permalink
Add AggregateError
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Mar 6, 2019
1 parent 765624b commit 7704822
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,22 @@
}
</style>

<emu-clause id="sec-native-error-types-used-in-this-standard-aggregatenerror">
<h1>AggregateError</h1>
<p>TODO implement</p>
<emu-clause id="sec-native-error-types-used-in-this-standard-aggregateerror">
<h1>AggregateError ( errors, message )</h1>
<p>When the *AggregateError* function is called with arguments _errors_ and _message_, the following steps are taken:</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_, `"%AggregateErrorPrototype%"`, « [[ErrorData]] »).

This comment has been minimized.

Copy link
@mathiasbynens

mathiasbynens Mar 6, 2019

Member

We’ll have to add the new entry for %AggregateErrorPrototype% as well.

1. Let _errorsIterator_ be ? GetMethod(_errors_, @@iterator).
1. Let _errorsList_ ? IterableToList(_errors_, _errorsIterator_).
1. Let _errorsArray_ be CreateArrayFromList(_errorsList_).
1. Perform ! CreateDataProperty(_O_, `"errors"`, _errorsArray_).
1. If _message_ is not _undefined_, then
1. Let msg be ? ToString(_message_).
1. Let msgDesc be the PropertyDescriptor { [[Value]]: _msg_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
1. Perform ! DefinePropertyOrThrow(_O_, `"message"`, _msgDesc_).
1. Return _O_.
</emu-alg>
</emu-clause>

<emu-intro id="intro">
Expand Down

0 comments on commit 7704822

Please sign in to comment.