patriksimek/vm2
View on GitHubAdd support for "correct" stack traces for errors in the sandbox
Open
#87 opened on Aug 4, 2017
feature requesthelp wanted
Description
It would be nice if vm2 could display "correct" stack traces when an error is thrown from the sandbox.
For instance, this is what is currently displayed:
/home/user/box-js/node_modules/vm2/lib/main.js:213
throw this._internal.Decontextify.value(e);
^
Error: foobar
at Object.log (/home/user/box-js/analyze.js:248:10)
at Object.apply (/home/user/box-js/node_modules/vm2/lib/contextify.js:288:34)
at vm.js:491:9
at ContextifyScript.Script.runInContext (vm.js:53:29)
at VM.run (/home/user/box-js/node_modules/vm2/lib/main.js:207:72)
at Object.<anonymous> (/home/user/box-js/analyze.js:383:5)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
Is there a way to figure out which line (in the sandboxed code) was responsible for calling the function that threw the error?