| Summary: | [esprima] LabeledStatement does not recover correctly | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | steve_northover |
| Version: | 11.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
With the switch to Acorn, this is handled properly. Closing wontfix |
Consider the following snippet: var a = { p: this.g( g: function (){} }; After we try to recover from the incomplete CallExpression 'this.g(' we end up setting null body on the resulting LabeledStatement, which violates the ESTree spec (and will cause Tern to barf out an exception). There are a couple of things to do here: 1. improve our recovery for invalid object property decls (see esprim.js#recoverProperty) 2. add the recoveredNode check in LabeledStatement