Skip to content

Commit 96d9e66

Browse files
committed
JS: cache things
1 parent 313579c commit 96d9e66

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

javascript/ql/src/semmle/javascript/GlobalAccessPaths.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module GlobalAccessPath {
4141
* })(NS = NS || {});
4242
* ```
4343
*/
44+
cached
4445
string fromReference(DataFlow::Node node) {
4546
result = fromReference(node.getImmediatePredecessor())
4647
or
@@ -142,6 +143,7 @@ module GlobalAccessPath {
142143
* })(foo = foo || {});
143144
* ```
144145
*/
146+
cached
145147
string fromRhs(DataFlow::Node node) {
146148
exists(DataFlow::SourceNode base, string baseName, string name |
147149
node = base.getAPropertyWrite(name).getRhs() and

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ class ClassNode extends DataFlow::SourceNode {
693693
/**
694694
* Gets a dataflow node that refers to this class object.
695695
*/
696+
cached
696697
DataFlow::SourceNode getAClassReference() {
697698
result = getAClassReference(DataFlow::TypeTracker::end())
698699
}
@@ -730,6 +731,7 @@ class ClassNode extends DataFlow::SourceNode {
730731
/**
731732
* Gets a dataflow node that refers to an instance of this class.
732733
*/
734+
cached
733735
DataFlow::SourceNode getAnInstanceReference() {
734736
result = getAnInstanceReference(DataFlow::TypeTracker::end())
735737
}

0 commit comments

Comments
 (0)