[skip ci] Fix typos in README.md (#5857)
This commit is contained in:
@@ -152,19 +152,21 @@ var _marked = [foo].map(regeneratorRuntime.mark);
|
||||
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _marked[0], this);
|
||||
}
|
||||
```
|
||||
|
||||
This isn't ideal as then you have to include the regenerator runtime which
|
||||
This isn't ideal since it relies on the regenerator runtime being included, which
|
||||
pollutes the global scope.
|
||||
|
||||
Instead what the `runtime` transformer does it compile that to:
|
||||
With the `runtime` transformer, however, it is compiled to:
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
@@ -178,11 +180,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
||||
var _marked = [foo].map(_regenerator2.default.mark);
|
||||
|
||||
function foo() {
|
||||
return regeneratorRuntime.wrap(function foo$(_context) {
|
||||
while (1) switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
return _regenerator2.default.wrap(function foo$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _marked[0], this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user