aboutsummaryrefslogtreecommitdiff
path: root/test/compress/yields.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-06-24 10:09:19 +0100
committerGitHub <noreply@github.com>2021-06-24 17:09:19 +0800
commit82772ccb12cfef97480fa8021032a53f90cd1f45 (patch)
treefb7c6b6ff5a0b21ff63c00b077d776285a3d00b9 /test/compress/yields.js
parent7cbcd114402188d09267d3537894e611d2f13f9a (diff)
downloadtracifyjs-82772ccb12cfef97480fa8021032a53f90cd1f45.tar.gz
tracifyjs-82772ccb12cfef97480fa8021032a53f90cd1f45.zip
workaround Safari quirks (#5033)
closes #5032
Diffstat (limited to 'test/compress/yields.js')
-rw-r--r--test/compress/yields.js74
1 files changed, 74 insertions, 0 deletions
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"
+}