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

Bug 495193

Summary: [acorn] No parse error shown for bad import statement
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Olivier_Thomann
Version: 12.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2016-06-01 12:01:27 EDT
Consider the following snippet:

import foo as bar from "someClass";

You get no parse error on foo - but you should.

It gets more confusing since you will get a linting error on 'as' claiming it is unused - this is due to the recovered state, but we should still get the parse error reported.
Comment 1 Olivier Thomann CLA 2016-06-01 12:15:38 EDT
Closing as INVALID. You need to sourceType to be "module" in order to get the syntax error. Otherwise you get another error that the source type needs to be "module" to use import statements.
Comment 2 Michael Rennie CLA 2016-06-01 13:31:05 EDT
Yeah, I forgot about that. In 13.0 we should do a pass over all the module vs. script roughness to make it 'better' - i.e. don't lint module-like statements when not configured to properly do so, as a place to start (maybe)