mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
TS: Support readonly type expressions
This commit is contained in:
@@ -970,6 +970,14 @@ class RestTypeExpr extends @resttypeexpr, TypeExpr {
|
||||
TypeExpr getElementType() { result = getArrayType().(ArrayTypeExpr).getElementType() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A type of form `readonly T`, such as `readonly number[]`.
|
||||
*/
|
||||
class ReadonlyTypeExpr extends @readonlytypeexpr, TypeExpr {
|
||||
/** Gets the type `T` in `readonly T`. */
|
||||
TypeExpr getElementType() { result = getChildTypeExpr(0) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A possibly qualified name that refers to a variable from inside a type.
|
||||
*
|
||||
|
||||
@@ -573,6 +573,7 @@ case @typeexpr.kind of
|
||||
| 33 = @optionaltypeexpr
|
||||
| 34 = @resttypeexpr
|
||||
| 35 = @bigintliteraltypeexpr
|
||||
| 36 = @readonlytypeexpr
|
||||
;
|
||||
|
||||
@typeref = @typeaccess | @typedecl;
|
||||
|
||||
Reference in New Issue
Block a user