aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/join_vars.js4
-rw-r--r--test/input/reduce/label.js10
-rw-r--r--test/input/reduce/label.reduced.js15
-rw-r--r--test/mocha/reduce.js3
4 files changed, 13 insertions, 19 deletions
diff --git a/test/compress/join_vars.js b/test/compress/join_vars.js
index 9f0b35b7..c2c8e1e4 100644
--- a/test/compress/join_vars.js
+++ b/test/compress/join_vars.js
@@ -277,8 +277,8 @@ join_object_assignments_forin: {
}
expect: {
console.log(function() {
- var o = { a: "PASS" };
- for (var a in o)
+ var o = { a: "PASS" }, a;
+ for (a in o)
return o[a];
}());
}
diff --git a/test/input/reduce/label.js b/test/input/reduce/label.js
index aee57a40..5b0f0593 100644
--- a/test/input/reduce/label.js
+++ b/test/input/reduce/label.js
@@ -1,9 +1,3 @@
-var o = this;
-
-for (var k in o) L17060: {
- a++;
+UNUSED: {
+ console.log(0 - .1 - .1 - .1);
}
-
-var a;
-
-console.log(k);
diff --git a/test/input/reduce/label.reduced.js b/test/input/reduce/label.reduced.js
index a1e79507..ba4b56c9 100644
--- a/test/input/reduce/label.reduced.js
+++ b/test/input/reduce/label.reduced.js
@@ -1,15 +1,12 @@
// (beautified)
-var o = this;
-
-for (var k in o) {}
-
-var a;
-
-console.log(k);
-// output: a
+console.log(0 - 1 - .1 - .1);
+// output: -1.2000000000000002
//
-// minify: k
+// minify: -1.2
//
// options: {
+// "compress": {
+// "unsafe_math": true
+// },
// "mangle": false
// } \ No newline at end of file
diff --git a/test/mocha/reduce.js b/test/mocha/reduce.js
index c1864735..7e2d4601 100644
--- a/test/mocha/reduce.js
+++ b/test/mocha/reduce.js
@@ -24,6 +24,9 @@ describe("test/reduce.js", function() {
});
it("Should eliminate unreferenced labels", function() {
var result = reduce_test(read("test/input/reduce/label.js"), {
+ compress: {
+ unsafe_math: true,
+ },
mangle: false,
}, {
verbose: false,