aboutsummaryrefslogtreecommitdiff
path: root/test/compress/properties.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-10-22 13:14:15 +0800
committerGitHub <noreply@github.com>2017-10-22 13:14:15 +0800
commit516eaef50c66aede72d3478a5653ae8651806258 (patch)
treed31d47d2c40a8c7e36ec1610e21a8f3ce0856260 /test/compress/properties.js
parent4ae1fb3ed8380d06220fd242037bd277fc21c17d (diff)
downloadtracifyjs-516eaef50c66aede72d3478a5653ae8651806258.tar.gz
tracifyjs-516eaef50c66aede72d3478a5653ae8651806258.zip
fix `unsafe` evaluation of `AST_Sub` (#2389)
Diffstat (limited to 'test/compress/properties.js')
-rw-r--r--test/compress/properties.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js
index c8a85697..45f870df 100644
--- a/test/compress/properties.js
+++ b/test/compress/properties.js
@@ -805,7 +805,7 @@ issue_2256: {
}
}
-lhs_prop: {
+lhs_prop_1: {
options = {
evaluate: true,
unsafe: true,
@@ -822,3 +822,22 @@ lhs_prop: {
}
expect_stdout: "2"
}
+
+lhs_prop_2: {
+ options = {
+ evaluate: true,
+ inline: true,
+ reduce_vars: true,
+ side_effects: true,
+ unsafe: true,
+ unused: true,
+ }
+ input: {
+ (function(a) {
+ a[2] = "g";
+ })("abc");
+ }
+ expect: {
+ "abc"[2] = "g";
+ }
+}