Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions javascript/ql/src/semmle/javascript/DefUse.qll
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ private predicate defn(ControlFlowNode def, Expr lhs, AST::ValueNode rhs) {
exists (EnumDeclaration ed | def = ed.getIdentifier() |
lhs = def and rhs = ed
) or
exists (ImportEqualsDeclaration i | def = i.getId() |
lhs = def and rhs = i.getImportedEntity()
exists (ImportEqualsDeclaration i | def = i |
lhs = i.getId() and rhs = i.getImportedEntity()
) or
exists (EnumMember member | def = member.getIdentifier() |
lhs = def and rhs = member.getInitializer()
Expand Down
3 changes: 2 additions & 1 deletion javascript/ql/src/semmle/javascript/ES2015Modules.qll
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ class ExportNamedDeclaration extends ExportDeclaration, @exportnameddeclaration
result = op.(NamespaceDeclaration).getId() or
result = op.(EnumDeclaration).getIdentifier() or
result = op.(InterfaceDeclaration).getIdentifier() or
result = op.(TypeAliasDeclaration).getIdentifier()
result = op.(TypeAliasDeclaration).getIdentifier() or
result = op.(ImportEqualsDeclaration).getId()
)
}

Expand Down
4 changes: 4 additions & 0 deletions javascript/ql/src/semmle/javascript/TypeScript.qll
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ class ImportEqualsDeclaration extends Stmt, @importequalsdeclaration {
Expr getImportedEntity() {
result = getChildExpr(1)
}

override ControlFlowNode getFirstControlFlowNode() {
result = getId()
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as Something from 'somewhere';

export import importExport = Something.thingy;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { importExport } from "./export_import";

function test() {
let f = importExport.prop; // OK
}