mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-31 08:07:10 -05:00
JS class members as methods
This commit is contained in:
@@ -1063,7 +1063,7 @@ namespace ts {
|
||||
// Get 'y', the property name, and add it to the type of the class
|
||||
let propertyName = (<PropertyAccessExpression>node.left).name;
|
||||
let prototypeSymbol = declareSymbol(funcSymbol.members, funcSymbol, <PropertyAccessExpression>(<PropertyAccessExpression>node.left).expression, SymbolFlags.HasMembers, SymbolFlags.None);
|
||||
declareSymbol(prototypeSymbol.members, prototypeSymbol, <PropertyAccessExpression>node.left, SymbolFlags.Method | SymbolFlags.Property, SymbolFlags.None);
|
||||
declareSymbol(prototypeSymbol.members, prototypeSymbol, <PropertyAccessExpression>node.left, SymbolFlags.Method, SymbolFlags.None);
|
||||
}
|
||||
|
||||
function bindCallExpression(node: CallExpression) {
|
||||
|
||||
@@ -3843,6 +3843,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
result.push(getSignatureFromDeclaration(<SignatureDeclaration>node));
|
||||
break;
|
||||
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
// Class inference from ClassName.prototype.methodName = expr
|
||||
return getSignaturesOfType(checkExpressionCached((<BinaryExpression>node.parent).right), SignatureKind.Call);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user