mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Utilities for decorators
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/// <reference path="types.ts" />
|
||||
/// <reference path="core.ts" />
|
||||
|
||||
module ts {
|
||||
export interface ReferencePathMatchResult {
|
||||
@@ -575,6 +575,17 @@ module ts {
|
||||
return (<CallExpression>node).expression;
|
||||
}
|
||||
|
||||
function getConstructorWithBody(member: ClassElement): ConstructorDeclaration {
|
||||
if (member.kind === SyntaxKind.Constructor && nodeIsPresent((<ConstructorDeclaration>member).body)) {
|
||||
return <ConstructorDeclaration>member;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration {
|
||||
return forEach(node.members, getConstructorWithBody);
|
||||
}
|
||||
|
||||
export function isExpression(node: Node): boolean {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ThisKeyword:
|
||||
|
||||
Reference in New Issue
Block a user