From a2b1b96752c5f898539f8e28431461428c4c7731 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 24 Apr 2021 20:10:12 +0100 Subject: fix corner case with `yield` (#4867) --- test/compress/yields.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/compress/yields.js b/test/compress/yields.js index d21ebcbf..d577d7ef 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -150,6 +150,27 @@ for_await_of: { node_version: ">=10" } +comment_newline: { + beautify = { + comments: "all", + } + input: { + console.log(function*() { + yield ( + /* */ + "PASS" + ); + }().next().value); + } + expect_exact: [ + "console.log(function*(){", + "/* */", + 'yield"PASS"}().next().value);', + ] + expect_stdout: "PASS" + node_version: ">=4" +} + collapse_vars_1: { options = { collapse_vars: true, -- cgit v1.2.3