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

Bug 495819

Summary: [es6] Wrong scope returned for Program in module mode
Product: [ECD] Orion Reporter: Olivier Thomann <Olivier_Thomann>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 11.0   
Target Milestone: 12.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Olivier Thomann CLA 2016-06-09 12:57:32 EDT
When the sourceType is "module", the following code doesn't return a redefine variable for 'a'.
var a;
var a;

This comes from the scope. context.getScope() returns a "global" scope. In module mode, the actual variables are defined into a child scope whereas in script mode, they are defined directly in the global scope.
This should be fixed for 12.0 as it might impact more rules than just the "no-redeclare" rule.
Comment 1 Olivier Thomann CLA 2016-06-10 13:18:50 EDT
This is fixed as part of bug 495744.