Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in README.md #5857

Merged
merged 2 commits into from Jun 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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