mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
* Add test for `const` with `tdz` * Rewrite block-scoping plugin * Update block-scoping fixtures * Update other fixtures * Fix `let` shadowing variable read in a sibling scope * Update fixtures * Update Babel 8 fixtures * Add minNodeVersion * Fix block scoped vars shadowing globals * Review by JLHwung * minNodeVersion to class fields test
39 lines
574 B
JavaScript
39 lines
574 B
JavaScript
function foo() {
|
|
var x = 5;
|
|
console.log(x);
|
|
{
|
|
var _x = 7;
|
|
setTimeout(function () {
|
|
return _x;
|
|
}, 0);
|
|
}
|
|
}
|
|
function bar() {
|
|
var x = 5;
|
|
console.log(x);
|
|
var _loop = function () {
|
|
{
|
|
var _x2 = i;
|
|
setTimeout(function () {
|
|
return _x2;
|
|
}, 0);
|
|
}
|
|
};
|
|
for (var i = 0; i < 7; i++) {
|
|
_loop();
|
|
}
|
|
}
|
|
function baz() {
|
|
var x = 5;
|
|
console.log(x);
|
|
for (var i = 0; i < 7; i++) {
|
|
var qux = function qux(y) {
|
|
var x = y;
|
|
setTimeout(function () {
|
|
return x;
|
|
}, 0);
|
|
};
|
|
qux(i);
|
|
}
|
|
}
|