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 Error clone() when structuredClone uses bad prototype #399

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

kanongil
Copy link
Contributor

Originally reported in #398 (comment).

This can happen in jest which uses node vm to isolate runs.

This can happen in jest which uses node vm to isolate runs
@kanongil kanongil added the bug Bug or defect label Oct 24, 2024
@kanongil
Copy link
Contributor Author

Note that this could actually be a node.js error.

It seems incorrect that a created Error, and the Error used for structured clones use different prototypes within the same VM runtime.

@Marsup Marsup added this to the 11.0.6 milestone Oct 24, 2024
@Marsup Marsup self-assigned this Oct 24, 2024
@Marsup Marsup merged commit 721762a into hapijs:master Oct 24, 2024
10 checks passed
@Marsup
Copy link
Contributor

Marsup commented Oct 24, 2024

For the record, I rebased the next branch and had to alter your original commits, it should preserve the behavior while getting rid of the structuredClone check.

@kanongil
Copy link
Contributor Author

FYI this is just a jest issue.

It is 100% responsible for exposing structuredClone() in the VM and returning errors with the correct prototype, as the VM doesn't expose anything by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants