mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Merge branch 'main' into main
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: majorAnalysis
|
||||
---
|
||||
* Added support for TypeScript 4.9.
|
||||
@@ -1375,6 +1375,27 @@ class AsTypeAssertion extends TypeAssertion, @as_type_assertion { }
|
||||
*/
|
||||
class PrefixTypeAssertion extends TypeAssertion, @prefix_type_assertion { }
|
||||
|
||||
/**
|
||||
* A satisfies type asserion of the form `E satisfies T` where `E` is an expression and `T` is a type.
|
||||
*/
|
||||
class SatisfiesExpr extends Expr, @satisfies_expr {
|
||||
/** Gets the expression whose type to assert, that is, the `E` in `E as T` or `<T> E`. */
|
||||
Expr getExpression() { result = this.getChildExpr(0) }
|
||||
|
||||
/** Gets the type to cast to, that is, the `T` in `E as T` or `<T> E`. */
|
||||
TypeExpr getTypeAnnotation() { result = this.getChildTypeExpr(1) }
|
||||
|
||||
override ControlFlowNode getFirstControlFlowNode() {
|
||||
result = this.getExpression().getFirstControlFlowNode()
|
||||
}
|
||||
|
||||
override Expr getUnderlyingValue() { result = this.getExpression().getUnderlyingValue() }
|
||||
|
||||
override Expr getUnderlyingReference() { result = this.getExpression().getUnderlyingReference() }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "SatisfiesExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A TypeScript expression of form `E!`, asserting that `E` is not null.
|
||||
*/
|
||||
|
||||
@@ -1580,6 +1580,8 @@ module DataFlow {
|
||||
or
|
||||
predExpr = succExpr.(TypeAssertion).getExpression()
|
||||
or
|
||||
predExpr = succExpr.(SatisfiesExpr).getExpression()
|
||||
or
|
||||
predExpr = succExpr.(NonNullAssertion).getExpression()
|
||||
or
|
||||
predExpr = succExpr.(ExpressionWithTypeArguments).getExpression()
|
||||
|
||||
@@ -357,6 +357,7 @@ case @expr.kind of
|
||||
| 118 = @assignnullishcoalescingexpr
|
||||
| 119 = @template_pipe_ref
|
||||
| 120 = @generated_code_expr
|
||||
| 121 = @satisfies_expr
|
||||
;
|
||||
|
||||
@varaccess = @proper_varaccess | @export_varaccess;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: add support for TypeScript 4.9
|
||||
compatibility: backwards
|
||||
Reference in New Issue
Block a user