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

fix(core): rethrow exception during structured cloning serialization #14671

Merged

Conversation

mrkldshv
Copy link
Contributor

  • Introduced optional callback for Deno.core.serialize API, that returns cloning error if there is one.
  • Removed try/catch in seralize structured clone function and throw error from callback.
  • Removed "Object with a getter that throws" assertion from WPT.

Closes #14296.

@lucacasonato
Copy link
Member

LGTM. @andreubotella do you want to take a look too? I remember you were originally looking into this.

Copy link
Contributor

@andreubotella andreubotella left a comment

Choose a reason for hiding this comment

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

LGTM

core/bindings.rs Outdated Show resolved Hide resolved
core/bindings.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, nice work @mrkldshv

@bartlomieju bartlomieju merged commit 402b497 into denoland:main May 26, 2022
@mrkldshv mrkldshv deleted the bugfix/structured-clone-serialization branch May 26, 2022 15:16
kitsonk pushed a commit that referenced this pull request May 27, 2022
…14671)

- Introduced optional callback for Deno.core.serialize API, that returns
cloning error if there is one.
- Removed try/catch in seralize structured clone function and throw error from
callback.
- Removed "Object with a getter that throws" assertion from WPT.
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.

It's wrong to transform all exceptions thrown during structured cloning to DataCloneError exceptions
4 participants