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

DOMExceptions do not work with v8.serialize() #53225

Open
ehmicky opened this issue May 31, 2024 · 0 comments
Open

DOMExceptions do not work with v8.serialize() #53225

ehmicky opened this issue May 31, 2024 · 0 comments
Labels
v8 module Issues and PRs related to the "v8" subsystem. web-standards Issues and PRs related to Web APIs

Comments

@ehmicky
Copy link

ehmicky commented May 31, 2024

Version

v22.1.0

Platform

Linux ether-laptop 6.5.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 26 11:23:57 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

node:v8

What steps will reproduce the bug?

import {serialize, deserialize} from 'node:v8';

const error = AbortSignal.abort().reason;
console.log(error instanceof DOMException); 
// true
console.log(error);
// DOMException [AbortError]: This operation was aborted
//     at new DOMException (node:internal/per_context/domexception:53:5)
//     at AbortSignal.abort (node:internal/abort_controller:205:14)
//     at ...

const clonedError = deserialize(serialize(error));
console.log(clonedError instanceof DOMException); 
// false
console.log(clonedError);
// {}

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

A DOMException should be serializable/deserializable like other error instances.

What do you see instead?

Serializing/deserializing with v8 turns it into an empty plain object.

Additional information

Related: structuredClone(domException) returns an empty plain object, which is probably the same bug. This might be related to #49181.

@VoltrexKeyva VoltrexKeyva added the v8 module Issues and PRs related to the "v8" subsystem. label May 31, 2024
@daeyeon daeyeon added the web-standards Issues and PRs related to Web APIs label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 module Issues and PRs related to the "v8" subsystem. web-standards Issues and PRs related to Web APIs
Projects
None yet
Development

No branches or pull requests

3 participants