Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test arrow function inside generator. (#5605)
- Loading branch information
1 parent
d1c954b
commit 3146b24
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/actual.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,5 @@ | ||
function* gen () { | ||
const a = () => { | ||
return 1; | ||
}; | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/expected.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,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); | ||
} |
5 changes: 5 additions & 0 deletions
5
...ages/babel-plugin-transform-regenerator/test/fixtures/arrow-inside-generator/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,5 @@ | ||
{ | ||
"plugins": [ | ||
"transform-regenerator" | ||
] | ||
} |