aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-10 16:06:13 +0000
committerGitHub <noreply@github.com>2020-11-11 00:06:13 +0800
commitfba27bfb71cd973f76e8d1007edec935f25ace77 (patch)
treeca3173c102dea8a4dfab916244f19a4aa7737766 /test/compress
parent41310e6404951cf9be119cb7cb478be73a98300d (diff)
downloadtracifyjs-fba27bfb71cd973f76e8d1007edec935f25ace77.tar.gz
tracifyjs-fba27bfb71cd973f76e8d1007edec935f25ace77.zip
fix corner case in `evaluate` (#4272)
fixes #4271
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/evaluate.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 9fa65202..46a92ee3 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -3047,3 +3047,30 @@ issue_4214: {
}
expect_stdout: "NaN"
}
+
+issue_4271: {
+ options = {
+ evaluate: true,
+ unsafe: true,
+ }
+ input: {
+ ({
+ p: null,
+ q: (console.log("foo"), 42),
+ p: function() {}
+ })[console.log("bar"), "p"] && console.log("PASS");
+ }
+ expect: {
+ ({
+ p: null,
+ q: (console.log("foo"), 42),
+ p: function() {}
+ })[console.log("bar"), "p"],
+ console.log("PASS");
+ }
+ expect_stdout: [
+ "foo",
+ "bar",
+ "PASS",
+ ]
+}