UNPKG

defs

Version:

Static scope analysis and transpilation of ES6 block scoped const and let variables, to ES3.

14 lines (11 loc) 238 B
"use strict"; // v8 --harmony correctly prints 9 9 9: // note that the loop terminates var arr = []; for (let x in [0,1,2]) { let x = 9; arr.push(function() { console.log(x); }); } arr.forEach(function(f) { f(); });