Ben Alpert ff8a10e52f Add option to block-scoping to slow on throw code (#5236)
The let/const plugin can add closures where you don't expect them. This is undesirable in some perf-sensitive projects (ex: React). I added an option that throws whenever the plugin adds a function (as opposed to simply renaming variables when converting to var).
2017-02-06 13:50:56 -05:00

7 lines
102 B
JavaScript

for (let i = 0; i < 5; i++) {
const l = i;
setTimeout(function() {
console.log(l);
}, 1);
}