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

Bug 427328

Summary: [esprima] Handle Esprima not returning a token stream for parse problems
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 5.0   
Target Milestone: 5.0 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2014-02-03 16:08:35 EST
In some cases Esprima seems to barf and not return a token stream when it encounters a parse error, we should handle these cases and try to hobble together the syntax error for the end-user.

Consider the following snippet:

function(

we still get a parse error from Esprima, but no token stream. You can add that snippet at the end of any JS file and no tokens will be returned. In the [revious example I would expect there to be a keyword token and a punctuator token.