patriksimek/vm2
在 GitHub 查看Add support for "correct" stack traces for errors in the sandbox
Open
#87 创建于 2017年8月4日
feature requesthelp wanted
仓库指标
- Star
- (3,798 star)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
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?