@@ -283,7 +283,7 @@ export class AstSymbolTable {
283283
284284 // Is there a parent AstSymbol?
285285 const arbitaryParent : ts . Node | undefined
286- = this . _findFirstParentDeclaration ( followedSymbol . declarations [ 0 ] ) ;
286+ = this . _tryFindFirstAstDeclarationParent ( followedSymbol . declarations [ 0 ] ) ;
287287
288288 let parentAstSymbol : AstSymbol | undefined = undefined ;
289289
@@ -294,13 +294,12 @@ export class AstSymbolTable {
294294 }
295295
296296 // Okay, now while creating the declarations we will wire them up to the
297- // their corresopnding parent declarations
297+ // their corresponding parent declarations
298298 for ( const declaration of followedSymbol . declarations || [ ] ) {
299299
300300 let parentAstDeclaration : AstDeclaration | undefined = undefined ;
301301 if ( parentAstSymbol ) {
302- const parentDeclaration : ts . Node | undefined
303- = this . _findFirstParentDeclaration ( declaration ) ;
302+ const parentDeclaration : ts . Node | undefined = this . _tryFindFirstAstDeclarationParent ( declaration ) ;
304303
305304 if ( ! parentDeclaration ) {
306305 throw new Error ( 'Program bug: Missing parent declaration' ) ;
@@ -326,7 +325,7 @@ export class AstSymbolTable {
326325 /**
327326 * Returns the first parent satisfying isAstDeclaration(), or undefined if none is found.
328327 */
329- private _findFirstParentDeclaration ( node : ts . Node ) : ts . Node | undefined {
328+ private _tryFindFirstAstDeclarationParent ( node : ts . Node ) : ts . Node | undefined {
330329 let currentNode : ts . Node | undefined = node . parent ;
331330 while ( currentNode ) {
332331 if ( this . isAstDeclaration ( currentNode ) ) {
0 commit comments