diff --git a/packages/babel-helper-remap-async-to-generator/src/index.js b/packages/babel-helper-remap-async-to-generator/src/index.js index eceec383bd..ee16627eb5 100644 --- a/packages/babel-helper-remap-async-to-generator/src/index.js +++ b/packages/babel-helper-remap-async-to-generator/src/index.js @@ -24,10 +24,6 @@ let arrowBuildWrapper = template(` `); let awaitVisitor = { - Function(path) { - path.skip(); - }, - ArrowFunctionExpression(path) { if (!path.node.async) { path.arrowFunctionToShadowed(); diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/actual.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/actual.js index e69bddc32a..dbda981a1f 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/actual.js +++ b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/actual.js @@ -2,5 +2,19 @@ class Class { async method() { this; () => this; + () => { + this; + () => this; + function x() { + this; + () => {this} + async () => {this} + } + } + function x() { + this; + () => {this} + async () => {this} + } } } diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/expected.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/expected.js index 809d505d9f..dfb676bf2f 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/expected.js +++ b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-arrows/expected.js @@ -7,6 +7,34 @@ class Class { (function () { return _this; }); + (function () { + _this; + (function () { + return _this; + }); + function x() { + var _this2 = this; + + this; + (function () { + _this2; + }); + babelHelpers.asyncToGenerator(function* () { + _this2; + }); + } + }); + function x() { + var _this3 = this; + + this; + (function () { + _this3; + }); + babelHelpers.asyncToGenerator(function* () { + _this3; + }); + } })(); } }