diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-04-11 01:35:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 01:35:42 +0800 |
commit | 90199d0a961bb75cc5bf6d8ade8bf5b0098cb341 (patch) | |
tree | 83244a64461675dcdb7ca54e35058693c577916e /test/compress | |
parent | b82fd0ad41983065ad6f58d9bfe4dac7720909bf (diff) | |
download | tracifyjs-90199d0a961bb75cc5bf6d8ade8bf5b0098cb341.tar.gz tracifyjs-90199d0a961bb75cc5bf6d8ade8bf5b0098cb341.zip |
extend `join_vars` on object assignments (#3072)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/properties.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js index ec99c090..efe0d491 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -1208,6 +1208,37 @@ join_object_assignments_3: { expect_stdout: "PASS" } +join_object_assignments_4: { + options = { + join_vars: true, + sequences: true, + } + input: { + var o; + console.log(o); + o = {}; + o.a = "foo"; + console.log(o.b); + o.b = "bar"; + console.log(o.a); + } + expect: { + var o; + console.log(o), + o = { + a: "foo", + }, + console.log(o.b), + o.b = "bar", + console.log(o.a); + } + expect_stdout: [ + "undefined", + "undefined", + "foo", + ] +} + join_object_assignments_return_1: { options = { join_vars: true, |