[Pkg-javascript-commits] [uglifyjs] 134/491: fix portability of `sandbox.run_code()` on Node.js 0.1x (#2078)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:29 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 4ad7b1dae46fb5bf98f12859b2906381421563d4
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Sat Jun 10 01:08:58 2017 +0800

    fix portability of `sandbox.run_code()` on Node.js 0.1x (#2078)
---
 test/compress/sandbox.js | 14 ++++++++++++++
 test/sandbox.js          |  5 ++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/test/compress/sandbox.js b/test/compress/sandbox.js
new file mode 100644
index 0000000..6c2be93
--- /dev/null
+++ b/test/compress/sandbox.js
@@ -0,0 +1,14 @@
+console_log: {
+    input: {
+        console.log("%% %s");
+        console.log("%% %s", "%s");
+    }
+    expect: {
+        console.log("%% %s");
+        console.log("%% %s", "%s");
+    }
+    expect_stdout: [
+        "%% %s",
+        "% %s",
+    ]
+}
diff --git a/test/sandbox.js b/test/sandbox.js
index ca1781c..cb1e18c 100644
--- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -52,7 +52,10 @@ exports.run_code = function(code) {
             "}();",
         ].join("\n"), {
             console: {
-                log: function() {
+                log: function(msg) {
+                    if (arguments.length == 1 && typeof msg == "string") {
+                        return console.log("%s", msg);
+                    }
                     return console.log.apply(console, [].map.call(arguments, function(arg) {
                         return safe_log(arg, 3);
                     }));

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