-
Notifications
You must be signed in to change notification settings - Fork 7.3k
vm.createScript a better error info #5677
Comments
It's a V8 limitation. It doesn't give useful stack traces on syntax errors. There's a crude (and undocumented) hack to get the line number. var source = Array(42).join('\n') + '0x';
var NodeScript = process.binding('evals').NodeScript;
new NodeScript(source, 'fail.js', true); Prints:
I'll see if we can improve this somehow. |
Thanks ! On Wed, Jun 12, 2013 at 11:36 PM, Ben Noordhuis [email protected]:
|
Closing, this works reasonably well now with the latest V8:
|
Which version of V8/node do we need to use to get such a nice output ? |
It would be nice to have a line number. If your script is getting longer, it's really hard to find what is wrong.
The text was updated successfully, but these errors were encountered: