Ensure that the async/generator flags carry over when converting class methods - fixes T6755

This commit is contained in:
Logan Smyth
2015-12-05 12:24:00 -08:00
parent 412c65deb3
commit 03f189fc46
4 changed files with 46 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ export default class LooseClassTransformer extends VanillaTransformer {
if (!node.static) classRef = t.memberExpression(classRef, t.identifier("prototype"));
let methodName = t.memberExpression(classRef, node.key, node.computed || t.isLiteral(node.key));
let func = t.functionExpression(null, node.params, node.body);
let func = t.functionExpression(null, node.params, node.body, node.generator, node.async);
let key = t.toComputedKey(node, node.key);
if (t.isStringLiteral(key)) {
func = nameFunction({