Skip to content

Commit

Permalink
[skip ci] Fix typos in README.md (#5857)
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-andrews authored and existentialism committed Jun 14, 2017
1 parent fea3a72 commit 3b28bd2
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions packages/babel-plugin-transform-runtime/README.md
Expand Up @@ -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";
Expand All @@ -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);
}
Expand Down

0 comments on commit 3b28bd2

Please sign in to comment.