Closed leobalter closed 5 years ago
It seems like the line 1. Let _error_ be a newly created
AggregateErrorobject.
should be called with errors as the first arg.
Good catch! But since _errors_
is a list, not an array, I think the correct fix is to insert Let errorsArray be CreateArrayFromList(errorsList).
before both of the Let error be a newly created AggregateError object.
steps.
Re:
It seems like the line
1. Let _error_ be a newly created AggregateError object.
should be called with errors as the first arg.
this line isn't actually calling the constructor, as I understand it; it leaves it to the host to decide how to produce the object (so that the host can add nonstandard properties like "stack"). Which is why it's explicitly defining the "errors"
property.
@bakkot thanks! Please review the fixup commit!
@leobalter There's another instance of the same mistake in PerformPromiseAny 8.d.iii, which you could fix (in the same way) while you're at it
done!
It seems that generalization of this part could simplify maintain story:
1. Let _errorsArray_ be CreateArrayFromList(_errors_).
1. Let _error_ be a newly created `AggregateError` object.
1. Perform ! CreateDataProperty ( _error_, `"errors"`, _errorsArray_ ).
1. Return ThrowCompletion ( _error_ ).
Clear the reference typo to
_errors_
to match the other steps and use the name as it's a list, not an Array there.