-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/compat): Preserve spread in the
generator
pass (#8401)
**Related issue:** - Closes #8397
- Loading branch information
1 parent
0bde652
commit 29bec98
Showing
4 changed files
with
78 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": false | ||
}, | ||
"loose": false, | ||
"minify": { | ||
"compress": false, | ||
"mangle": false | ||
} | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"minify": false, | ||
"isModule": true, | ||
"env": { | ||
"targets": "Chrome >= 46" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function f() { | ||
const a = [1, 2, 3]; | ||
const b = [...a, 4, 5]; | ||
} | ||
|
||
async function af() { | ||
const a = [1, 2, 3]; | ||
const b = [...a, 4, 5]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator"; | ||
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator"; | ||
function f() { | ||
var a = [ | ||
1, | ||
2, | ||
3 | ||
]; | ||
var b = [ | ||
...a, | ||
4, | ||
5 | ||
]; | ||
} | ||
function af() { | ||
return _af.apply(this, arguments); | ||
} | ||
function _af() { | ||
_af = _async_to_generator(function() { | ||
var a, b; | ||
return _ts_generator(this, function(_state) { | ||
a = [ | ||
1, | ||
2, | ||
3 | ||
]; | ||
b = [ | ||
...a, | ||
4, | ||
5 | ||
]; | ||
return [ | ||
2 | ||
]; | ||
}); | ||
}); | ||
return _af.apply(this, arguments); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters