mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: cache things
This commit is contained in:
@@ -41,6 +41,7 @@ module GlobalAccessPath {
|
||||
* })(NS = NS || {});
|
||||
* ```
|
||||
*/
|
||||
cached
|
||||
string fromReference(DataFlow::Node node) {
|
||||
result = fromReference(node.getImmediatePredecessor())
|
||||
or
|
||||
@@ -142,6 +143,7 @@ module GlobalAccessPath {
|
||||
* })(foo = foo || {});
|
||||
* ```
|
||||
*/
|
||||
cached
|
||||
string fromRhs(DataFlow::Node node) {
|
||||
exists(DataFlow::SourceNode base, string baseName, string name |
|
||||
node = base.getAPropertyWrite(name).getRhs() and
|
||||
|
||||
@@ -693,6 +693,7 @@ class ClassNode extends DataFlow::SourceNode {
|
||||
/**
|
||||
* Gets a dataflow node that refers to this class object.
|
||||
*/
|
||||
cached
|
||||
DataFlow::SourceNode getAClassReference() {
|
||||
result = getAClassReference(DataFlow::TypeTracker::end())
|
||||
}
|
||||
@@ -730,6 +731,7 @@ class ClassNode extends DataFlow::SourceNode {
|
||||
/**
|
||||
* Gets a dataflow node that refers to an instance of this class.
|
||||
*/
|
||||
cached
|
||||
DataFlow::SourceNode getAnInstanceReference() {
|
||||
result = getAnInstanceReference(DataFlow::TypeTracker::end())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user