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

Bug 495757

Summary: [es6] Add rule to detect let in loops
Product: [ECD] Orion Reporter: Muhammad Mousa <mmousa>
Component: JS ToolsAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 12.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Muhammad Mousa CLA 2016-06-08 17:41:15 EDT
Provide a rule to throw a warning when accessing a let variable outside of the loop it's declared in.

for (let i = 0; i<10; i++) {
  console.log(i); // 0, 1, 2, 3, 4 ... 9
}

console.log(i); // i is not defined
Comment 1 Michael Rennie CLA 2016-06-29 16:51:59 EDT
This works for me.

I'm closing this as worksforme, if you have more information or steps to reproduce, please reopen.