This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make errors property of AggregateError non-enumerable #31
Make errors property of AggregateError non-enumerable #31
Changes from all commits
c0d0771
27bc4a4
06ff431
e00a17e
efea102
5ad4c76
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a reason not to just use
? Construct(%AggregateError%, « errors »)
, since the %AggregateError% constructor already has the defined semantics?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.
what about the
message
argument?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.
We don't seem to care about
message
elsewhere in the spec as the actual message is implementation dependent and may even be localised, yet this isn't formalized anywhere in the spec for the numerous "throw a TypeError exception" cases. I was wondering if we need to be more formal about this in general. Something like: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.
i suspect creation of errors typically avoids using Construct precisely to avoid the need for that formalism.
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.
Not just
message
, but alsostack
,line
, and any other non-standard properties.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.
maybe these two steps should be their own abstract op, so it can be reused in both places?
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.
I just found other places in current ecma262 spec text where such abstract operation could be reused (plus one usage for
message
property 3 lines below these two lines). It will need a lot arguments though. IMO duplication here is not a big problem but maybe worth a separate PR to the spec repoThere 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.
Fair point.
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.
"CreateBuiltinDataPropertyOrThrow"? Naming based on "CreateBuiltinFunction" and "CreateDataPropertyOrThrow", given that the majority of "built in" data properties are non-enumerable by default.