From 3b28bd2cb1c2de8809d9142bd828b6203d7a6140 Mon Sep 17 00:00:00 2001 From: Danny Andrews Date: Wed, 14 Jun 2017 09:49:41 -0500 Subject: [PATCH] [skip ci] Fix typos in README.md (#5857) --- .../babel-plugin-transform-runtime/README.md | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/babel-plugin-transform-runtime/README.md b/packages/babel-plugin-transform-runtime/README.md index 2ab8ae8920..d7baa1211d 100644 --- a/packages/babel-plugin-transform-runtime/README.md +++ b/packages/babel-plugin-transform-runtime/README.md @@ -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); }