diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c628f254aba..0cd17debfce 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7115,12 +7115,6 @@ namespace ts { return false; } - function isSuperPropertyOrElementAccess(node: Node) { - return (node.kind === SyntaxKind.PropertyAccessExpression - || node.kind === SyntaxKind.ElementAccessExpression) - && (node).expression.kind === SyntaxKind.SuperKeyword; - } - function checkSuperExpression(node: Node): Type { const isCallExpression = node.parent.kind === SyntaxKind.CallExpression && (node.parent).expression === node; diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 762b491155b..696ad4a591e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2294,16 +2294,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge write(")"); } - function isSuperPropertyAccess(node: Expression): node is PropertyAccessExpression { - return node.kind === SyntaxKind.PropertyAccessExpression - && (node).expression.kind === SyntaxKind.SuperKeyword; - } - - function isSuperElementAccess(node: Expression): node is ElementAccessExpression { - return node.kind === SyntaxKind.ElementAccessExpression - && (node).expression.kind === SyntaxKind.SuperKeyword; - } - function isInAsyncMethodWithSuperInES6(node: Node) { if (languageVersion === ScriptTarget.ES6) { const container = getSuperContainer(node, /*includeFunctions*/ false); @@ -2337,7 +2327,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge superCall = true; } else { - superCall = isSuperPropertyAccess(expression) || isSuperElementAccess(expression); + superCall = isSuperPropertyOrElementAccess(expression); isAsyncMethodWithSuper = superCall && isInAsyncMethodWithSuperInES6(node); emit(expression); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4636c8d144c..102364a334b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -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) + && (node).expression.kind === SyntaxKind.SuperKeyword; + } + + export function getEntityNameFromTypeNode(node: TypeNode): EntityName | Expression { if (node) { switch (node.kind) {