Skip to content

Commit b2faac3

Browse files
author
Max Schaefer
committed
JavaScript: Add a few missing doc comments.
1 parent 8604057 commit b2faac3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class TypeTracker extends TTypeTracker {
126126

127127
TypeTracker() { this = MkTypeTracker(hasCall, prop) }
128128

129+
/** Gets the summary resulting from appending `step` to this type-tracking summary. */
129130
TypeTracker append(StepSummary step) {
130131
step = LevelStep() and result = this
131132
or
@@ -140,6 +141,7 @@ class TypeTracker extends TTypeTracker {
140141
)
141142
}
142143

144+
/** Gets a textual representation of this summary. */
143145
string toString() {
144146
exists(string withCall, string withProp |
145147
(if hasCall = true then withCall = "with" else withCall = "without") and
@@ -153,6 +155,9 @@ class TypeTracker extends TTypeTracker {
153155
*/
154156
predicate start() { hasCall = false and prop = "" }
155157

158+
/**
159+
* Holds if this is the end point of type tracking.
160+
*/
156161
predicate end() { prop = "" }
157162

158163
/**
@@ -162,6 +167,10 @@ class TypeTracker extends TTypeTracker {
162167
*/
163168
boolean hasCall() { result = hasCall }
164169

170+
/**
171+
* Gets the property this type has been tracked into, or the empty string if
172+
* it has not been tracked into a property.
173+
*/
165174
string getProp() { result = prop }
166175
}
167176

@@ -206,6 +215,7 @@ class TypeBackTracker extends TTypeBackTracker {
206215

207216
TypeBackTracker() { this = MkTypeBackTracker(hasReturn, prop) }
208217

218+
/** Gets the summary resulting from prepending `step` to this type-tracking summary. */
209219
TypeBackTracker prepend(StepSummary step) {
210220
step = LevelStep() and result = this
211221
or
@@ -220,6 +230,7 @@ class TypeBackTracker extends TTypeBackTracker {
220230
step = StoreStep(prop) and result = MkTypeBackTracker(hasReturn, "")
221231
}
222232

233+
/** Gets a textual representation of this summary. */
223234
string toString() {
224235
exists(string withReturn, string withProp |
225236
(if hasReturn = true then withReturn = "with" else withReturn = "without") and
@@ -233,6 +244,9 @@ class TypeBackTracker extends TTypeBackTracker {
233244
*/
234245
predicate start() { hasReturn = false and prop = "" }
235246

247+
/**
248+
* Holds if this is the end point of type tracking.
249+
*/
236250
predicate end() { prop = "" }
237251

238252
/**
@@ -242,6 +256,10 @@ class TypeBackTracker extends TTypeBackTracker {
242256
*/
243257
boolean hasReturn() { result = hasReturn }
244258

259+
/**
260+
* Gets the property this type has been tracked into, or the empty string if
261+
* it has not been tracked into a property.
262+
*/
245263
string getProp() { result = prop }
246264
}
247265

0 commit comments

Comments
 (0)