[Pkg-javascript-commits] [uglifyjs] 474/491: evaluate `to{Low, Upp}erCase()` under `unsafe` (#2886)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:52:05 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 d69d8007d6f9d3ee5a202b089ed6319cb33e69f9
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Tue Feb 6 15:57:15 2018 +0800

    evaluate `to{Low,Upp}erCase()` under `unsafe` (#2886)
---
 lib/compress.js           |  2 ++
 test/compress/evaluate.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/lib/compress.js b/lib/compress.js
index a48d0c9..142728c 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2224,6 +2224,8 @@ merge(Compressor.prototype, {
             "split",
             "substr",
             "substring",
+            "toLowerCase",
+            "toUpperCase",
             "trim",
         ].concat(object_fns),
     };
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 0d26982..41b599e 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -1374,3 +1374,58 @@ issue_2822: {
     }
     expect_stdout: "PASS"
 }
+
+string_case: {
+    options = {
+        evaluate: true,
+        unsafe: true,
+    }
+    input: {
+        console.log("İ".toLowerCase().charCodeAt(0));
+        console.log("I".toLowerCase().charCodeAt(0));
+        console.log("Ş".toLowerCase().charCodeAt(0));
+        console.log("Ğ".toLowerCase().charCodeAt(0));
+        console.log("Ü".toLowerCase().charCodeAt(0));
+        console.log("Ö".toLowerCase().charCodeAt(0));
+        console.log("Ç".toLowerCase().charCodeAt(0));
+        console.log("i".toUpperCase().charCodeAt(0));
+        console.log("ı".toUpperCase().charCodeAt(0));
+        console.log("ş".toUpperCase().charCodeAt(0));
+        console.log("ğ".toUpperCase().charCodeAt(0));
+        console.log("ü".toUpperCase().charCodeAt(0));
+        console.log("ö".toUpperCase().charCodeAt(0));
+        console.log("ç".toUpperCase().charCodeAt(0));
+    }
+    expect: {
+        console.log(105);
+        console.log(105);
+        console.log(351);
+        console.log(287);
+        console.log(252);
+        console.log(246);
+        console.log(231);
+        console.log(73);
+        console.log(73);
+        console.log(350);
+        console.log(286);
+        console.log(220);
+        console.log(214);
+        console.log(199);
+    }
+    expect_stdout: [
+        "105",
+        "105",
+        "351",
+        "287",
+        "252",
+        "246",
+        "231",
+        "73",
+        "73",
+        "350",
+        "286",
+        "220",
+        "214",
+        "199",
+    ]
+}

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