-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation of parameters in async generators
- Loading branch information
1 parent
ce09a26
commit 4a751b8
Showing
4 changed files
with
53 additions
and
19 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
10 changes: 10 additions & 0 deletions
10
packages/babel-plugin-transform-parameters/test/fixtures/regression/15145/exec.js
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,10 @@ | ||
async function * foo (p = 1) { | ||
yield "hello"; | ||
yield p; | ||
} | ||
|
||
return (async () => { | ||
const res = []; | ||
for await (const x of foo()) res.push(x); | ||
expect(res).toEqual(["hello", 1]); | ||
})(); |
6 changes: 6 additions & 0 deletions
6
packages/babel-plugin-transform-parameters/test/fixtures/regression/15145/options.json
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,6 @@ | ||
{ | ||
"plugins": ["transform-parameters"], | ||
"parserOpts": { | ||
"allowReturnOutsideFunction": true | ||
} | ||
} |
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