Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 445894

Summary: [esprima] Typed errors with no tokens should mark the line they were reported against
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: 7.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2014-10-03 12:06:01 EDT
Consider the following snippet:

var foo = 10;
var bar = foo;
function

once parsed we see an error that Esprima failed to parse with the reason being 'unexpected end of input' and the first line is tagged at [0,0]. The reason for this is that the AST returned has no tokens so we cannot find the error location. In this case though, we have support to categorize 'end of input' type errors, so we should use that info and to at least place the error marker on the offending line.
Comment 1 Michael Rennie CLA 2014-10-03 14:48:19 EDT
Fix + new validator test suite + tests:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=498b3a5de52c414b6545f270c45a58c9c0d52eee