Test arrow function inside generator. (#5605)
This commit is contained in:
committed by
Logan Smyth
parent
d1c954b36f
commit
3146b245ed
5
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/actual.js
vendored
Normal file
5
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
function* gen () {
|
||||
const a = () => {
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
17
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/expected.js
vendored
Normal file
17
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/expected.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var _marked = [gen].map(regeneratorRuntime.mark);
|
||||
|
||||
function gen() {
|
||||
var a;
|
||||
return regeneratorRuntime.wrap(function gen$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
a = () => {
|
||||
return 1;
|
||||
};
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}, _marked[0], this);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-regenerator"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user