Skip to content

Commit 59d2d6d

Browse files
committed
autoformat
1 parent 7f14722 commit 59d2d6d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,17 @@ module Promises {
145145
* The below is an example of a type-tracking predicate where the initial value is a promise:
146146
* ```
147147
* DataFlow::SourceNode myType(DataFlow::TypeTracker t) {
148-
* t.startInPromise() and
148+
* t.startInPromise() and
149149
* result = <the promise value> and
150150
* or
151151
* exists(DataFlow::TypeTracker t2 | result = myType(t2).track(t2, t))
152152
* }
153153
* ```
154-
*
155-
* The type-tracking predicate above will only end (`t = DataFlow::TypeTracker::end()`) after the tracked value has been
154+
*
155+
* The type-tracking predicate above will only end (`t = DataFlow::TypeTracker::end()`) after the tracked value has been
156156
* extracted from the promise.
157-
*
158-
* The `PromiseTypeTracking::promiseStep` predicate can be used instead of `SourceNode::track`
157+
*
158+
* The `PromiseTypeTracking::promiseStep` predicate can be used instead of `SourceNode::track`
159159
* to get type-tracking only for promise steps.
160160
*
161161
* Replace `t.startInPromise()` in the above example with `t.start()` to create a type-tracking predicate
@@ -241,6 +241,7 @@ abstract private class PromiseFlowStep extends DataFlow::AdditionalFlowStep {
241241
*/
242242
private module PromiseFlow {
243243
private predicate valueProp = Promises::valueProp/0;
244+
244245
private predicate errorProp = Promises::errorProp/0;
245246

246247
/**

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,16 @@ class TypeTracker extends TTypeTracker {
230230
predicate start() { hasCall = false and prop = "" }
231231

232232
/**
233-
* Holds if this is the starting point of type tracking, and the value starts in the property named `propName`.
234-
* The type tracking only ends after the property has been loaded.
233+
* Holds if this is the starting point of type tracking, and the value starts in the property named `propName`.
234+
* The type tracking only ends after the property has been loaded.
235235
*/
236236
predicate startInProp(PropertyName propName) { hasCall = false and prop = propName }
237237

238238
/**
239239
* Holds if this is the starting point of type tracking, and the initial value is a promise.
240240
* The type tracking only ends after the value has been extracted from the promise.
241241
*/
242-
predicate startInPromise() {
243-
startInProp(Promises::valueProp())
244-
}
242+
predicate startInPromise() { startInProp(Promises::valueProp()) }
245243

246244
/**
247245
* Holds if this is the starting point of type tracking

0 commit comments

Comments
 (0)