@@ -415,54 +415,14 @@ class JSDocNamedTypeExpr extends JSDocTypeExpr {
415415 * - `foo.bar.Baz` has prefix `foo` and suffix `.bar.Baz`.
416416 * - `Baz` has prefix `Baz` and an empty suffix.
417417 */
418- predicate hasNameParts ( string prefix , string suffix ) {
418+ deprecated predicate hasNameParts ( string prefix , string suffix ) {
419419 not this = any ( JSDocQualifiedTypeAccess a ) .getBase ( ) and // restrict size of predicate
420420 exists ( string regex , string name | regex = "([^.]+)(.*)" |
421421 name = this .getRawName ( ) and
422422 prefix = name .regexpCapture ( regex , 1 ) and
423423 suffix = name .regexpCapture ( regex , 2 )
424424 )
425425 }
426-
427- pragma [ noinline]
428- pragma [ nomagic]
429- private predicate hasNamePartsAndEnv ( string prefix , string suffix , JSDoc:: Environment env ) {
430- // Force join ordering
431- this .hasNameParts ( prefix , suffix ) and
432- env .isContainerInScope ( this .getContainer ( ) )
433- }
434-
435- /**
436- * Gets the qualified name of this name by resolving its prefix, if any.
437- */
438- cached
439- private string resolvedName ( ) {
440- exists ( string prefix , string suffix , JSDoc:: Environment env |
441- this .hasNamePartsAndEnv ( prefix , suffix , env ) and
442- result = env .resolveAlias ( prefix ) + suffix
443- )
444- }
445-
446- override predicate hasQualifiedName ( string globalName ) {
447- globalName = this .resolvedName ( )
448- or
449- not exists ( this .resolvedName ( ) ) and
450- globalName = this .getRawName ( )
451- }
452-
453- override DataFlow:: ClassNode getClass ( ) {
454- exists ( string name |
455- this .hasQualifiedName ( name ) and
456- result .hasQualifiedName ( name )
457- )
458- or
459- // Handle case where a local variable has a reference to the class,
460- // but the class doesn't have a globally qualified name.
461- exists ( string alias , JSDoc:: Environment env |
462- this .hasNamePartsAndEnv ( alias , "" , env ) and
463- result .getAClassReference ( ) .flowsTo ( env .getNodeFromAlias ( alias ) )
464- )
465- }
466426}
467427
468428/**
@@ -491,12 +451,6 @@ class JSDocAppliedTypeExpr extends @jsdoc_applied_type_expr, JSDocTypeExpr {
491451 * For example, in `Array<string>`, `string` is the only argument type.
492452 */
493453 JSDocTypeExpr getAnArgument ( ) { result = this .getArgument ( _) }
494-
495- override predicate hasQualifiedName ( string globalName ) {
496- this .getHead ( ) .hasQualifiedName ( globalName )
497- }
498-
499- override DataFlow:: ClassNode getClass ( ) { result = this .getHead ( ) .getClass ( ) }
500454}
501455
502456/**
@@ -516,8 +470,6 @@ class JSDocNullableTypeExpr extends @jsdoc_nullable_type_expr, JSDocTypeExpr {
516470 predicate isPrefix ( ) { jsdoc_prefix_qualifier ( this ) }
517471
518472 override JSDocTypeExpr getAnUnderlyingType ( ) { result = this .getTypeExpr ( ) .getAnUnderlyingType ( ) }
519-
520- override DataFlow:: ClassNode getClass ( ) { result = this .getTypeExpr ( ) .getClass ( ) }
521473}
522474
523475/**
@@ -537,8 +489,6 @@ class JSDocNonNullableTypeExpr extends @jsdoc_non_nullable_type_expr, JSDocTypeE
537489 predicate isPrefix ( ) { jsdoc_prefix_qualifier ( this ) }
538490
539491 override JSDocTypeExpr getAnUnderlyingType ( ) { result = this .getTypeExpr ( ) .getAnUnderlyingType ( ) }
540-
541- override DataFlow:: ClassNode getClass ( ) { result = this .getTypeExpr ( ) .getClass ( ) }
542492}
543493
544494/**
@@ -643,8 +593,6 @@ class JSDocOptionalParameterTypeExpr extends @jsdoc_optional_type_expr, JSDocTyp
643593 override JSDocTypeExpr getAnUnderlyingType ( ) {
644594 result = this .getUnderlyingType ( ) .getAnUnderlyingType ( )
645595 }
646-
647- override DataFlow:: ClassNode getClass ( ) { result = this .getUnderlyingType ( ) .getClass ( ) }
648596}
649597
650598/**
@@ -679,7 +627,7 @@ module JSDoc {
679627 /**
680628 * A statement container which may declare JSDoc name aliases.
681629 */
682- class Environment extends StmtContainer {
630+ deprecated class Environment extends StmtContainer {
683631 /**
684632 * Gets the fully qualified name aliased by the given unqualified name
685633 * within this container.
@@ -729,7 +677,7 @@ module JSDoc {
729677 }
730678
731679 pragma [ noinline]
732- private predicate isTypenamePrefix ( string name ) {
680+ deprecated private predicate isTypenamePrefix ( string name ) {
733681 any ( JSDocNamedTypeExpr expr ) .hasNameParts ( name , _)
734682 }
735683}
0 commit comments