aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/compress/sandbox.js14
-rw-r--r--test/sandbox.js5
2 files changed, 18 insertions, 1 deletions
diff --git a/test/compress/sandbox.js b/test/compress/sandbox.js
new file mode 100644
index 00000000..6c2be933
--- /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 ca1781c6..cb1e18c9 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);
}));