aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-10 10:35:24 +0100
committerGitHub <noreply@github.com>2020-05-10 10:35:24 +0100
commitc4c9c6d37de8074bba3e433621bc70f88d7631ae (patch)
tree32be0c8342ce4089bb649332b45cefe085135fbc /test/compress
parent33f3b0c1d9654e137b54802afbfb6d8e70c8cbd6 (diff)
downloadtracifyjs-c4c9c6d37de8074bba3e433621bc70f88d7631ae.tar.gz
tracifyjs-c4c9c6d37de8074bba3e433621bc70f88d7631ae.zip
fix corner case in `hoist_props` (#3869)
fixes #3868
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/hoist_props.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index 563c7aab..cc7ef020 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -912,3 +912,31 @@ issue_3440: {
}
expect_stdout: "PASS"
}
+
+issue_3868: {
+ options = {
+ hoist_props: true,
+ passes: 2,
+ reduce_vars: true,
+ side_effects: true,
+ }
+ input: {
+ (function(t) {
+ t = {};
+ ({
+ get p() {},
+ q: (console.log("PASS"), +t),
+ }).r;
+ })();
+ }
+ expect: {
+ (function(t) {
+ t = {};
+ ({
+ get p() {},
+ q: (console.log("PASS"), +t),
+ }).r;
+ })();
+ }
+ expect_stdout: "PASS"
+}