aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-26 08:43:53 +0000
committerGitHub <noreply@github.com>2021-02-26 16:43:53 +0800
commitea52339502ac0436532e55a6980df0785736c8fb (patch)
tree2617155b83a8b95536378219d0373afeb687f88d
parent992952d8f6101ebefecf6ca5291d31290da8862f (diff)
downloadtracifyjs-ea52339502ac0436532e55a6980df0785736c8fb.tar.gz
tracifyjs-ea52339502ac0436532e55a6980df0785736c8fb.zip
use strict-mode-safe placeholder (#4694)
-rw-r--r--lib/compress.js6
-rw-r--r--test/compress/default-values.js4
-rw-r--r--test/compress/yields.js2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/compress.js b/lib/compress.js
index b2825ada..16d86d90 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -8738,9 +8738,9 @@ merge(Compressor.prototype, {
}
function make_void_lhs(orig) {
- return make_node(AST_Sub, orig, {
- expression: make_node(AST_Number, orig, { value: 0 }),
- property: make_node(AST_Number, orig, { value: 0 }),
+ return make_node(AST_Dot, orig, {
+ expression: make_node(AST_Array, orig, { elements: [] }),
+ property: "e",
});
}
diff --git a/test/compress/default-values.js b/test/compress/default-values.js
index ac89b1ed..d4e51750 100644
--- a/test/compress/default-values.js
+++ b/test/compress/default-values.js
@@ -473,7 +473,7 @@ inline_side_effects_2: {
}
expect: {
var a = 42;
- [ 0[0] = --a ] = [ console ];
+ [ [].e = --a ] = [ console ];
console.log(a);
}
expect_stdout: "42"
@@ -1477,7 +1477,7 @@ issue_4502_4: {
(function(a, b = console.log("FAIL")) {})(..."" + console.log(42));
}
expect: {
- [ , 0[0] = console.log("FAIL") ] = [ ..."" + console.log(42) ];
+ [ , [].e = console.log("FAIL") ] = [ ..."" + console.log(42) ];
}
expect_stdout: "42"
node_version: ">=6"
diff --git a/test/compress/yields.js b/test/compress/yields.js
index eac47e22..dc3dacf5 100644
--- a/test/compress/yields.js
+++ b/test/compress/yields.js
@@ -690,7 +690,7 @@ drop_body: {
})([ console.log("baz") ]);
}
expect: {
- [ [ , 0[0] = console.log("foo") ] ] = [ [ console.log("baz") ] ];
+ [ [ , [].e = console.log("foo") ] ] = [ [ console.log("baz") ] ];
}
expect_stdout: [
"baz",