-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vm.runInContext rewrites thrown error messages #2104
Comments
Oh no, not this again :) |
(Maybe of note: I also had to change the add-an-arrow-to-errors logic in |
Very interesting... So @domenic am I right that you expect it to print stuff to stderr only if the exception was uncaught? |
This test wants it to be completely different: https://github.com/nodejs/io.js/blob/master/test/sequential/test-vm-syntax-error-stderr.js |
It is easy to fix the problem, if we are sure what the problem is :) It is just a matter of removing Alternatively, you may want to pass |
No, I want it to give "boo". A flag called displayErrors should not modify the .message property of objects returned from the vm. |
Ok, I just got an idea how it could be fixed. |
Put the `...^` arrow string to the hidden property of the object, and use it only when printing error to the stderr. Fix: nodejs#2104 PR-URL: nodejs#2108 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Fixed by #2108 |
Should give:
boo
Instead gives:
Modifying the actual
.message
property here seems very, very bad./cc @indutny since I believe you made changes to the error-message related stuff a while back.
The text was updated successfully, but these errors were encountered: