-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
vm.runInContext Function Prototype Issue #56413
Comments
This is expected, because things created syntactically (like |
Thank you for your response and explanation! I understand that functions created syntactically do not use the globals, including the Function constructor that I inject into the context. This indeed explains why my previous attempts have not been successful. To further address this issue, I am looking for a way to ensure that all functions defined within vm.runInContext, regardless of whether they are created syntactically or through other means, share the same Function.prototype. If there are any suggestions or alternative approaches to achieve this, I would greatly appreciate it. Thank you once again for your help and time! |
There's no way to do that - What's the overarching goal of this? |
😃 |
What is the problem this feature will solve?
I'm having an issue with the vm module in Node.js.The function prototypes defined within a script using vm.runInContext do not match Function.prototype.
What is the feature you are proposing to solve the problem?
Tried using proxies, manual prototype setting, custom constructors, but none worked.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: