mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
JS: Add SatisfiesExpr
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -50,4 +50,5 @@
|
||||
| subtype.ts:19:13:19:15 | req | 'express'.Request |
|
||||
| typeCast.ts:4:16:4:35 | e as express.Request | 'express'.Request |
|
||||
| typeCast.ts:5:16:5:33 | <express.Request>e | 'express'.Request |
|
||||
| typeCast.ts:6:16:6:42 | e satis ... Request | 'express'.Request |
|
||||
| varAssignment.ts:4:9:4:11 | req | 'express'.Request |
|
||||
|
||||
@@ -3,5 +3,5 @@ import * as express from 'express';
|
||||
function t1(e) {
|
||||
var req1 = e as express.Request; // $ hasUnderlyingType='express'.Request
|
||||
var req2 = <express.Request>e; // $ hasUnderlyingType='express'.Request
|
||||
var req3 = e satisfies express.Request;
|
||||
var req3 = e satisfies express.Request; // $ hasUnderlyingType='express'.Request
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user