зеркало из https://github.com/github/codeql.git
JS: rename getDefaultNode to getImportedModuleNode
This commit is contained in:
Родитель
0660db37f6
Коммит
c143e31fb5
|
@ -264,7 +264,7 @@ private class AmdDependencyImport extends Import {
|
|||
result = resolveByAbsolutePath()
|
||||
}
|
||||
|
||||
override DataFlow::Node getDefaultNode() {
|
||||
override DataFlow::Node getImportedModuleNode() {
|
||||
exists(Parameter param |
|
||||
any(AmdModuleDefinition def).dependencyParameter(this, param) and
|
||||
result = DataFlow::parameterNode(param)
|
||||
|
|
|
@ -44,7 +44,7 @@ class ImportDeclaration extends Stmt, Import, @importdeclaration {
|
|||
/** Gets an import specifier of this import declaration. */
|
||||
ImportSpecifier getASpecifier() { result = getSpecifier(_) }
|
||||
|
||||
override DataFlow::Node getDefaultNode() {
|
||||
override DataFlow::Node getImportedModuleNode() {
|
||||
// `import * as http from 'http'` or `import http from `http`'
|
||||
exists(ImportSpecifier is |
|
||||
is = getASpecifier() and
|
||||
|
|
|
@ -1563,7 +1563,7 @@ class DynamicImportExpr extends @dynamicimport, Expr, Import {
|
|||
|
||||
override Module getEnclosingModule() { result = getTopLevel() }
|
||||
|
||||
override DataFlow::Node getDefaultNode() { result = DataFlow::valueNode(this) }
|
||||
override DataFlow::Node getImportedModuleNode() { result = DataFlow::valueNode(this) }
|
||||
}
|
||||
|
||||
/** A literal path expression appearing in a dynamic import. */
|
||||
|
|
|
@ -164,7 +164,7 @@ abstract class Import extends ASTNode {
|
|||
/**
|
||||
* Gets the data flow node that the default import of this import is available at.
|
||||
*/
|
||||
abstract DataFlow::Node getDefaultNode();
|
||||
abstract DataFlow::Node getImportedModuleNode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -235,7 +235,7 @@ class Require extends CallExpr, Import {
|
|||
)
|
||||
}
|
||||
|
||||
override DataFlow::Node getDefaultNode() { result = DataFlow::valueNode(this) }
|
||||
override DataFlow::Node getImportedModuleNode() { result = DataFlow::valueNode(this) }
|
||||
}
|
||||
|
||||
/** An argument to `require` or `require.resolve`, considered as a path expression. */
|
||||
|
|
|
@ -213,7 +213,7 @@ class ExternalModuleReference extends Expr, Import, @externalmodulereference {
|
|||
result = getExpression().getFirstControlFlowNode()
|
||||
}
|
||||
|
||||
override DataFlow::Node getDefaultNode() { result = DataFlow::valueNode(this) }
|
||||
override DataFlow::Node getImportedModuleNode() { result = DataFlow::valueNode(this) }
|
||||
}
|
||||
|
||||
/** A literal path expression appearing in an external module reference. */
|
||||
|
|
|
@ -463,7 +463,7 @@ module ModuleImportNode {
|
|||
|
||||
DefaultRange() {
|
||||
exists(Import i |
|
||||
this = i.getDefaultNode() and
|
||||
this = i.getImportedModuleNode() and
|
||||
i.getImportedPath().getValue() = path
|
||||
)
|
||||
or
|
||||
|
@ -494,7 +494,7 @@ ModuleImportNode moduleImport(string path) { result.getPath() = path }
|
|||
* `"lodash"` as a dependency.
|
||||
*/
|
||||
ModuleImportNode dependencyModuleImport(Dependency dep) {
|
||||
result = dep.getAUse("import").(Import).getDefaultNode()
|
||||
result = dep.getAUse("import").(Import).getImportedModuleNode()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче