aboutsummaryrefslogtreecommitdiff
path: root/test/compress/hoist_props.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-04-11 05:19:16 +0800
committerGitHub <noreply@github.com>2018-04-11 05:19:16 +0800
commitba7069d52b8e3eb6eca0fd5b88a20361868bb42c (patch)
tree2e732d148c6362c32a1b60da93a7ee3270047176 /test/compress/hoist_props.js
parent4dd7d0e39baacdd3bf7dc87fc547df66e327f206 (diff)
downloadtracifyjs-ba7069d52b8e3eb6eca0fd5b88a20361868bb42c.tar.gz
tracifyjs-ba7069d52b8e3eb6eca0fd5b88a20361868bb42c.zip
suppress `hoist_props` for embedded assignments (#3074)
Diffstat (limited to 'test/compress/hoist_props.js')
-rw-r--r--test/compress/hoist_props.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index 0e399167..46af9d72 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -824,3 +824,35 @@ issue_3071_2_toplevel: {
}
expect_stdout: "1"
}
+
+issue_3071_3: {
+ options = {
+ hoist_props: true,
+ reduce_vars: true,
+ }
+ input: {
+ var c = 0;
+ (function(a, b) {
+ (function f(o) {
+ var n = 2;
+ while (--b + (o = {
+ p: c++,
+ }) && --n > 0);
+ })();
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = 0;
+ (function(a, b) {
+ (function f(o) {
+ var n = 2;
+ while (--b + (o = {
+ p: c++,
+ }) && --n > 0);
+ })();
+ })();
+ console.log(c);
+ }
+ expect_stdout: "2"
+}