From 82772ccb12cfef97480fa8021032a53f90cd1f45 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 24 Jun 2021 10:09:19 +0100 Subject: workaround Safari quirks (#5033) closes #5032 --- test/compress/yields.js | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'test/compress/yields.js') 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" +} -- cgit v1.2.3