src: attach error to stack on displayErrors
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 R= @bnoordhuis