From 73e6b2550bf0cc08e4bc95ac1e1d3b8b650c5bf8 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 13 Mar 2021 20:39:30 +0000 Subject: fix corner cases with `yield` (#4771) fixes #4769 --- test/compress/yields.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'test/compress') diff --git a/test/compress/yields.js b/test/compress/yields.js index dc3dacf5..06f46c9d 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -950,3 +950,43 @@ issue_4641_2: { ] node_version: ">=10" } + +issue_4769_1: { + options = { + side_effects: true, + } + input: { + console.log(function*() { + (function({} = yield => {}) {})(); + }().next().done); + } + expect: { + console.log(function*() { + (function({} = yield => {}) {})(); + }().next().done); + } + expect_stdout: "true" + node_version: ">=6" +} + +issue_4769_2: { + options = { + inline: true, + } + input: { + console.log(function*() { + return function({} = yield => {}) { + return "PASS"; + }(); + }().next().value); + } + expect: { + console.log(function*() { + return function({} = yield => {}) { + return "PASS"; + }(); + }().next().value); + } + expect_stdout: "PASS" + node_version: ">=6" +} -- cgit v1.2.3