From 889209719b6ec844b28f62f6e03a1f3476002d26 Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 10 Oct 2025 15:10:17 +0000 Subject: [PATCH] JS: Overlay annotations for some failing tests Locally these seem to get rid of the compilation warnings, but of course CI is the true arbiter here. --- javascript/ql/lib/utils/test/InlineSummaries.qll | 1 + javascript/ql/test/library-tests/AMD/tests.ql | 1 + .../CustomAbstractValueDefinitions.ql | 1 + .../CustomAbstractValueDefinitionsFlow.ql | 1 + .../ql/test/library-tests/FlowCustomisation/customValues.ql | 2 ++ .../ql/test/library-tests/ModuleImportNodes/CustomImport.ql | 1 + .../test/library-tests/RecursionPrevention/SourceNodeFlowsTo.ql | 1 + javascript/ql/test/library-tests/frameworks/data/test.ql | 1 + javascript/ql/test/library-tests/frameworks/data/warnings.ql | 1 + 9 files changed, 10 insertions(+) diff --git a/javascript/ql/lib/utils/test/InlineSummaries.qll b/javascript/ql/lib/utils/test/InlineSummaries.qll index 559f1360977..0366736eaf6 100644 --- a/javascript/ql/lib/utils/test/InlineSummaries.qll +++ b/javascript/ql/lib/utils/test/InlineSummaries.qll @@ -1,6 +1,7 @@ import javascript import semmle.javascript.dataflow.FlowSummary +overlay[local] class MkSummary extends SummarizedCallable { private CallExpr mkSummary; diff --git a/javascript/ql/test/library-tests/AMD/tests.ql b/javascript/ql/test/library-tests/AMD/tests.ql index e71ae089f2d..150c5e9a294 100644 --- a/javascript/ql/test/library-tests/AMD/tests.ql +++ b/javascript/ql/test/library-tests/AMD/tests.ql @@ -1,5 +1,6 @@ import javascript +overlay[local] class TestAmdModuleRange extends AmdModuleDefinition::Range { TestAmdModuleRange() { this.getCallee().(PropAccess).getQualifiedName() = "test.amd.range" } } diff --git a/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitions.ql b/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitions.ql index a2d69f55ce8..c0571921fba 100644 --- a/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitions.ql +++ b/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitions.ql @@ -4,6 +4,7 @@ import semmle.javascript.dataflow.internal.FlowSteps as FlowSteps import semmle.javascript.dataflow.internal.AbstractPropertiesImpl as AbstractPropertiesImpl import semmle.javascript.dataflow.CustomAbstractValueDefinitions +overlay[local] class MyCustomAbstractValueDefinition extends CustomAbstractValueDefinition { DataFlow::ValueNode node; diff --git a/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitionsFlow.ql b/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitionsFlow.ql index 0308ad6bf45..0f34b14b48c 100644 --- a/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitionsFlow.ql +++ b/javascript/ql/test/library-tests/CustomAbstractValueDefinitions/CustomAbstractValueDefinitionsFlow.ql @@ -2,6 +2,7 @@ import javascript import semmle.javascript.dataflow.InferredTypes import semmle.javascript.dataflow.CustomAbstractValueDefinitions +overlay[local] class MyCustomAbstractValueDefinition extends CustomAbstractValueDefinition, AST::ValueNode { MyCustomAbstractValueDefinition() { this.flow() instanceof DataFlow::ObjectLiteralNode and diff --git a/javascript/ql/test/library-tests/FlowCustomisation/customValues.ql b/javascript/ql/test/library-tests/FlowCustomisation/customValues.ql index 0b3f87f1b8d..75c4af21ed7 100644 --- a/javascript/ql/test/library-tests/FlowCustomisation/customValues.ql +++ b/javascript/ql/test/library-tests/FlowCustomisation/customValues.ql @@ -4,6 +4,7 @@ private import semmle.javascript.dataflow.InferredTypes /** * A custom abstract value representing the DOM object `document`. */ +overlay[local] class Document extends CustomAbstractValueTag { Document() { this = "document" } @@ -25,6 +26,7 @@ class Document extends CustomAbstractValueTag { * Note that `getType()` isn't quite right, since `typeof document.all === 'undefined'`, * but that's fine for the purposes of this test. */ +overlay[local] class DocumentAll extends CustomAbstractValueTag { DocumentAll() { this = "document.all" } diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/CustomImport.ql b/javascript/ql/test/library-tests/ModuleImportNodes/CustomImport.ql index abc8c4e1755..c118e36e606 100644 --- a/javascript/ql/test/library-tests/ModuleImportNodes/CustomImport.ql +++ b/javascript/ql/test/library-tests/ModuleImportNodes/CustomImport.ql @@ -1,5 +1,6 @@ import javascript +overlay[local] class CustomImport extends DataFlow::ModuleImportNode::Range, DataFlow::CallNode { CustomImport() { this.getCalleeName() = "customImport" } diff --git a/javascript/ql/test/library-tests/RecursionPrevention/SourceNodeFlowsTo.ql b/javascript/ql/test/library-tests/RecursionPrevention/SourceNodeFlowsTo.ql index 9a5350948fe..a9d27450aee 100644 --- a/javascript/ql/test/library-tests/RecursionPrevention/SourceNodeFlowsTo.ql +++ b/javascript/ql/test/library-tests/RecursionPrevention/SourceNodeFlowsTo.ql @@ -7,6 +7,7 @@ import javascript +overlay[local] class BadSourceNode extends DataFlow::SourceNode { BadSourceNode() { this.(DataFlow::PropRead).getPropertyName() = "foo" } diff --git a/javascript/ql/test/library-tests/frameworks/data/test.ql b/javascript/ql/test/library-tests/frameworks/data/test.ql index 6a1d571351b..6ba504e921f 100644 --- a/javascript/ql/test/library-tests/frameworks/data/test.ql +++ b/javascript/ql/test/library-tests/frameworks/data/test.ql @@ -2,6 +2,7 @@ import javascript deprecated import utils.test.ConsistencyChecking import semmle.javascript.frameworks.data.internal.ApiGraphModels as ApiGraphModels +overlay[local] class TypeModelFromCodeQL extends ModelInput::TypeModel { override predicate isTypeUsed(string type) { type = "danger-constant" } diff --git a/javascript/ql/test/library-tests/frameworks/data/warnings.ql b/javascript/ql/test/library-tests/frameworks/data/warnings.ql index 1ede8e08bcc..2c3c044ef69 100644 --- a/javascript/ql/test/library-tests/frameworks/data/warnings.ql +++ b/javascript/ql/test/library-tests/frameworks/data/warnings.ql @@ -1,6 +1,7 @@ import javascript import semmle.javascript.frameworks.data.internal.ApiGraphModels as ApiGraphModels +overlay[local] class IsTesting extends ApiGraphModels::TestAllModels { IsTesting() { this = this } }