@@ -313,11 +313,6 @@ module API {
313
313
module Node {
314
314
/** Gets a node whose type has the given qualified name. */
315
315
Node ofType ( string moduleName , string exportedName ) {
316
- exists ( TypeName tn |
317
- tn .hasQualifiedName ( moduleName , exportedName ) and
318
- result = Impl:: MkCanonicalNameUse ( tn ) .( Node ) .getInstance ( )
319
- )
320
- or
321
316
result = Impl:: MkHasUnderlyingType ( moduleName , exportedName ) .( Node ) .getInstance ( )
322
317
}
323
318
}
@@ -395,28 +390,6 @@ module API {
395
390
} or
396
391
MkDef ( DataFlow:: Node nd ) { rhs ( _, _, nd ) } or
397
392
MkUse ( DataFlow:: Node nd ) { use ( _, _, nd ) } or
398
- /**
399
- * A TypeScript canonical name that is defined somewhere, and that isn't a module root.
400
- * (Module roots are represented by `MkModuleExport` nodes instead.)
401
- *
402
- * For most purposes, you probably want to use the `mkCanonicalNameDef` predicate instead of
403
- * this constructor.
404
- */
405
- MkCanonicalNameDef ( CanonicalName n ) {
406
- not n .isRoot ( ) and
407
- isDefined ( n )
408
- } or
409
- /**
410
- * A TypeScript canonical name that is used somewhere, and that isn't a module root.
411
- * (Module roots are represented by `MkModuleImport` nodes instead.)
412
- *
413
- * For most purposes, you probably want to use the `mkCanonicalNameUse` predicate instead of
414
- * this constructor.
415
- */
416
- MkCanonicalNameUse ( CanonicalName n ) {
417
- not n .isRoot ( ) and
418
- isUsed ( n )
419
- } or
420
393
/**
421
394
* A TypeScript type, identified by name of the type-annotation.
422
395
* This API node is exclusively used by `API::Node::ofType`.
@@ -433,11 +406,9 @@ module API {
433
406
class TDef = MkModuleDef or TNonModuleDef ;
434
407
435
408
class TNonModuleDef =
436
- MkModuleExport or MkClassInstance or MkAsyncFuncResult or MkDef or MkCanonicalNameDef or
437
- MkSyntheticCallbackArg ;
409
+ MkModuleExport or MkClassInstance or MkAsyncFuncResult or MkDef or MkSyntheticCallbackArg ;
438
410
439
- class TUse =
440
- MkModuleUse or MkModuleImport or MkUse or MkCanonicalNameUse or MkHasUnderlyingType ;
411
+ class TUse = MkModuleUse or MkModuleImport or MkUse or MkHasUnderlyingType ;
441
412
442
413
private predicate hasSemantics ( DataFlow:: Node nd ) { not nd .getTopLevel ( ) .isExterns ( ) }
443
414
@@ -474,20 +445,6 @@ module API {
474
445
)
475
446
}
476
447
477
- /** An API-graph node representing definitions of the canonical name `cn`. */
478
- private TApiNode mkCanonicalNameDef ( CanonicalName cn ) {
479
- if cn .isModuleRoot ( )
480
- then result = MkModuleExport ( cn .getExternalModuleName ( ) )
481
- else result = MkCanonicalNameDef ( cn )
482
- }
483
-
484
- /** An API-graph node representing uses of the canonical name `cn`. */
485
- private TApiNode mkCanonicalNameUse ( CanonicalName cn ) {
486
- if cn .isModuleRoot ( )
487
- then result = MkModuleImport ( cn .getExternalModuleName ( ) )
488
- else result = MkCanonicalNameUse ( cn )
489
- }
490
-
491
448
/**
492
449
* Holds if `rhs` is the right-hand side of a definition of a node that should have an
493
450
* incoming edge from `base` labeled `lbl` in the API graph.
@@ -591,11 +548,6 @@ module API {
591
548
exists ( string m | nd = MkModuleExport ( m ) | exports ( m , rhs ) )
592
549
or
593
550
nd = MkDef ( rhs )
594
- or
595
- exists ( CanonicalName n | nd = MkCanonicalNameDef ( n ) |
596
- rhs = n .( Namespace ) .getADefinition ( ) .flow ( ) or
597
- rhs = n .( CanonicalFunctionName ) .getADefinition ( ) .flow ( )
598
- )
599
551
}
600
552
601
553
/**
@@ -647,12 +599,6 @@ module API {
647
599
ref = cls .getConstructor ( ) .getParameter ( i )
648
600
)
649
601
or
650
- exists ( TypeName tn |
651
- base = MkCanonicalNameUse ( tn ) and
652
- lbl = Label:: instance ( ) and
653
- ref = getANodeWithType ( tn )
654
- )
655
- or
656
602
exists ( string moduleName , string exportName |
657
603
base = MkHasUnderlyingType ( moduleName , exportName ) and
658
604
lbl = Label:: instance ( ) and
@@ -696,8 +642,6 @@ module API {
696
642
)
697
643
or
698
644
nd = MkUse ( ref )
699
- or
700
- exists ( CanonicalName n | nd = MkCanonicalNameUse ( n ) | ref .asExpr ( ) = n .getAnAccess ( ) )
701
645
}
702
646
703
647
/** Holds if module `m` exports `rhs`. */
@@ -852,13 +796,6 @@ module API {
852
796
result = awaited ( call , DataFlow:: TypeTracker:: end ( ) )
853
797
}
854
798
855
- private DataFlow:: SourceNode getANodeWithType ( TypeName tn ) {
856
- exists ( string moduleName , string typeName |
857
- tn .hasQualifiedName ( moduleName , typeName ) and
858
- result .hasUnderlyingType ( moduleName , typeName )
859
- )
860
- }
861
-
862
799
/**
863
800
* Holds if there is an edge from `pred` to `succ` in the API graph that is labeled with `lbl`.
864
801
*/
@@ -899,13 +836,6 @@ module API {
899
836
succ = MkClassInstance ( trackDefNode ( def ) )
900
837
)
901
838
or
902
- exists ( CanonicalName cn1 , string n , CanonicalName cn2 |
903
- pred in [ mkCanonicalNameDef ( cn1 ) , mkCanonicalNameUse ( cn1 ) ] and
904
- cn2 = cn1 .getChild ( n ) and
905
- lbl = Label:: member ( n ) and
906
- succ in [ mkCanonicalNameDef ( cn2 ) , mkCanonicalNameUse ( cn2 ) ]
907
- )
908
- or
909
839
exists ( string moduleName , string exportName |
910
840
pred = MkModuleImport ( moduleName ) and
911
841
lbl = Label:: member ( exportName ) and
0 commit comments