mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
fix(es/minifier): Don't generate generator arrows (#7466)
**Related issue:** - Closes #7457.
This commit is contained in:
parent
ad8e6a006c
commit
e506635f74
@ -21,7 +21,7 @@ impl Pure<'_> {
|
||||
function,
|
||||
}) = e
|
||||
{
|
||||
if contains_this_expr(&function.body) {
|
||||
if contains_this_expr(&function.body) || function.is_generator {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"ecma": "2022",
|
||||
"unsafe_arrows": true
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
function bar() {
|
||||
return function* () {
|
||||
yield foo();
|
||||
};
|
||||
}
|
||||
console.log(bar());
|
@ -0,0 +1,6 @@
|
||||
function bar() {
|
||||
return function*() {
|
||||
yield foo();
|
||||
};
|
||||
}
|
||||
console.log(bar());
|
Loading…
Reference in New Issue
Block a user