diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-11 22:45:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 06:45:59 +0800 |
commit | fd0d28e4652b8709d41031ef94594a50266f7c01 (patch) | |
tree | a00efbbb387ad536b55041da790903c9658e51c0 /test/compress | |
parent | 2123f38394d4c98fcb4acdc0378ffd86fd9bec9a (diff) | |
download | tracifyjs-fd0d28e4652b8709d41031ef94594a50266f7c01.tar.gz tracifyjs-fd0d28e4652b8709d41031ef94594a50266f7c01.zip |
fix corner case in `spread` (#4370)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/spread.js | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/test/compress/spread.js b/test/compress/spread.js index 78348758..41715514 100644 --- a/test/compress/spread.js +++ b/test/compress/spread.js @@ -250,6 +250,31 @@ reduce_vars_2: { node_version: ">=6" } +convert_setter: { + options = { + objects: true, + spread: true, + } + input: { + var o = { + ...{ + set PASS(v) {}, + }, + }; + for (var k in o) + console.log(k, o[k]); + } + expect: { + var o = { + PASS: void 0, + }; + for (var k in o) + console.log(k, o[k]); + } + expect_stdout: "PASS undefined" + node_version: ">=8" +} + keep_getter_1: { options = { side_effects: true, @@ -773,9 +798,7 @@ issue_4363: { } expect: { ({ - ...{ - set [console.log("PASS")](v) {}, - }, + [console.log("PASS")]: void 0, }); } expect_stdout: "PASS" |