You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Method "vm.runInContext" or "vm.Script.runInContext" is only shadily implemented - it has an entry in vm.js and node_script.cc but it is not part of the official documentation and its arguments are dispatched inconsistently.
However the argument list is handled incorrectly within node_script.cc, using index 1 for the filename in this case. This leads to stack traces being corrupt for such loaded code, using .toString on the context object rather than the actual filename. This also prevents the ChromeDevTools to be used to debug such an application since the string [object Context] tries to be interpreted as a filename.
The text was updated successfully, but these errors were encountered:
amb26
added a commit
to amb26/node
that referenced
this issue
Jun 2, 2011
Method "vm.runInContext" or "vm.Script.runInContext" is only shadily implemented - it has an entry in vm.js and node_script.cc but it is not part of the official documentation and its arguments are dispatched inconsistently.
http://nodejs.org/docs/v0.4.8/api/all.html#executing_JavaScript
Presumably the actual intent was for the signature to be
vm.Script.runInContext(code, userContext, [filename])
this is the signature expected within jsdom -
https://github.com/tmpvar/jsdom/blob/master/lib/jsdom/level2/languages/javascript.js
However the argument list is handled incorrectly within node_script.cc, using index 1 for the filename in this case. This leads to stack traces being corrupt for such loaded code, using .toString on the context object rather than the actual filename. This also prevents the ChromeDevTools to be used to debug such an application since the string [object Context] tries to be interpreted as a filename.
The text was updated successfully, but these errors were encountered: