-
Notifications
You must be signed in to change notification settings - Fork 27
Remove AggregateError.prototype.toString #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. (This section was originally added because the first draft meant to specify the error message differently. However, instead this should be done through the already-implementation-defined value of the message
property, which is a change we made later. Nowadays, the section indeed seems redundant.)
I’ll wait for @chicoxyzzy’s review before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the two functions are not totally identical, in that
let error = new AggregateError([]);
error.name = void 0;
error.toString();
would prior to this change have given "AggregateError" and after it will give "Error".
I don't think anyone will ever notice that without starting from the spec, though, and since no other error type has that behavior anyway this seems an improvement.
@bakkot Great catch! |
Thank you! |
CC @leobalter because test262 requires updates after this change. The following tests probably need to be updated:
And while there these two tests also need fixes (they call AggregateError without an iterable argument, resulting in throwing a TypeError).
These six tests failed when running test262 with the |
I'm removing tests for AggregateError#toString and adding one that asserts instances will point to Error#toString. |
@anba New patches for Test262 should fix these. PTAL? |
Refs #36