We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9c4636 commit 1e83aa2Copy full SHA for 1e83aa2
javascript/ql/lib/semmle/javascript/dataflow/internal/CallGraphs.qll
@@ -97,9 +97,14 @@ module CallGraph {
97
not exists(read.getPropertyName()) and
98
result = read and
99
// there exists only local reads of the object, nothing else.
100
- forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) |
101
- ref = [obj, any(DataFlow::PropRead r).getBase()]
102
- )
+ objectOnlyUsedForPropRead(obj)
+ )
+ }
103
+
104
+ pragma[nomagic]
105
+ private predicate objectOnlyUsedForPropRead(DataFlow::ObjectLiteralNode obj) {
106
+ forex(DataFlow::Node ref | ref = obj.getALocalUse() and exists(ref.asExpr()) |
107
+ ref = [obj, any(DataFlow::PropRead r).getBase()]
108
)
109
}
110
0 commit comments