Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecmascript): aggregate error construtor #541

Merged
merged 3 commits into from
Jan 18, 2025

Conversation

yossydev
Copy link
Contributor

I implemented it based on the current NativeError and Error.

ref: #133
doc: https://tc39.es/ecma262/#sec-aggregate-error-objects

Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! There's a deeper ... not really an issue but a complication here: We have ErrorHeapData for storing errors. It's ... kind of like an optimised heap format for errors, created for the purpose of avoiding one extra indirection for the commonly used name and (especially) message property.

That ErrorHeapData does not have the errors property field prepared (and we likely don't want to prepare it either, since most errors objects don't have that property), so each aggregate error will necessarily allocate a backing object. That's not a great thing. But for now it's also not a horrible thing, we can live with it.

I'm kind of beginning to think that we might want to just turn the Error type into an Error(OrdinaryObject) instead of a separate Error(Error).

@aapoalas aapoalas merged commit 815bc72 into trynova:main Jan 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants