Merge pull request #2522 from Microsoft/visitWorkaround
Use a function declaration vs a function expression to help deal with a reported Atom+IO.js issue.
This commit is contained in:
commit
feabcd044b
1 changed files with 122 additions and 117 deletions
|
@ -769,10 +769,20 @@ module ts {
|
|||
|
||||
public getNamedDeclarations() {
|
||||
if (!this.namedDeclarations) {
|
||||
let sourceFile = this;
|
||||
this.namedDeclarations = this.computeNamedDeclarations();
|
||||
}
|
||||
|
||||
return this.namedDeclarations;
|
||||
}
|
||||
|
||||
private computeNamedDeclarations() {
|
||||
let namedDeclarations: Declaration[] = [];
|
||||
|
||||
forEachChild(sourceFile, function visit(node: Node): void {
|
||||
forEachChild(this, visit);
|
||||
|
||||
return namedDeclarations;
|
||||
|
||||
function visit(node: Node): void {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
|
@ -882,12 +892,7 @@ module ts {
|
|||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
this.namedDeclarations = namedDeclarations;
|
||||
}
|
||||
|
||||
return this.namedDeclarations;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue