diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-19 20:13:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-19 20:13:50 +0800 |
commit | e21bab7ce65e6a4db0ea966b3336eaab2a634e6e (patch) | |
tree | 23bd5d47a7ed3f9f0efcb925c8025b4e8139330d /test | |
parent | ac9a168fba726d9ab437478c81626f098997d116 (diff) | |
download | tracifyjs-e21bab7ce65e6a4db0ea966b3336eaab2a634e6e.tar.gz tracifyjs-e21bab7ce65e6a4db0ea966b3336eaab2a634e6e.zip |
avoid duplicate property names in object literals under "use strict" (#2818)
fixes #2816
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/properties.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js index 53684daa..dbc7bf2d 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -1561,3 +1561,30 @@ join_object_assignments_regex: { } expect_stdout: "1" } + +issue_2816: { + options = { + join_vars: true, + } + input: { + "use strict"; + var o = { + a: 1 + }; + o.b = 2; + o.a = 3; + o.c = 4; + console.log(o.a, o.b, o.c); + } + expect: { + "use strict"; + var o = { + a: 1, + b: 2 + }; + o.a = 3; + o.c = 4; + console.log(o.a, o.b, o.c); + } + expect_stdout: "3 2 4" +} |