Skip to content

Commit 1a2983f

Browse files
committed
support small steps for promise tracking
1 parent 00181e0 commit 1a2983f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

javascript/ql/src/semmle/javascript/Promises.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module PromiseTypeTracking {
168168
* This can be loading a resolved value from a promise, storing a value in a promise, or copying a resolved value from one promise to another.
169169
*/
170170
pragma[inline]
171-
DataFlow::SourceNode promiseStep(DataFlow::SourceNode pred, StepSummary summary) {
171+
DataFlow::Node promiseStep(DataFlow::Node pred, StepSummary summary) {
172172
exists(PromiseFlowStep step, string field | field = Promises::valueProp() |
173173
summary = LoadStep(field) and
174174
step.load(pred, result, field)
@@ -189,9 +189,8 @@ module PromiseTypeTracking {
189189
DataFlow::SourceNode promiseStep(
190190
DataFlow::SourceNode pred, DataFlow::TypeTracker t, DataFlow::TypeTracker t2
191191
) {
192-
exists(StepSummary summary |
193-
result = PromiseTypeTracking::promiseStep(pred, summary) and
194-
t = t2.append(summary)
192+
exists(DataFlow::Node mid, StepSummary summary | pred.flowsTo(mid) and t = t2.append(summary) |
193+
result = PromiseTypeTracking::promiseStep(mid, summary)
195194
)
196195
}
197196

0 commit comments

Comments
 (0)