| Summary: | No error on missing RHS of || operator | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | Michael_Rennie |
| Version: | 5.0 | ||
| Target Milestone: | 6.0 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Its a boo boo in some of our recovery, we trap the exception from parsing the assignment (property) and continue on, without recording the error. Pushed to Gerrit: https://git.eclipse.org/r/28754 |
1. Create a new js file containing this code: var foo, bar; foo({ aaa: 2 || 1, bbb: 2 || , // !!!! ccc: bar.port, }); 2. The line with !!!! is missing the right-hand operand of the "||" expression -- this is a syntax error 3. Save the file. I expected to see an error marker, but I see none. I briefly debugged the ASTManager, and found that esprima.parse() returns without throwing an error, and the resulting ast.errors array is empty. If I parse the same code using http://esprima.org/demo/parse.html I get > "Line 4: Unexpected token ,"