rename let-scoping tests to traceur-let-scoping and add additional let-scoping tests
This commit is contained in:
parent
0544e98fb1
commit
11d55e661e
10
test/fixtures/transformation/let-scoping/for-break-continue-return/actual.js
vendored
Normal file
10
test/fixtures/transformation/let-scoping/for-break-continue-return/actual.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
for (let i in nums) {
|
||||
fns.push(function () { return i; });
|
||||
if (i === 1) {
|
||||
continue;
|
||||
} else if (i === 2) {
|
||||
break;
|
||||
} else if (i === 3) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
24
test/fixtures/transformation/let-scoping/for-break-continue-return/expected.js
vendored
Normal file
24
test/fixtures/transformation/let-scoping/for-break-continue-return/expected.js
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
_loop: for (var i in nums) {
|
||||
var _ret = (function (i) {
|
||||
fns.push(function () {
|
||||
return i;
|
||||
});
|
||||
if (i === 1) {
|
||||
return "continue";
|
||||
} else if (i === 2) {
|
||||
return "break";
|
||||
} else if (i === 3) {
|
||||
return {
|
||||
v: i
|
||||
};
|
||||
}
|
||||
})(i);
|
||||
|
||||
switch (_ret) {
|
||||
case "break": break _loop;
|
||||
case "continue": continue _loop;
|
||||
default: if (typeof _ret === "object") return _ret.v;
|
||||
}
|
||||
}
|
||||
4
test/fixtures/transformation/let-scoping/for-break/actual.js
vendored
Normal file
4
test/fixtures/transformation/let-scoping/for-break/actual.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
for (let i in nums) {
|
||||
fns.push(function () { return i; });
|
||||
break;
|
||||
}
|
||||
12
test/fixtures/transformation/let-scoping/for-break/expected.js
vendored
Normal file
12
test/fixtures/transformation/let-scoping/for-break/expected.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
_loop: for (var i in nums) {
|
||||
var _ret = (function (i) {
|
||||
fns.push(function () {
|
||||
return i;
|
||||
});
|
||||
return "break";
|
||||
})(i);
|
||||
|
||||
if (_ret === "break") break _loop;
|
||||
}
|
||||
4
test/fixtures/transformation/let-scoping/for-continue/actual.js
vendored
Normal file
4
test/fixtures/transformation/let-scoping/for-continue/actual.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
for (let i in nums) {
|
||||
fns.push(function () { return i; });
|
||||
continue;
|
||||
}
|
||||
12
test/fixtures/transformation/let-scoping/for-continue/expected.js
vendored
Normal file
12
test/fixtures/transformation/let-scoping/for-continue/expected.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
_loop: for (var i in nums) {
|
||||
var _ret = (function (i) {
|
||||
fns.push(function () {
|
||||
return i;
|
||||
});
|
||||
return "continue";
|
||||
})(i);
|
||||
|
||||
if (_ret === "continue") continue _loop;
|
||||
}
|
||||
4
test/fixtures/transformation/let-scoping/for-return-undefined/actual.js
vendored
Normal file
4
test/fixtures/transformation/let-scoping/for-return-undefined/actual.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
for (let i in nums) {
|
||||
fns.push(function () { return i; });
|
||||
return;
|
||||
}
|
||||
14
test/fixtures/transformation/let-scoping/for-return-undefined/expected.js
vendored
Normal file
14
test/fixtures/transformation/let-scoping/for-return-undefined/expected.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
for (var i in nums) {
|
||||
var _ret = (function (i) {
|
||||
fns.push(function () {
|
||||
return i;
|
||||
});
|
||||
return {
|
||||
v: undefined
|
||||
};
|
||||
})(i);
|
||||
|
||||
if (typeof _ret === "object") return _ret.v;
|
||||
}
|
||||
4
test/fixtures/transformation/let-scoping/for-return/actual.js
vendored
Normal file
4
test/fixtures/transformation/let-scoping/for-return/actual.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
for (let i in nums) {
|
||||
fns.push(function () { return i; });
|
||||
return i;
|
||||
}
|
||||
14
test/fixtures/transformation/let-scoping/for-return/expected.js
vendored
Normal file
14
test/fixtures/transformation/let-scoping/for-return/expected.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
for (var i in nums) {
|
||||
var _ret = (function (i) {
|
||||
fns.push(function () {
|
||||
return i;
|
||||
});
|
||||
return {
|
||||
v: i
|
||||
};
|
||||
})(i);
|
||||
|
||||
if (typeof _ret === "object") return _ret.v;
|
||||
}
|
||||
3
test/fixtures/transformation/let-scoping/function/actual.js
vendored
Normal file
3
test/fixtures/transformation/let-scoping/function/actual.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
function test() {
|
||||
let foo = "bar";
|
||||
}
|
||||
5
test/fixtures/transformation/let-scoping/function/expected.js
vendored
Normal file
5
test/fixtures/transformation/let-scoping/function/expected.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
function test() {
|
||||
var foo = "bar";
|
||||
}
|
||||
1
test/fixtures/transformation/let-scoping/program/actual.js
vendored
Normal file
1
test/fixtures/transformation/let-scoping/program/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
let test = "foo";
|
||||
3
test/fixtures/transformation/let-scoping/program/expected.js
vendored
Normal file
3
test/fixtures/transformation/let-scoping/program/expected.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
var test = "foo";
|
||||
Loading…
x
Reference in New Issue
Block a user