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

Handle AggregateError in structured data cloning #5716

Open
evilpie opened this issue Jul 8, 2020 · 5 comments · May be fixed by #5749
Open

Handle AggregateError in structured data cloning #5716

evilpie opened this issue Jul 8, 2020 · 5 comments · May be fixed by #5749

Comments

@evilpie
Copy link

evilpie commented Jul 8, 2020

Ref tc39/ecma262#2040

AggregateError objects have an own property "errors". This property should probably be deeply cloned.

@domenic
Copy link
Member

domenic commented Jul 14, 2020

@ricea or @yutakahirano, any interest in implementing this if I spec it?

@yutakahirano
Copy link
Member

Has the new error already been implemented in V8?

@domenic
Copy link
Member

domenic commented Jul 15, 2020

Yeah, it looks like it has.

@yutakahirano
Copy link
Member

yutakahirano commented Jul 17, 2020

Then yes, I will implement the serialization part.

@domenic domenic self-assigned this Jul 21, 2020
@domenic domenic linked a pull request Jul 21, 2020 that will close this issue
3 tasks
@domenic
Copy link
Member

domenic commented Jul 21, 2020

I've posted a PR for this at #5749. It has some initial semantics, which maybe are good enough, or we could discuss refinements to them if people think that's worth the time.

domenic added a commit that referenced this issue Jul 16, 2021
* Generalize the framework to work on any NativeError types introduced by the JS spec, instead of listing them explicitly in a way that could require future updates.
* Also include WebAssembly Error classes.
* Switch semantics for serializing/deserializing "message". Previously, we would check for the presence of the property, and if it was a data property, get its value, and then ToString() it. Now, we just Get() it and then structured-serialize the result. We also unconditionally install it on the other side, regardless of whether it was present on the original. This new property-cloning procedure is more general.
* Use these new more general property cloning procedure on "cause" (for all errors) and "errors" (for objects that present as "AggregateError" objects).

Closes #5716.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants