aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-03-08 20:40:21 +0000
committerGitHub <noreply@github.com>2021-03-09 04:40:21 +0800
commitf4ee0f651c952eb85753633a990a598267981bcb (patch)
tree83fbc0251e0ea4e4091937fbe6b04c7540303aa5 /test/compress
parent077512d1515d9fbd4e19bce79be75a09df8d5619 (diff)
downloadtracifyjs-f4ee0f651c952eb85753633a990a598267981bcb.tar.gz
tracifyjs-f4ee0f651c952eb85753633a990a598267981bcb.zip
fix corner case in `unsafe` (#4755)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/evaluate.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 597c7c87..c92e82bd 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -847,6 +847,8 @@ unsafe_charAt_noop: {
unsafe: true,
}
input: {
+ s = "foo";
+ x = 42;
console.log(
s.charAt(0),
"string".charAt(x),
@@ -854,12 +856,15 @@ unsafe_charAt_noop: {
);
}
expect: {
+ s = "foo";
+ x = 42;
console.log(
- s[0],
- "string"[0 | x],
- (typeof x)[0]
+ s[0] || "",
+ "string"[0 | x] || "",
+ (typeof x)[0] || ""
);
}
+ expect_stdout: "f n"
}
issue_1649: {