Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[babel 8] Don't pass the second parameter to asyncGeneratorDelegate
- Loading branch information
1 parent
4165bd3
commit 5a5fd7f
Showing
12 changed files
with
60 additions
and
7 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
4 changes: 4 additions & 0 deletions
4
...osal-async-generator-functions/test/fixtures/async-generators/yield-star-babel-7/input.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,4 @@ | ||
async function* g() { | ||
yield* [1, 2, 3]; | ||
yield* iterable; | ||
} |
3 changes: 3 additions & 0 deletions
3
...-async-generator-functions/test/fixtures/async-generators/yield-star-babel-7/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,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
11 changes: 11 additions & 0 deletions
11
...sal-async-generator-functions/test/fixtures/async-generators/yield-star-babel-7/output.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,11 @@ | ||
function g() { | ||
return _g.apply(this, arguments); | ||
} | ||
|
||
function _g() { | ||
_g = babelHelpers.wrapAsyncGenerator(function* () { | ||
yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator([1, 2, 3]), babelHelpers.awaitAsyncGenerator); | ||
yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator(iterable), babelHelpers.awaitAsyncGenerator); | ||
}); | ||
return _g.apply(this, arguments); | ||
} |
3 changes: 3 additions & 0 deletions
3
...proposal-async-generator-functions/test/fixtures/async-generators/yield-star/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,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": 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
7 changes: 7 additions & 0 deletions
7
...erator-functions/test/fixtures/yield-star/create-async-from-sync-iterator-babel-7/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,7 @@ | ||
async function* fn() { | ||
yield* [Promise.resolve("ok")] // CreateAsyncFromSyncIterator | ||
} | ||
|
||
return fn().next().then(result => { | ||
expect(result).toEqual({ value: "ok", done: false }); | ||
}); |
3 changes: 3 additions & 0 deletions
3
...rator-functions/test/fixtures/yield-star/create-async-from-sync-iterator-babel-7/input.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,3 @@ | ||
async function* fn() { | ||
yield* [Promise.resolve("ok")] // CreateAsyncFromSyncIterator | ||
} |
7 changes: 7 additions & 0 deletions
7
...r-functions/test/fixtures/yield-star/create-async-from-sync-iterator-babel-7/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,7 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["proposal-async-generator-functions"], | ||
"parserOpts": { | ||
"allowReturnOutsideFunction": true | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ator-functions/test/fixtures/yield-star/create-async-from-sync-iterator-babel-7/output.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 @@ | ||
function fn() { | ||
return _fn.apply(this, arguments); | ||
} | ||
|
||
function _fn() { | ||
_fn = babelHelpers.wrapAsyncGenerator(function* () { | ||
yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator([Promise.resolve("ok")]), babelHelpers.awaitAsyncGenerator); // CreateAsyncFromSyncIterator | ||
}); | ||
return _fn.apply(this, arguments); | ||
} |
1 change: 1 addition & 0 deletions
1
...generator-functions/test/fixtures/yield-star/create-async-from-sync-iterator/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
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