mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
TS: allow namespace imports as types
This commit is contained in:
@@ -42,7 +42,6 @@ import com.semmle.js.ast.IPattern;
|
||||
import com.semmle.js.ast.Identifier;
|
||||
import com.semmle.js.ast.IfStatement;
|
||||
import com.semmle.js.ast.ImportDeclaration;
|
||||
import com.semmle.js.ast.ImportNamespaceSpecifier;
|
||||
import com.semmle.js.ast.ImportSpecifier;
|
||||
import com.semmle.js.ast.InvokeExpression;
|
||||
import com.semmle.js.ast.JumpStatement;
|
||||
@@ -1449,13 +1448,7 @@ public class ASTExtractor {
|
||||
public Label visit(ImportSpecifier nd, Context c) {
|
||||
Label lbl = super.visit(nd, c);
|
||||
visit(nd.getImported(), lbl, 0, IdContext.label);
|
||||
visit(
|
||||
nd.getLocal(),
|
||||
lbl,
|
||||
1,
|
||||
nd instanceof ImportNamespaceSpecifier
|
||||
? IdContext.varAndNamespaceDecl
|
||||
: IdContext.varAndTypeAndNamespaceDecl);
|
||||
visit(nd.getLocal(), lbl, 1, IdContext.varAndTypeAndNamespaceDecl);
|
||||
return lbl;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Main {
|
||||
* A version identifier that should be updated every time the extractor changes in such a way that
|
||||
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
|
||||
*/
|
||||
public static final String EXTRACTOR_VERSION = "2019-03-13";
|
||||
public static final String EXTRACTOR_VERSION = "2019-03-20";
|
||||
|
||||
public static final Pattern NEWLINE = Pattern.compile("\n");
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.semmle.js.ast.INode;
|
||||
import com.semmle.js.ast.Identifier;
|
||||
import com.semmle.js.ast.IfStatement;
|
||||
import com.semmle.js.ast.ImportDeclaration;
|
||||
import com.semmle.js.ast.ImportNamespaceSpecifier;
|
||||
import com.semmle.js.ast.ImportSpecifier;
|
||||
import com.semmle.js.ast.LabeledStatement;
|
||||
import com.semmle.js.ast.LetExpression;
|
||||
@@ -559,9 +558,7 @@ public class ScopeManager {
|
||||
|
||||
@Override
|
||||
public Void visit(ImportSpecifier nd, Void c) {
|
||||
return visit(
|
||||
nd.getLocal(),
|
||||
nd instanceof ImportNamespaceSpecifier ? DeclKind.varAndNamespace : DeclKind.all);
|
||||
return visit(nd.getLocal(), DeclKind.all);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user