aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-03-13 20:39:30 +0000
committerGitHub <noreply@github.com>2021-03-14 04:39:30 +0800
commit73e6b2550bf0cc08e4bc95ac1e1d3b8b650c5bf8 (patch)
tree173825195336d5cb90cbf598716a9c9f62a01f7c /test/compress
parent241113200e8ad3550efc051b2b7f4d7c9a4573e9 (diff)
downloadtracifyjs-73e6b2550bf0cc08e4bc95ac1e1d3b8b650c5bf8.tar.gz
tracifyjs-73e6b2550bf0cc08e4bc95ac1e1d3b8b650c5bf8.zip
fix corner cases with `yield` (#4771)
fixes #4769
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/yields.js40
1 files changed, 40 insertions, 0 deletions
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"
+}