-
Notifications
You must be signed in to change notification settings - Fork 7.3k
vm: Correctly pass through syntax errors. #5848
Conversation
Should fix #1310 as well. |
/cc @bnoordhuis This cleans things up and adds a test case for the syntax error -- can you review? |
LGTM with the caveat that I had to fix up some of the test/message tests. The test you added is still failing for me:
Can you check that? Here is my fix-up branch. |
Hmm.. that is strange. That is the error you would get if the V8 fix was not present. I'll take a look. |
Hmm, I tried to remove the DisplayError stuff in vm2 but it lost the error and gave the bad output. If you have any ideas let me know. |
@domenic Yeah this is frustrating -- when I landed the V8 changes for this, it was working perfectly fine in my copy of node/V8. At some point since it worked its way into the actual V8 release and landed in node, it stopped working. I spent a bit of time poking at it but haven't tracked down what change was responsible. I'll keep at it.. |
So, the V8 change is apparently still not there in 3.20.17. Is it perhaps in 3.21? Removing the display_error param from the vm.Script constructor is trivial enough, and we all agree it's a great idea, but this pull req doesn't merge cleanly since the vm2 contextify changes. Let's revisit when V8 can handle ReThrow without losing information. |
@apaprocki Can you point me to your V8 change that's supposed to address this? |
@isaacs The rev I indicated in the description, 704fd8f, landed it in Node. My original changeset is here: https://codereview.chromium.org/15669003/ Yang changed it a bit and landed it here: https://codereview.chromium.org/17694002/ This definitely worked in the state of Node+V8 at the time of my original changeset. With the patch as it landed in V8, I didn't see it working as intended in the latest Node. I dug into it a little bit but didn't get to the bottom of it. I'm going to revisit it when I get a solid block of time to switch contexts. |
My V8 patch to fix C++
TryThrow
to restore message script location whenReThrow
-ing landed in 704fd8f. Now that this is in place, thedisplay_error
hack innode_script.cc
can be removed since syntax errors withinvm
calls are correctly reported as aSyntaxError
at the actual error site instead of at the outer-mostvm
call.Fixes #3452