mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
add support for static initializer blocks in TypeScript
This commit is contained in:
@@ -632,6 +632,8 @@ public class TypeScriptASTConverter {
|
||||
return convertWithStatement(node, loc);
|
||||
case "YieldExpression":
|
||||
return convertYieldExpression(node, loc);
|
||||
case "ClassStaticBlockDeclaration":
|
||||
return convertStaticInitializerBlock(node, loc);
|
||||
default:
|
||||
throw new ParseError(
|
||||
"Unsupported TypeScript syntax " + kind, getSourceLocation(node).getStart());
|
||||
@@ -866,6 +868,10 @@ public class TypeScriptASTConverter {
|
||||
}
|
||||
}
|
||||
|
||||
private Node convertStaticInitializerBlock(JsonObject node, SourceLocation loc) throws ParseError {
|
||||
return new BlockStatement(loc, convertChildren(node.get("body").getAsJsonObject(), "statements"));
|
||||
}
|
||||
|
||||
private Node convertBlock(JsonObject node, SourceLocation loc) throws ParseError {
|
||||
return new BlockStatement(loc, convertChildren(node, "statements"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user