-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(es/minifer): Update the passing terser test list (#8573)
- Loading branch information
Showing
27 changed files
with
83 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2436_4/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
console.log({ x: (c = { a: 1, b: 2 }).a, y: c.b }); | ||
var c; | ||
console.log({ | ||
x: (c = { | ||
a: 1, | ||
b: 2 | ||
}).a, | ||
y: c.b | ||
}); |
5 changes: 4 additions & 1 deletion
5
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2436_8/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
console.log({ x: (c = o).a, y: c.b }); | ||
var c; | ||
console.log({ | ||
x: (c = o).a, | ||
y: c.b | ||
}); |
6 changes: 4 additions & 2 deletions
6
crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2436_9/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
var o = console; | ||
console.log({ x: (c = o).a, y: c.b }); | ||
var c; | ||
console.log({ | ||
x: (c = console).a, | ||
y: c.b | ||
}); |
2 changes: 1 addition & 1 deletion
2
...ier/tests/terser/compress/dead_code/dead_code_constant_boolean_should_warn_more/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var foo, bar1; | ||
var foo, bar; | ||
var x = 10, y; | ||
var moo; | ||
bar(); |
5 changes: 2 additions & 3 deletions
5
crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_2418_4/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
class C {} | ||
class C { | ||
} | ||
function F() {} | ||
(class c {}); | ||
(function () {}); |
3 changes: 1 addition & 2 deletions
3
crates/swc_ecma_minifier/tests/terser/compress/functions/duplicate_arg_var/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
console.log(((b = "PASS"), b + "ING")); | ||
var b; | ||
console.log("PASSING"); |
4 changes: 1 addition & 3 deletions
4
crates/swc_ecma_minifier/tests/terser/compress/functions/issue_2616/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
var c = "FAIL"; | ||
!(function (NaN) { | ||
(true << NaN) - 0 / 0 || (c = "PASS"); | ||
})([]); | ||
(true << []) - 0 / 0 || (c = "PASS"); | ||
console.log(c); |
12 changes: 5 additions & 7 deletions
12
crates/swc_ecma_minifier/tests/terser/compress/issue_640/conditional/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
1 | a() ? b() : c(); | ||
1 | a() && b(); | ||
1 | a() || c(); | ||
a(), b(); | ||
a(), b(); | ||
a(); | ||
3 ? b() : c(); | ||
3 && b(); | ||
3 || c(); | ||
pure(3 ? 4 : 5); | ||
a(); | ||
b(); | ||
b(); |
17 changes: 4 additions & 13 deletions
17
...er/compress/issue_t292/no_flatten_with_arg_colliding_with_arg_value_inner_scope/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,4 @@ | ||
var g = ["a"]; | ||
function problem(arg) { | ||
return g.indexOf(arg); | ||
} | ||
console.log( | ||
(function (problem) { | ||
return g[problem]; | ||
})( | ||
(function (arg) { | ||
return problem(arg); | ||
})("a") | ||
) | ||
); | ||
var problem, g = [ | ||
"a" | ||
]; | ||
console.log((problem = g.indexOf("a"), g[problem])); |
18 changes: 4 additions & 14 deletions
18
...er/compress/issue_t292/no_flatten_with_var_colliding_with_arg_value_inner_scope/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
var g = ["a"]; | ||
function problem(arg) { | ||
return g.indexOf(arg); | ||
} | ||
console.log( | ||
(function (test) { | ||
var problem = 2 * test; | ||
return console.log(problem), g[problem]; | ||
})( | ||
(function (arg) { | ||
return problem(arg); | ||
})("a") | ||
) | ||
); | ||
var problem, g = [ | ||
"a" | ||
]; | ||
console.log((console.log(problem = 2 * g.indexOf("a")), g[problem])); |
3 changes: 1 addition & 2 deletions
3
crates/swc_ecma_minifier/tests/terser/compress/loops/issue_2740_4/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
for (var x = 0; x < 3; x++) { | ||
for(var x = 0; x < 3; x++){ | ||
var y = 0; | ||
y < 2; | ||
} | ||
console.log(x, y); |
8 changes: 2 additions & 6 deletions
8
crates/swc_ecma_minifier/tests/terser/compress/loops/issue_2740_6/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
const a = 9, | ||
b = 0; | ||
{ | ||
const a = 1; | ||
a < 3; | ||
} | ||
const a = 9, b = 0; | ||
const a1 = 1; | ||
console.log(a, b); |
8 changes: 2 additions & 6 deletions
8
crates/swc_ecma_minifier/tests/terser/compress/loops/issue_2740_7/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
let a = 9, | ||
b = 0; | ||
{ | ||
const a = 1; | ||
a < 3; | ||
} | ||
let a = 9, b = 0; | ||
const a1 = 1; | ||
console.log(a, b); |
8 changes: 2 additions & 6 deletions
8
crates/swc_ecma_minifier/tests/terser/compress/loops/issue_2740_8/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
var a = 9, | ||
b = 0; | ||
{ | ||
const a = 1; | ||
a < 3; | ||
} | ||
var a = 9, b = 0; | ||
const a1 = 1; | ||
console.log(a, b); |
Oops, something went wrong.