-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Bump
regenerator
and add tests (#15841)
* fix: Bump `regenerator` and add tests * Regenerate output.js * Regenerate output.js
- Loading branch information
1 parent
a8f041b
commit f7b472c
Showing
21 changed files
with
82 additions
and
31 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...babel-plugin-transform-async-generator-functions/test/fixtures/regression/13801/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
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
...abel-plugin-transform-regenerator/test/fixtures/misc/delegated-yield-non-iterable/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 @@ | ||
function* f(x) { | ||
yield* x; | ||
}; | ||
|
||
expect(() => f(undefined).next()).toThrow(TypeError); | ||
expect(() => f(null).next()).toThrow(TypeError); | ||
expect(() => f(false).next()).toThrow(TypeError); | ||
expect(() => f(true).next()).toThrow(TypeError); | ||
expect(() => f(0).next()).toThrow(TypeError); | ||
expect(() => f(1).next()).toThrow(TypeError); | ||
expect(() => f({}).next()).toThrow(TypeError); | ||
|
||
// #15172 | ||
expect(() => { | ||
var [x] = { | ||
[Symbol.iterator]: function* () { | ||
yield* 0; | ||
}, | ||
}; | ||
}).toThrow(TypeError); |
6 changes: 6 additions & 0 deletions
6
...bel-plugin-transform-regenerator/test/fixtures/misc/delegated-yield-non-iterable/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,6 @@ | ||
// #15172 | ||
var [x] = { | ||
[Symbol.iterator]: function* () { | ||
yield* 0; | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
...plugin-transform-regenerator/test/fixtures/misc/delegated-yield-non-iterable/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-destructuring", | ||
"transform-regenerator" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
...el-plugin-transform-regenerator/test/fixtures/misc/delegated-yield-non-iterable/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,16 @@ | ||
// #15172 | ||
var _Symbol$iterator = { | ||
[Symbol.iterator]: /*#__PURE__*/babelHelpers.regeneratorRuntime().mark(function _callee() { | ||
return babelHelpers.regeneratorRuntime().wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.delegateYield(0, "t0", 1); | ||
case 1: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
}) | ||
}, | ||
_Symbol$iterator2 = babelHelpers.slicedToArray(_Symbol$iterator, 1), | ||
x = _Symbol$iterator2[0]; |
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-transform-regenerator/test/fixtures/misc/no-external-helpers/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...es/babel-preset-env/test/fixtures/corejs2-babel-7/usage-regenerator-used-async/output.mjs
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...abel-preset-env/test/fixtures/corejs2-babel-7/usage-regenerator-used-generator/output.mjs
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/babel-preset-env/test/fixtures/corejs2-babel-7/usage-shippedProposals/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/babel-preset-env/test/fixtures/corejs2/usage-shippedProposals/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...es/babel-preset-env/test/fixtures/corejs3-babel-7/usage-regenerator-used-async/output.mjs
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...abel-preset-env/test/fixtures/corejs3-babel-7/usage-regenerator-used-generator/output.mjs
Large diffs are not rendered by default.
Oops, something went wrong.
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