hoist var declarations to before function definition when let block scoping
This commit is contained in:
2
test/fixtures/block-binding/hoist-multiple/actual.js
vendored
Normal file
2
test/fixtures/block-binding/hoist-multiple/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
let MULTIPLIER = 5;
|
||||
var foo = "bar", bar = "foo";
|
||||
7
test/fixtures/block-binding/hoist-multiple/expected.js
vendored
Normal file
7
test/fixtures/block-binding/hoist-multiple/expected.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var foo;
|
||||
var bar;
|
||||
(function () {
|
||||
var MULTIPLIER = 5;
|
||||
foo = "bar";
|
||||
bar = "foo";
|
||||
})();
|
||||
2
test/fixtures/block-binding/hoist/actual.js
vendored
Normal file
2
test/fixtures/block-binding/hoist/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
let MULTIPLIER = 5;
|
||||
var foo = "bar";
|
||||
5
test/fixtures/block-binding/hoist/expected.js
vendored
Normal file
5
test/fixtures/block-binding/hoist/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var foo;
|
||||
(function () {
|
||||
var MULTIPLIER = 5;
|
||||
foo = "bar";
|
||||
})();
|
||||
3
test/fixtures/constants/program/expected.js
vendored
3
test/fixtures/constants/program/expected.js
vendored
@@ -1,6 +1,7 @@
|
||||
var i;
|
||||
(function () {
|
||||
var MULTIPLIER = 5;
|
||||
for (var i in arr) {
|
||||
for (i in arr) {
|
||||
console.log(arr[i] * MULTIPLIER);
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user