mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: handle deeper access paths in Closure::moduleImport
This commit is contained in:
@@ -223,9 +223,15 @@ module Closure {
|
||||
or
|
||||
exists(DataFlow::SourceNode base, string basePath, string prop |
|
||||
basePath = getClosureNamespaceFromSourceNode(base) and
|
||||
isClosureNamespace(basePath) and
|
||||
node = base.getAPropertyRead(prop) and
|
||||
result = basePath + "." + prop
|
||||
result = basePath + "." + prop and
|
||||
// ensure finiteness
|
||||
(
|
||||
isClosureNamespace(basePath)
|
||||
or
|
||||
// direct access, no indirection
|
||||
node.(DataFlow::PropRead).getBase() = base
|
||||
)
|
||||
)
|
||||
or
|
||||
// Associate an access path with the immediate RHS of a store on a closure namespace.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| tests/nestedAccess.js:5:1:5:12 | fooBar.x.y.z |
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
| foo.bar | tests/nestedAccess.js:3:14:3:36 | goog.re ... o.bar') |
|
||||
| foo.bar.x | tests/nestedAccess.js:5:1:5:8 | fooBar.x |
|
||||
| foo.bar.x | tests/nestedAccess.js:10:9:10:11 | z.x |
|
||||
| foo.bar.x.y | tests/nestedAccess.js:5:1:5:10 | fooBar.x.y |
|
||||
| foo.bar.x.y.z | tests/nestedAccess.js:5:1:5:12 | fooBar.x.y.z |
|
||||
| goog | tests/es6Module.js:1:1:1:4 | goog |
|
||||
| goog | tests/es6ModuleDefault.js:1:1:1:4 | goog |
|
||||
| goog | tests/globalModule.js:1:1:1:4 | goog |
|
||||
| goog | tests/globalModuleDefault.js:1:1:1:4 | goog |
|
||||
| goog | tests/googModule.js:1:1:1:4 | goog |
|
||||
| goog | tests/googModuleDefault.js:1:1:1:4 | goog |
|
||||
| goog | tests/nestedAccess.js:1:1:1:4 | goog |
|
||||
| goog | tests/nestedAccess.js:3:14:3:17 | goog |
|
||||
| goog | tests/requireFromEs6.js:3:20:3:23 | goog |
|
||||
| goog | tests/requireFromEs6.js:4:27:4:30 | goog |
|
||||
| goog | tests/requireFromEs6.js:6:17:6:20 | goog |
|
||||
@@ -29,12 +36,14 @@
|
||||
| goog.declareModuleId | tests/es6ModuleDefault.js:1:1:1:20 | goog.declareModuleId |
|
||||
| goog.module | tests/googModule.js:1:1:1:11 | goog.module |
|
||||
| goog.module | tests/googModuleDefault.js:1:1:1:11 | goog.module |
|
||||
| goog.module | tests/nestedAccess.js:1:1:1:11 | goog.module |
|
||||
| goog.module | tests/requireFromGoogModule.js:1:1:1:11 | goog.module |
|
||||
| goog.module | tests/uri.js:1:1:1:11 | goog.module |
|
||||
| goog.net | tests/uri.js:3:11:3:34 | goog.re ... g.net') |
|
||||
| goog.net.Uri | tests/uri.js:5:5:5:11 | net.Uri |
|
||||
| goog.provide | tests/globalModule.js:1:1:1:12 | goog.provide |
|
||||
| goog.provide | tests/globalModuleDefault.js:1:1:1:12 | goog.provide |
|
||||
| goog.require | tests/nestedAccess.js:3:14:3:25 | goog.require |
|
||||
| goog.require | tests/requireFromEs6.js:3:20:3:31 | goog.require |
|
||||
| goog.require | tests/requireFromEs6.js:4:27:4:38 | goog.require |
|
||||
| goog.require | tests/requireFromEs6.js:6:17:6:28 | goog.require |
|
||||
|
||||
Reference in New Issue
Block a user