[Pkg-javascript-commits] [uglifyjs] 308/491: more tests for #2535 (#2551)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:47 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 85c56adbd19bff5e7bc2a59dd937799b7bc5a8d4
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Sat Dec 2 02:26:56 2017 +0800

    more tests for #2535 (#2551)
---
 test/compress/evaluate.js | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 8e030d2..6106fce 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -1306,3 +1306,37 @@ issue_2535_2: {
         x();
     }
 }
+
+issue_2535_3: {
+    options = {
+        booleans: true,
+        evaluate: true,
+    }
+    input: {
+        console.log(Object(1) && 1 && 2);
+        console.log(Object(1) && true && 1 && 2 && Object(2));
+        console.log(Object(1) && true && 1 && null && 2 && Object(2));
+        console.log(2 == Object(1) || 0 || void 0 || null);
+        console.log(2 == Object(1) || 0 || void 0 || null || Object(2));
+        console.log(2 == Object(1) || 0 || void 0 || "ok" || null || Object(2));
+    }
+    expect: {
+        console.log(Object(1) && 2);
+        console.log(Object(1) && Object(2));
+        console.log(Object(1) && null);
+        console.log(2 == Object(1) || null);
+        console.log(2 == Object(1) || Object(2));
+        console.log(2 == Object(1) || "ok");
+    }
+    expect_stdout: true
+    expect_warnings: [
+        "WARN: Dropping side-effect-free && [test/compress/evaluate.js:1316,20]",
+        "WARN: Dropping side-effect-free && [test/compress/evaluate.js:1317,20]",
+        "WARN: Dropping side-effect-free && [test/compress/evaluate.js:1318,20]",
+        "WARN: Condition left of && always false [test/compress/evaluate.js:1318,20]",
+        "WARN: Dropping side-effect-free || [test/compress/evaluate.js:1319,20]",
+        "WARN: Dropping side-effect-free || [test/compress/evaluate.js:1320,20]",
+        "WARN: Dropping side-effect-free || [test/compress/evaluate.js:1321,20]",
+        "WARN: Condition left of || always true [test/compress/evaluate.js:1321,20]",
+    ]
+}

-- 
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