JS: Add SatisfiesExpr

This commit is contained in:
Asger F
2025-06-04 22:12:36 +02:00
parent 79101fd121
commit 57fad7e6c9
4 changed files with 6 additions and 2 deletions

View File

@@ -334,7 +334,8 @@ module SourceNode {
astNode instanceof Templating::PipeRefExpr or
astNode instanceof Templating::TemplateVarRefExpr or
astNode instanceof StringLiteral or
astNode instanceof TypeAssertion
astNode instanceof TypeAssertion or
astNode instanceof SatisfiesExpr
)
or
exists(VariableDeclarator decl |

View File

@@ -235,6 +235,8 @@ module TypeResolution {
or
value.(TypeAssertion).getTypeAnnotation() = type
or
value.(SatisfiesExpr).getTypeAnnotation() = type
or
exists(VarDecl decl |
// ValueFlow::step is restricted to variables with at most one assignment. Allow the type annotation
// of a variable to propagate to its uses, even if the variable has multiple assignments.