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

Bug 471340

Summary: [esprima] Parsing / inferring broken case statement throws exception
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: curtis.windatt.public
Version: 10.0   
Target Milestone: 10.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2015-06-29 11:27:40 EDT
While coding in finder.js, I had started entering a new switch case for ArrowFunctionExpression, and got hammered with the following exception:

Uncaught TypeError: Cannot read property 'type' of undefined 
@ walk.js:28r 
@ walk.js:163s 
@ walk.js:29a.LabeledStatement 
@ walk.js:184s 
@ walk.js:29r 
@ walk.js:163s 
@ walk.js:29a.Program.a.BlockStatement 
@ walk.js:171s 
@ walk.js:29e.simple 
@ walk.js:32o 
@ doc_comment.js:28j 
@ infer.js:1163e.parse 
@ infer.js:1200i 
@ tern.js:79p 
@ tern.js:271c 
@ tern.js:234a 
@ tern.js:184n.mixin.request 
@ tern.js:141t 
@ ternHoverHandler.js:26onmessage 
@ ternWorkerCore.js:182

Two things we should do here:

1. be more tolerant to missing punctuation (in this case the missing ':')
2. in the event all other recovery fails, insert the RecoveredNode instead of a null body decl