mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
JS: Add store step into namespace re-export specifier
This commit is contained in:
@@ -510,6 +510,9 @@ class ExportNamedDeclaration extends ExportDeclaration, @export_named_declaratio
|
||||
or
|
||||
exists(ReExportDeclaration red | red = this |
|
||||
result = red.getReExportedES2015Module().getAnExport().getSourceNode(spec.getLocalName())
|
||||
or
|
||||
spec instanceof ExportNamespaceSpecifier and
|
||||
result = DataFlow::valueNode(spec)
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -524,6 +527,19 @@ class ExportNamedDeclaration extends ExportDeclaration, @export_named_declaratio
|
||||
ExportSpecifier getASpecifier() { result = this.getSpecifier(_) }
|
||||
}
|
||||
|
||||
private import semmle.javascript.dataflow.internal.PreCallGraphStep
|
||||
|
||||
private class ExportNamespaceStep extends PreCallGraphStep {
|
||||
override predicate storeStep(DataFlow::Node pred, DataFlow::SourceNode succ, string prop) {
|
||||
exists(ExportNamedDeclaration exprt, ExportNamespaceSpecifier spec |
|
||||
spec = exprt.getASpecifier() and
|
||||
pred =
|
||||
exprt.(ReExportDeclaration).getReExportedES2015Module().getAnExport().getSourceNode(prop) and
|
||||
succ = DataFlow::valueNode(spec)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An export declaration with the `type` modifier.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user