@@ -56,7 +56,7 @@ export class GlobalIndex {
5656 /**
5757 * Tokens categorized by type to reduce number of checks for global conflicts
5858 */
59- globalTokensByTypeByName : GlobalTokensByTypeByName = { } ;
59+ globalTokensByTypeByName ! : GlobalTokensByTypeByName ;
6060
6161 /**
6262 * Constructor which initializes properties in our constants so that they
@@ -111,7 +111,7 @@ export class GlobalIndex {
111111 const byNameForType = this . globalTokensByTypeByName [ types [ i ] ] ;
112112 const names = Object . keys ( byNameForType ) ;
113113 for ( let j = 0 ; j < names . length ; j ++ ) {
114- exported [ types [ i ] ] . push ( byNameForType [ names [ j ] ] [ 0 ] ) ;
114+ exported [ types [ i ] ] . push ( byNameForType [ names [ j ] ] [ 0 ] as any ) ;
115115 }
116116 }
117117 return exported ;
@@ -332,7 +332,9 @@ export class GlobalIndex {
332332 break ;
333333 case byName . length === 1 :
334334 // remove display name
335- delete IDL_DISPLAY_NAMES [ tokens [ i ] . type ] [ tokens [ i ] . name ] ;
335+ delete ( IDL_DISPLAY_NAMES [ tokens [ i ] . type ] || { } ) [
336+ tokens [ i ] . name
337+ ] ;
336338
337339 // remove structure/type names
338340 if ( tokens [ i ] . type === GLOBAL_TOKEN_TYPES . STRUCTURE ) {
@@ -355,7 +357,7 @@ export class GlobalIndex {
355357
356358 // mark as changed if we had problems
357359 if ( file in this . globalSyntaxProblemsByFile ) {
358- this . changedFiles [ file ] = undefined ;
360+ this . changedFiles [ file ] = false ;
359361 }
360362
361363 // reset problems for our file as well
@@ -456,9 +458,11 @@ export class GlobalIndex {
456458
457459 // save by type
458460 if ( token . name in this . globalTokensByTypeByName [ token . type ] ) {
459- this . globalTokensByTypeByName [ token . type ] [ token . name ] . push ( token ) ;
461+ this . globalTokensByTypeByName [ token . type ] [ token . name ] . push (
462+ token as any ,
463+ ) ;
460464 } else {
461- this . globalTokensByTypeByName [ token . type ] [ token . name ] = [ token ] ;
465+ this . globalTokensByTypeByName [ token . type ] [ token . name ] = [ token as any ] ;
462466 }
463467 }
464468 }
@@ -558,8 +562,8 @@ export class GlobalIndex {
558562
559563 // check all files that we need to process
560564 const files = this . globalTokensByTypeByName [ token . type ] [ token . name ]
561- . filter ( ( item ) => item . file !== undefined )
562- . map ( ( item ) => item . file ) ;
565+ . map ( ( item ) => item . file )
566+ . filter ( ( item ) => item !== undefined ) ;
563567
564568 // process each file
565569 for ( let z = 0 ; z < files . length ; z ++ ) {
@@ -577,6 +581,11 @@ export class GlobalIndex {
577581 // extract the problem
578582 const problem = problems [ j ] ;
579583
584+ // skip if no file
585+ if ( ! problem . file ) {
586+ continue ;
587+ }
588+
580589 // check if our file matches
581590 if (
582591 ( problem . file === token . file || clear ) &&
0 commit comments