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

Bug 427141

Summary: Finder.findToken and Finder.findNode do not handle undefined offsets
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: mamacdon
Version: 5.0   
Target Milestone: 5.0 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2014-01-31 11:33:19 EST
Enter the following in the JS editor:

if(()) {

}

and save. Notice your browser just died.
Comment 2 Michael Rennie CLA 2014-01-31 12:05:03 EST
For some context, the cause of the problem was Esprima not liking the empty statement - which would cause it to throw the following error:

"TypeError: Cannot set property 'range' of null
    at http://target.orion.eclipse.org:8080/esprima/esprima.js:3487:36
    at parseLeftHandSideExpressionAllowCall (http://target.orion.eclipse.org:8080/esprima/esprima.js:1804:48)
    at parsePostfixExpression (http://target.orion.eclipse.org:8080/esprima/esprima.js:1845:20)
    at http://target.orion.eclipse.org:8080/esprima/esprima.js:3482:38
    at parseUnaryExpression (http://target.orion.eclipse.org:8080/esprima/esprima.js:1905:16)
    at http://target.orion.eclipse.org:8080/esprima/esprima.js:3482:38
    at parseMultiplicativeExpression (http://target.orion.eclipse.org:8080/esprima/esprima.js:1911:20)
    at http://target.orion.eclipse.org:8080/esprima/esprima.js:3482:38
    at parseAdditiveExpression (http://target.orion.eclipse.org:8080/esprima/esprima.js:1928:20)
    at http://target.orion.eclipse.org:8080/esprima/esprima.js:3482:38"

which we are trapping as a parse error.