File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -445,11 +445,11 @@ module JSDoc {
445445 * be resolved.
446446 */
447447 DataFlow:: Node getNodeFromAlias ( string alias ) {
448- isPrefixUsedInFile ( alias , getFile ( ) ) and // Restrict size of predicate
449448 exists ( VarDef def , VarRef ref |
450449 def .getContainer ( ) = this and
451450 ref = def .getTarget ( ) .( BindingPattern ) .getABindingVarRef ( ) and
452- ref .getName ( ) = alias
451+ ref .getName ( ) = alias and
452+ isTypenamePrefix ( ref .getName ( ) ) // restrict size of predicate
453453 |
454454 exists ( PropertyPattern p |
455455 ref = p .getValuePattern ( ) and
@@ -480,13 +480,8 @@ module JSDoc {
480480 }
481481 }
482482
483- /**
484- * Holds if a JSDoc type in `f` referenced the given local name.
485- */
486- private predicate isPrefixUsedInFile ( string name , File f ) {
487- exists ( JSDocNamedTypeExpr t |
488- t .hasNameParts ( name , _) and
489- t .getFile ( ) = f
490- )
483+ pragma [ noinline]
484+ private predicate isTypenamePrefix ( string name ) {
485+ any ( JSDocNamedTypeExpr expr ) .hasNameParts ( name , _)
491486 }
492487}
You can’t perform that action at this time.
0 commit comments