Fixed incorrect compilation of async iterator methods (#4719)

This commit is contained in:
Jamesernator 2016-10-15 07:38:57 +13:00 committed by Henry Zhu
parent 9fc51d6292
commit dc4140dc5f
4 changed files with 7 additions and 3 deletions

View File

@ -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) {

View File

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

View File

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

View File

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