Better Reporting for Syntax Errors #40

Open
bminer opened this Issue Jun 15, 2012 · 11 comments

Projects

None yet

3 participants

@bminer
Owner
bminer commented Jun 15, 2012

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: nodejs/node-v0.x-archive#229, nodejs/node-v0.x-archive#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.

@bminer
Owner
bminer commented Jun 21, 2012

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.

@bminer
Owner
bminer commented Jun 28, 2012

Update: This feature will probably not be added to Node v0.8; it will likely appear in Node v0.9.

@bminer
Owner
bminer commented Oct 2, 2012

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

@bminer bminer was assigned Oct 2, 2012
@lenzhang

i installed node 0.9.3 and Google V8 is 3.13.7.4, but this issus still exists

@bminer
Owner
bminer commented Nov 27, 2012

@lenzhang - That's probably true. I have not yet tested on Node v0.9.x. Will keep you posted.

@bminer
Owner
bminer commented Dec 6, 2012

@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.

@mpj
mpj commented Mar 2, 2013

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.

@bminer
Owner
bminer commented Mar 4, 2013

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...

@mpj
mpj commented Mar 7, 2013

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. :(

@bminer
Owner
bminer commented Mar 7, 2013

@mpj - lol. Good point. Would you mind creating a separate issue (if it doesn't already exist) and link to it here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment