node-blade
node-blade copied to clipboard
Better Reporting for Syntax Errors
If there is a problem with the Blade compiler, or more likely, if there is a syntax error with the JavaScript code in a template, Node.js will not provide any line number or other information about the error. At the time of this writing, this is a limitation of the Google V8 engine; it cannot report line numbers in evaled JavaScript code.
Related upstream issues:
Node: https://github.com/joyent/node/issues/229, https://github.com/joyent/node/issues/2734 Google V8: http://code.google.com/p/v8/issues/detail?id=1914 (now somewhat fixed) https://code.google.com/p/v8/issues/detail?id=1281 https://code.google.com/p/v8/issues/detail?id=2589
Progress is being made to improve this.
Update: Google V8 now provides more detailed error information for evaled JavaScript code. Hopefully, this capability will be added to Node shortly...
Google V8 3.12.0 fixes issue 1914.
Update: This feature will probably not be added to Node v0.8; it will likely appear in Node v0.9.
~~Update: This feature will likely be added in the Node v0.9.3 release. It has been added to the node master branch.~~ Correction: This issue has not yet been fully resolved in Google V8
i installed node 0.9.3 and Google V8 is 3.13.7.4, but this issus still exists
@lenzhang - That's probably true. I have not yet tested on Node v0.9.x. Will keep you posted.
@lenzhang - As it turns out, Google V8 3.12 revealed line and column numbers for runtime errors, not for compilation/parsing errors. I will continue to work with the V8 crew to come up with a solution. The relevant V8 issue is posted above.
This is incredibly annoying. Is there any pressure put on this, some issue to star or something? The issue linked above seems to be marked as "fixed" when this is still an issue. I'm wasting copious amounts of time hunting down missing "{" in my code because it cannot provide proper line numbers.
Sorry... it's still a V8 issue. I don't have much control over it. :( You can feel free to bug the V8 guys, though. Once it's fixed in V8, it will probably be fixed in Blade within a few months...
Yeah, I get that, but is there an open issue reported on it? On V8, I mean? If there isn't, there is unlikely to be any movement. The V8 issue linked above is marked as fixed. :(
@mpj - lol. Good point. Would you mind creating a separate issue (if it doesn't already exist) and link to it here?
Update: Google V8 issues that address this problem:
~~- https://code.google.com/p/v8/issues/detail?id=1281~~
- https://code.google.com/p/v8/issues/detail?id=2589