-
-
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.
Remove babel polyfill from fixture test runner (#12130)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
- Loading branch information
1 parent
14534e6
commit 814212f
Showing
27 changed files
with
561 additions
and
158 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
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
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
20 changes: 20 additions & 0 deletions
20
...al-async-generator-functions/test/fixtures/yield-star-polyfill-corejs3/issue-9905/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,20 @@ | ||
const log = []; | ||
|
||
async function* func1() { | ||
log.push(1); | ||
yield "a"; | ||
log.push(2); | ||
} | ||
|
||
async function* func2() { | ||
yield* func1(); | ||
log.push(3); | ||
} | ||
|
||
return (async () => { | ||
const iterator = func2(); | ||
await iterator.next(); | ||
await iterator.return(); | ||
|
||
expect(log).toEqual([1]); | ||
})(); |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...proposal-async-generator-functions/test/fixtures/yield-star-polyfill-corejs3/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,12 @@ | ||
{ | ||
"parserOpts": { | ||
"allowReturnOutsideFunction": true | ||
}, | ||
"plugins": [ | ||
"transform-async-to-generator", | ||
"proposal-async-generator-functions", | ||
["babel-plugin-polyfill-corejs3", { "method": "usage-pure", "targets": { | ||
"node": "6.17" | ||
}}] | ||
] | ||
} |
34 changes: 34 additions & 0 deletions
34
...fixtures/yield-star-polyfill-corejs3/return-method-with-finally-multiple-parallel/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,34 @@ | ||
const log = []; | ||
|
||
async function* inner() { | ||
try { | ||
log.push(1); | ||
yield "a"; | ||
log.push(2); | ||
yield "b"; | ||
log.push(3); | ||
} finally { | ||
log.push(4); | ||
yield "c"; | ||
log.push(5); | ||
} | ||
} | ||
|
||
async function* outer() { | ||
log.push(6); | ||
yield* inner(); | ||
log.push(7); | ||
} | ||
|
||
return (async () => { | ||
const iterator = outer(); | ||
|
||
let res = await iterator.next(); | ||
expect(res).toEqual({ value: "a", done: false }); | ||
expect(log).toEqual([6, 1]); | ||
|
||
const [res1, res2] = await Promise.all([ iterator.return("x"), iterator.return("y") ]); | ||
expect(res1).toEqual({ value: "c", done: false }); | ||
expect(res2).toEqual({ value: "y", done: true }); | ||
expect(log).toEqual([6, 1, 4]); | ||
})(); |
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...t/fixtures/yield-star-polyfill-corejs3/return-method-with-finally-multiple-serial/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,37 @@ | ||
const log = []; | ||
|
||
async function* inner() { | ||
try { | ||
log.push(1); | ||
yield "a"; | ||
log.push(2); | ||
yield "b"; | ||
log.push(3); | ||
} finally { | ||
log.push(4); | ||
yield "c"; | ||
log.push(5); | ||
} | ||
} | ||
|
||
async function* outer() { | ||
log.push(6); | ||
yield* inner(); | ||
log.push(7); | ||
} | ||
|
||
return (async () => { | ||
const iterator = outer(); | ||
|
||
let res = await iterator.next(); | ||
expect(res).toEqual({ value: "a", done: false }); | ||
expect(log).toEqual([6, 1]); | ||
|
||
res = await iterator.return("x"); | ||
expect(res).toEqual({ value: "c", done: false }); | ||
expect(log).toEqual([6, 1, 4]); | ||
|
||
res = await iterator.return("y"); | ||
expect(res).toEqual({ value: "y", done: true }); | ||
expect(log).toEqual([6, 1, 4]); | ||
})(); |
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...or-functions/test/fixtures/yield-star-polyfill-corejs3/return-method-with-finally/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,37 @@ | ||
const log = []; | ||
|
||
async function* inner() { | ||
try { | ||
log.push(1); | ||
yield "a"; | ||
log.push(2); | ||
yield "b"; | ||
log.push(3); | ||
} finally { | ||
log.push(4); | ||
yield "c"; | ||
log.push(5); | ||
} | ||
} | ||
|
||
async function* outer() { | ||
log.push(6); | ||
yield* inner(); | ||
log.push(7); | ||
} | ||
|
||
return (async () => { | ||
const iterator = outer(); | ||
|
||
let res = await iterator.next(); | ||
expect(res).toEqual({ value: "a", done: false }); | ||
expect(log).toEqual([6, 1]); | ||
|
||
res = await iterator.return(); | ||
expect(res).toEqual({ value: "c", done: false }); | ||
expect(log).toEqual([6, 1, 4]); | ||
|
||
res = await iterator.next(); | ||
expect(res).toEqual({ value: undefined, done: true }); | ||
expect(log).toEqual([6, 1, 4, 5, 7]); | ||
})(); |
31 changes: 31 additions & 0 deletions
31
...async-generator-functions/test/fixtures/yield-star-polyfill-corejs3/return-method/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,31 @@ | ||
const log = []; | ||
|
||
async function* inner() { | ||
log.push(1); | ||
yield "a"; | ||
log.push(2); | ||
yield "b"; | ||
log.push(3); | ||
} | ||
|
||
async function* outer() { | ||
log.push(4); | ||
yield* inner(); | ||
log.push(5); | ||
} | ||
|
||
return (async () => { | ||
const iterator = outer(); | ||
|
||
let res = await iterator.next(); | ||
expect(res).toEqual({ value: "a", done: false }); | ||
expect(log).toEqual([4, 1]); | ||
|
||
res = await iterator.return(); | ||
expect(res).toEqual({ value: undefined, done: true }); | ||
expect(log).toEqual([4, 1]); | ||
|
||
res = await iterator.next(); | ||
expect(res).toEqual({ value: undefined, done: true }); | ||
expect(log).toEqual([4, 1]); | ||
})(); |
File renamed without changes.
Oops, something went wrong.