mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JS: Don't try to augment invalid files
This check existed on the code path for full type extraction, but not for plain single-file extraction.
This commit is contained in:
@@ -372,7 +372,9 @@ function isExtractableSourceFile(ast: ast_extractor.AugmentedSourceFile): boolea
|
||||
*/
|
||||
function getAstForFile(filename: string): ts.SourceFile {
|
||||
let { ast, code } = parseSingleFile(filename);
|
||||
ast_extractor.augmentAst(ast, code, null);
|
||||
if (ast != null && isExtractableSourceFile(ast)) {
|
||||
ast_extractor.augmentAst(ast, code, null);
|
||||
}
|
||||
return ast;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user