Merge branch 'main' into main

This commit is contained in:
Mauro Baluda
2022-11-16 11:06:27 +01:00
committed by GitHub
88 changed files with 7713 additions and 3969 deletions

View File

@@ -0,0 +1,4 @@
---
category: majorAnalysis
---
* Added support for TypeScript 4.9.

View File

@@ -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.
*/

View File

@@ -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()

View File

@@ -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

View File

@@ -0,0 +1,2 @@
description: add support for TypeScript 4.9
compatibility: backwards