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

Bug 470098

Summary: [esprima] Invalid return statement is being incorrectly reported
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: 8.0   
Target Milestone: 9.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2015-06-12 13:00:40 EDT
Consider the following snippet:

return 3;

The parsing problem reported mentions:

'Esprima failed to parse this file because an error occurred: Invalid return statement'

The problem is that the token reference is not being passed into the tolerant error reporter so we are not re-formatting the reported problem correctly. The produced AST is correct (Esprima completed parsing), just that the error is misleading.