retain method return types on transform-es2015-classes (closes #4665) (#4668)

This commit is contained in:
Dan Harper
2016-10-04 23:22:29 +01:00
committed by Henry Zhu
parent fc54264f70
commit 7f772e94ce
20 changed files with 144 additions and 0 deletions

View File

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