| Summary: | Error opening file with import declaration | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Olivier Thomann <Olivier_Thomann> |
| Component: | JS Tools | Assignee: | Olivier Thomann <Olivier_Thomann> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, Michael_Rennie |
| Version: | 11.0 | ||
| Target Milestone: | 12.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
I think we should just check if id exists before calling id.range. This only happens if the source type is script and module is not enabled. I added a regression test. Delivered as commit 25f8b542769b5ce467b423210a533f37033fba71. |
Opening this file: import { cube } from 'myModule' cube(4) Where myModule.js is defined as: // module "myModule.js" export function cube(x) { return x * x * x; } var a; export { a as b } leads to this error: TypeError: Cannot read property 'range' of undefined at http://oliviert.orion.eclipse.org:9000/eslint/lib/load-rules-async.js:1722:20 at Array.forEach (native) at EventEmitter.check (http://oliviert.orion.eclipse.org:9000/eslint/lib/load-rules-async.js:1716:29) at http://oliviert.orion.eclipse.org:9000/eslint/lib/events.js:109:14 at Array.forEach (native) at EventEmitter.emit (http://oliviert.orion.eclipse.org:9000/eslint/lib/events.js:107:14) at NodeEventGenerator.enterNode (http://oliviert.orion.eclipse.org:9000/eslint/lib/node-event-generator.js:45:22) at CommentEventGenerator.enterNode (http://oliviert.orion.eclipse.org:9000/eslint/lib/comment-event-generator.js:101:23) at Controller.enter (http://oliviert.orion.eclipse.org:9000/eslint/lib/eslint.js:770:36) at Controller.__execute (http://oliviert.orion.eclipse.org:9000/estraverse/estraverse.js:398:31)