improve --reduce-test (#3719)

- cover missing cases when eliminating unreferenced labels
- format multi-line outputs correctly
This commit is contained in:
Alex Lam S.L
2020-02-14 02:47:20 +00:00
committed by GitHub
parent c01ff76288
commit f01f580d6c
6 changed files with 112 additions and 20 deletions

View File

@@ -0,0 +1,9 @@
var o = this;
for (var k in o) L17060: {
a++;
}
var a;
console.log(k);

View File

@@ -0,0 +1,16 @@
var o = this;
for (var k in o) {
0;
}
var a;
console.log(k);
// output: a
//
// minify: k
//
// options: {
// "mangle": false
// }

View File

@@ -11,5 +11,12 @@ var a_1 = f0();
console.log(b);
// output: -19
//
// minify: -4
// options: {"compress":{"unsafe_math":true},"mangle":false}
//
// options: {
// "compress": {
// "unsafe_math": true
// },
// "mangle": false
// }