Skip to content

Commit

Permalink
Fixed incorrect compilation of async iterator methods (babel#4719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamesernator authored and panagosg7 committed Jan 17, 2017
1 parent 7eb72bc commit a17310a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/babel-helper-remap-async-to-generator/src/index.js
Expand Up @@ -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) {
Expand Down
@@ -1,5 +1,5 @@
class C {
*g() {
g() {
var _this = this;

return babelHelpers.asyncGenerator.wrap(function* () {
Expand Down
@@ -1,5 +1,5 @@
({
*g() {
g() {
var _this = this;

return babelHelpers.asyncGenerator.wrap(function* () {
Expand Down
@@ -1,5 +1,5 @@
class C {
static *g() {
static g() {
var _this = this;

return babelHelpers.asyncGenerator.wrap(function* () {
Expand Down

0 comments on commit a17310a

Please sign in to comment.