mirror of
https://github.com/github/codeql.git
synced 2026-01-08 12:10:22 +01:00
JS: Handle DynamicImport in the context of a type
This commit is contained in:
@@ -10,6 +10,7 @@ import com.semmle.js.ast.TemplateElement;
|
||||
import com.semmle.js.extractor.ASTExtractor.IdContext;
|
||||
import com.semmle.ts.ast.ArrayTypeExpr;
|
||||
import com.semmle.ts.ast.ConditionalTypeExpr;
|
||||
import com.semmle.js.ast.DynamicImport;
|
||||
import com.semmle.ts.ast.FunctionTypeExpr;
|
||||
import com.semmle.ts.ast.GenericTypeExpr;
|
||||
import com.semmle.ts.ast.ImportTypeExpr;
|
||||
@@ -221,8 +222,7 @@ public class TypeExprKinds {
|
||||
return inferTypeExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(ImportTypeExpr nd, Void c) {
|
||||
private Integer handleInlineImport() {
|
||||
switch (idcontext) {
|
||||
case NAMESPACE_BIND:
|
||||
return importNamespaceAccess;
|
||||
@@ -235,6 +235,17 @@ public class TypeExprKinds {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(ImportTypeExpr nd, Void c) {
|
||||
return handleInlineImport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(DynamicImport nd, Void c) {
|
||||
// These may appear in interface 'extend' clauses
|
||||
return handleInlineImport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer visit(OptionalTypeExpr nd, Void c) {
|
||||
return optionalTypeExpr;
|
||||
|
||||
Reference in New Issue
Block a user