Remove isParameterDeclaration to utilities
This commit is contained in:
parent
15f4b58d6c
commit
170403fc53
|
@ -9149,13 +9149,6 @@ module ts {
|
|||
}
|
||||
}
|
||||
|
||||
function isParameterDeclaration(node: VariableLikeDeclaration) {
|
||||
while (node.kind === SyntaxKind.BindingElement) {
|
||||
node = <VariableLikeDeclaration>node.parent.parent;
|
||||
}
|
||||
return node.kind === SyntaxKind.Parameter;
|
||||
}
|
||||
|
||||
// Check that a parameter initializer contains no references to parameters declared to the right of itself
|
||||
function checkParameterInitializer(node: VariableLikeDeclaration): void {
|
||||
if (getRootDeclaration(node).kind !== SyntaxKind.Parameter) {
|
||||
|
|
|
@ -1149,6 +1149,13 @@ module ts {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isParameterDeclaration(node: VariableLikeDeclaration) {
|
||||
while (node.kind === SyntaxKind.BindingElement) {
|
||||
node = <VariableLikeDeclaration>node.parent.parent;
|
||||
}
|
||||
return node.kind === SyntaxKind.Parameter;
|
||||
}
|
||||
|
||||
export function nodeStartsNewLexicalEnvironment(n: Node): boolean {
|
||||
return isFunctionLike(n) || n.kind === SyntaxKind.ModuleDeclaration || n.kind === SyntaxKind.SourceFile;
|
||||
|
|
Loading…
Reference in a new issue