Moved isSuperPropertyOrElementAccess to utilities

This commit is contained in:
Ron Buckton
2016-01-26 11:36:20 -08:00
parent 3e0c84e43b
commit b00cae87b3
3 changed files with 11 additions and 17 deletions

View File

@@ -850,6 +850,16 @@ namespace ts {
}
}
/**
* Determines whether a node is a property or element access expression for super.
*/
export function isSuperPropertyOrElementAccess(node: Node) {
return (node.kind === SyntaxKind.PropertyAccessExpression
|| node.kind === SyntaxKind.ElementAccessExpression)
&& (<PropertyAccessExpression | ElementAccessExpression>node).expression.kind === SyntaxKind.SuperKeyword;
}
export function getEntityNameFromTypeNode(node: TypeNode): EntityName | Expression {
if (node) {
switch (node.kind) {