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

Support vm module #401

Closed
MixaMega opened this issue Jul 8, 2022 · 4 comments · Fixed by #2785
Closed

Support vm module #401

MixaMega opened this issue Jul 8, 2022 · 4 comments · Fixed by #2785
Labels
node.js Compatibility with Node.js APIs

Comments

@MixaMega
Copy link

MixaMega commented Jul 8, 2022

image

@caramboleyo
Copy link

I dont think this can be done with “just” a polyfill. You need to create a new, empty globalThis and then reference variables from the parent context to the new one.

@caramboleyo-no2fa
Copy link

caramboleyo-no2fa commented May 19, 2024

Will there be an update on the error handling some time?
Its quite a pain because it often does not throw any error and if it does, it throws at the line of runInNewContext of the host file.
Also tried to wrap the whole script in a global catch block, but no change. Is there any way to achieve this now?

I do just something like that:

const controller = new Script('long bundled code');
controller.runInNewContext({
    //some vars
});

EDIT: I am having this problem with ShadowRealm now too.

@ImLunaHey
Copy link
Contributor

@caramboleyo-no2fa please open a new issue.

@caramboleyo-no2fa
Copy link

#11845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node.js Compatibility with Node.js APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants