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

Bug 491727

Summary: [acorn] Infinite loop in parser
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: 10.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2016-04-14 14:29:00 EDT
Steps:

1. open org.eclipse.orion.client.javascript/web/javascript/quickFixes.js
2. add the char ` in the line 175 like:
   getDocOffset(`ast.sourceFile.text, comment.range[0])
3. the editor will hang.

I debugged a bit and it is a problem of the loose parser resetting the offset and then re-walking the same offsets  over and over.

I'll try to condense it a bit and open a bug against Acorn. In the meantime we should fix it on our side so the editor doesn't hang.
Comment 1 Michael Rennie CLA 2016-04-14 17:41:00 EDT
Condensed snippet:

var v1 = foo(`bar), 
    v2;