[Pkg-javascript-commits] [uglifyjs] 163/491: more tests for #2158 (#2160)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:31 UTC 2018


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.

commit 285401ced889dcbc24c7431ae299bfbe328c5df5
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Sun Jun 25 14:21:48 2017 +0800

    more tests for #2158 (#2160)
---
 test/compress/pure_getters.js | 50 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js
index 2e7e17d..dc56e19 100644
--- a/test/compress/pure_getters.js
+++ b/test/compress/pure_getters.js
@@ -288,6 +288,56 @@ set_immutable_2: {
     expect_stdout: "PASS"
 }
 
+set_immutable_3: {
+    options = {
+        collapse_vars: true,
+        evaluate: true,
+        pure_getters: "strict",
+        reduce_vars: true,
+        toplevel: true,
+        unused: true,
+    }
+    input: {
+        "use strict";
+        var a = 1;
+        a.foo += "";
+        if (a.foo) console.log("FAIL");
+        else console.log("PASS");
+    }
+    expect: {
+        "use strict";
+        1..foo += "";
+        if (1..foo) console.log("FAIL");
+        else console.log("PASS");
+    }
+    expect_stdout: true
+}
+
+set_immutable_4: {
+    options = {
+        cascade: true,
+        conditionals: true,
+        pure_getters: "strict",
+        reduce_vars: true,
+        sequences: true,
+        side_effects: true,
+        toplevel: true,
+    }
+    input: {
+        "use strict";
+        var a = 1;
+        a.foo += "";
+        if (a.foo) console.log("FAIL");
+        else console.log("PASS");
+    }
+    expect: {
+        "use strict";
+        var a = 1;
+        a.foo += "", a.foo ? console.log("FAIL") : console.log("PASS");
+    }
+    expect_stdout: true
+}
+
 set_mutable_1: {
     options = {
         collapse_vars: true,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list