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 64c2a474391d..056606da3aab 100644 --- a/packages/babel-helper-remap-async-to-generator/src/index.js +++ b/packages/babel-helper-remap-async-to-generator/src/index.js @@ -90,6 +90,10 @@ function classOrObjectMethod(path: NodePath, callId: Object) { [] )) ]; + + // Regardless of whether or not the wrapped function is a an async method + // or generator the outer function should not be + node.generator = false; } function plainFunction(path: NodePath, callId: Object) { diff --git a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/class-method/expected.js b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/class-method/expected.js index a774b790eb38..4d300b50dcdf 100644 --- a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/class-method/expected.js +++ b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/class-method/expected.js @@ -1,5 +1,5 @@ class C { - *g() { + g() { var _this = this; return babelHelpers.asyncGenerator.wrap(function* () { diff --git a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/object-method/expected.js b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/object-method/expected.js index e4fefacc6c50..c374fe93f4b3 100644 --- a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/object-method/expected.js +++ b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/object-method/expected.js @@ -1,5 +1,5 @@ ({ - *g() { + g() { var _this = this; return babelHelpers.asyncGenerator.wrap(function* () { diff --git a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/static-method/expected.js b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/static-method/expected.js index 01bbe9574235..751788620620 100644 --- a/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/static-method/expected.js +++ b/packages/babel-plugin-transform-async-generator-functions/test/fixtures/async-generators/static-method/expected.js @@ -1,5 +1,5 @@ class C { - static *g() { + static g() { var _this = this; return babelHelpers.asyncGenerator.wrap(function* () {