mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 15:22:27 +00:00

The vm module's displayErrors option attaches error arrow messages as a hidden property. Later, core JavaScript code can optionally decorate the error stack with the arrow message. However, when user code catches an error, it has no way to access the arrow message. This commit changes the behavior of displayErrors to mean "decorate the error stack if an error occurs." Fixes: https://github.com/nodejs/node/issues/4835 PR-URL: https://github.com/nodejs/node/pull/4874 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
29 lines
864 B
Plaintext
29 lines
864 B
Plaintext
beginning
|
|
|
|
foo.vm:1
|
|
var 4;
|
|
^
|
|
SyntaxError: Unexpected number
|
|
at Object.exports.runInThisContext (vm.js:*)
|
|
at Object.<anonymous> (*test*message*vm_display_syntax_error.js:*)
|
|
at Module._compile (module.js:*)
|
|
at Object.Module._extensions..js (module.js:*)
|
|
at Module.load (module.js:*)
|
|
at Function.Module._load (module.js:*)
|
|
at Function.Module.runMain (module.js:*)
|
|
at startup (node.js:*)
|
|
at node.js:*
|
|
test.vm:1
|
|
var 5;
|
|
^
|
|
SyntaxError: Unexpected number
|
|
at Object.exports.runInThisContext (vm.js:*)
|
|
at Object.<anonymous> (*test*message*vm_display_syntax_error.js:*)
|
|
at Module._compile (module.js:*)
|
|
at Object.Module._extensions..js (module.js:*)
|
|
at Module.load (module.js:*)
|
|
at Function.Module._load (module.js:*)
|
|
at Function.Module.runMain (module.js:*)
|
|
at startup (node.js:*)
|
|
at node.js:*
|