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
35 lines
621 B
JavaScript
35 lines
621 B
JavaScript
function WithoutCurlyBraces() {
|
|
var _this = this;
|
|
if (true) {
|
|
var _loop = function () {
|
|
function foo() {
|
|
return this;
|
|
}
|
|
function bar() {
|
|
return foo.call(this);
|
|
}
|
|
console.log(_this, k); // => undefined
|
|
};
|
|
for (var k in kv) {
|
|
_loop();
|
|
}
|
|
}
|
|
}
|
|
function WithCurlyBraces() {
|
|
var _this2 = this;
|
|
if (true) {
|
|
var _loop2 = function () {
|
|
function foo() {
|
|
return this;
|
|
}
|
|
function bar() {
|
|
return foo.call(this);
|
|
}
|
|
console.log(_this2, k); // => 777
|
|
};
|
|
for (var k in kv) {
|
|
_loop2();
|
|
}
|
|
}
|
|
}
|