From d8346ef106a1dfcd6e906c3fddfd2f66ef7af541 Mon Sep 17 00:00:00 2001 From: Asger F Date: Thu, 4 Sep 2025 11:21:00 +0200 Subject: [PATCH] JS: Remove unused getFallbackTypeAnnotation() This private predicate was unused, but due to its recursive self-reference it was not reported as an unused predicate. --- .../semmle/javascript/dataflow/DataFlow.qll | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll index df3d0d5ff8ba..edc591ceff46 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll @@ -192,26 +192,6 @@ module DataFlow { FlowSteps::identityFunctionStep(result, this) } - /** - * Gets the type annotation describing the type of this node, - * provided that a static type could not be found. - * - * Doesn't take field types and function return types into account. - */ - private TypeAnnotation getFallbackTypeAnnotation() { - exists(BindingPattern pattern | - this = valueNode(pattern) and - result = pattern.getTypeAnnotation() - ) - or - result = this.getAPredecessor().getFallbackTypeAnnotation() - or - exists(DataFlow::ClassNode cls, string fieldName | - this = cls.getAReceiverNode().getAPropertyRead(fieldName) and - result = cls.getFieldTypeAnnotation(fieldName) - ) - } - private NameResolution::Node getNameResolutionNode() { this = valueNode(result) or