mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
While it isn't technically needed because regenerator already handles
async functions, it doesn't play well with the Promise detection logic
used by @babel/preset-env's useBuiltIns and @babel/transform-runtime.
The plugin exclusion logic isn't removed, because
1) it will be useful when merging @babel/preset-modules
into @babel/preset-env
2) if/when regenerator will support injecting a custom promise,
we can enable this optimization again
10 lines
210 B
JavaScript
10 lines
210 B
JavaScript
function foo() {
|
|
return regeneratorRuntime.async(function foo$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
});
|
|
}
|