diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-06-24 10:09:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 17:09:19 +0800 |
commit | 82772ccb12cfef97480fa8021032a53f90cd1f45 (patch) | |
tree | fb7c6b6ff5a0b21ff63c00b077d776285a3d00b9 /test | |
parent | 7cbcd114402188d09267d3537894e611d2f13f9a (diff) | |
download | tracifyjs-82772ccb12cfef97480fa8021032a53f90cd1f45.tar.gz tracifyjs-82772ccb12cfef97480fa8021032a53f90cd1f45.zip |
workaround Safari quirks (#5033)
closes #5032
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/awaits.js | 74 | ||||
-rw-r--r-- | test/compress/yields.js | 74 |
2 files changed, 148 insertions, 0 deletions
diff --git a/test/compress/awaits.js b/test/compress/awaits.js index adfc9e4a..a0d744ba 100644 --- a/test/compress/awaits.js +++ b/test/compress/awaits.js @@ -1915,3 +1915,77 @@ issue_5023_2: { expect_stdout: "PASS" node_version: ">=8" } + +issue_5032_normal: { + options = { + merge_vars: true, + webkit: false, + } + input: { + function log(value) { + console.log(value); + return value; + } + async function f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS"); + } + expect: { + function log(value) { + console.log(value); + return value; + } + async function f(c) { + var b = log(c), c = b; + log(b); + log(c); + } + f("PASS"); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] + node_version: ">=8" +} + +issue_5032_webkit: { + options = { + merge_vars: true, + webkit: true, + } + input: { + function log(value) { + console.log(value); + return value; + } + async function f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS"); + } + expect: { + function log(value) { + console.log(value); + return value; + } + async function f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS"); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] + node_version: ">=8" +} diff --git a/test/compress/yields.js b/test/compress/yields.js index 2e0816e5..5761d85e 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -1142,3 +1142,77 @@ issue_5019_2: { ] node_version: ">=4" } + +issue_5032_normal: { + options = { + merge_vars: true, + webkit: false, + } + input: { + function log(value) { + console.log(value); + return value; + } + function *f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS").next(); + } + expect: { + function log(value) { + console.log(value); + return value; + } + function *f(c) { + var b = log(c), c = b; + log(b); + log(c); + } + f("PASS").next(); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] + node_version: ">=4" +} + +issue_5032_webkit: { + options = { + merge_vars: true, + webkit: true, + } + input: { + function log(value) { + console.log(value); + return value; + } + function *f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS").next(); + } + expect: { + function log(value) { + console.log(value); + return value; + } + function *f(a) { + var b = log(a), c = b; + log(b); + log(c); + } + f("PASS").next(); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] + node_version: ">=4" +} |