Skip to content

Commit df12f25

Browse files
committed
JS: Rename propagatesFlowExt -> propagatesFlow
1 parent 66d6bda commit df12f25

File tree

10 files changed

+61
-62
lines changed

10 files changed

+61
-62
lines changed

javascript/ql/lib/semmle/javascript/dataflow/FlowSummary.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ abstract class SummarizedCallable extends LibraryCallable, Impl::Public::Summari
1111
bindingset[this]
1212
SummarizedCallable() { any() }
1313

14-
// TODO: rename 'propagatesFlowExt' and/or override 'propagatesFlow' directly
1514
/**
1615
* Holds if data may flow from `input` to `output` through this callable.
1716
*
1817
* `preservesValue` indicates whether this is a value-preserving step or a taint-step.
1918
*/
2019
pragma[nomagic]
21-
predicate propagatesFlowExt(string input, string output, boolean preservesValue) { none() }
20+
predicate propagatesFlow(string input, string output, boolean preservesValue) { none() }
2221

2322
override predicate propagatesFlow(
2423
string input, string output, boolean preservesValue, string model
2524
) {
26-
this.propagatesFlowExt(input, output, preservesValue) and model = this
25+
this.propagatesFlow(input, output, preservesValue) and model = this
2726
}
2827

2928
/**

javascript/ql/lib/semmle/javascript/internal/flow_summaries/AmbiguousCoreMethods.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class At extends SummarizedCallable {
3131

3232
override InstanceCall getACallSimple() { result.getMethodName() = "at" }
3333

34-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
34+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
3535
preservesValue = true and
3636
input = "Argument[this].ArrayElement" and
3737
output = "ReturnValue"
@@ -45,7 +45,7 @@ class Concat extends SummarizedCallable {
4545

4646
override InstanceCall getACallSimple() { result.getMethodName() = "concat" }
4747

48-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
48+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
4949
preservesValue = true and
5050
input = "Argument[this,0..].ArrayElement" and
5151
output = "ReturnValue.ArrayElement"
@@ -61,7 +61,7 @@ class Slice extends SummarizedCallable {
6161

6262
override InstanceCall getACallSimple() { result.getMethodName() = "slice" }
6363

64-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
64+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
6565
preservesValue = true and
6666
input = "Argument[this].ArrayElement" and
6767
output = "ReturnValue.ArrayElement"
@@ -80,7 +80,7 @@ class Entries extends SummarizedCallable {
8080
result.getNumArgument() = 0
8181
}
8282

83-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
83+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
8484
preservesValue = true and
8585
(
8686
input = "Argument[this]." + ["MapKey", "SetElement"] and
@@ -97,7 +97,7 @@ class ForEach extends SummarizedCallable {
9797

9898
override InstanceCall getACallSimple() { result.getMethodName() = "forEach" }
9999

100-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
100+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
101101
preservesValue = true and
102102
/*
103103
* array.forEach(callbackfn, thisArg)
@@ -128,7 +128,7 @@ class Keys extends SummarizedCallable {
128128
result.getNumArgument() = 0
129129
}
130130

131-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
131+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
132132
preservesValue = true and
133133
input = "Argument[this]." + ["MapKey", "SetElement"] and
134134
output = "ReturnValue.IteratorElement"
@@ -143,7 +143,7 @@ class Values extends SummarizedCallable {
143143
result.getNumArgument() = 0
144144
}
145145

146-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
146+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
147147
preservesValue = true and
148148
input = "Argument[this]." + ["ArrayElement", "SetElement", "MapValue"] and
149149
output = "ReturnValue.IteratorElement"

javascript/ql/lib/semmle/javascript/internal/flow_summaries/Arrays.qll

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ArrayConstructorSummary extends SummarizedCallable {
9999
result = arrayConstructorRef().getAnInvocation()
100100
}
101101

102-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
102+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
103103
preservesValue = true and
104104
input = "Argument[0..]" and
105105
output = "ReturnValue.ArrayElement"
@@ -123,7 +123,7 @@ class Join extends SummarizedCallable {
123123
result.getNumArgument() = [0, 1]
124124
}
125125

126-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
126+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
127127
preservesValue = false and
128128
input = "Argument[this].ArrayElement" and
129129
output = "ReturnValue"
@@ -135,7 +135,7 @@ class CopyWithin extends SummarizedCallable {
135135

136136
override InstanceCall getACallSimple() { result.getMethodName() = "copyWithin" }
137137

138-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
138+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
139139
preservesValue = true and
140140
input = "Argument[this].WithArrayElement" and
141141
output = "ReturnValue"
@@ -154,7 +154,7 @@ class FlowIntoCallback extends SummarizedCallable {
154154
result.getMethodName() = ["every", "findIndex", "findLastIndex", "some"]
155155
}
156156

157-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
157+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
158158
preservesValue = true and
159159
(
160160
input = "Argument[this].ArrayElement" and
@@ -171,7 +171,7 @@ class Filter extends SummarizedCallable {
171171

172172
override InstanceCall getACallSimple() { result.getMethodName() = "filter" }
173173

174-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
174+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
175175
preservesValue = true and
176176
(
177177
input = "Argument[this].ArrayElement" and
@@ -198,7 +198,7 @@ class Fill extends SummarizedCallable {
198198

199199
override InstanceCall getACallSimple() { result.getMethodName() = "fill" }
200200

201-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
201+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
202202
preservesValue = true and
203203
input = "Argument[0..]" and
204204
output = ["ReturnValue.ArrayElement", "Argument[this].ArrayElement"]
@@ -210,7 +210,7 @@ class FindLike extends SummarizedCallable {
210210

211211
override InstanceCall getACallSimple() { result.getMethodName() = ["find", "findLast"] }
212212

213-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
213+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
214214
preservesValue = true and
215215
(
216216
input = "Argument[this].ArrayElement" and
@@ -229,7 +229,7 @@ class FindLibrary extends SummarizedCallable {
229229
result = DataFlow::moduleImport(["array.prototype.find", "array-find"]).getACall()
230230
}
231231

232-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
232+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
233233
preservesValue = true and
234234
(
235235
input = "Argument[0].ArrayElement" and
@@ -257,7 +257,7 @@ class Flat extends SummarizedCallable {
257257
)
258258
}
259259

260-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
260+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
261261
preservesValue = true and
262262
(
263263
input = "Argument[this]" + concat(int n | n in [0 .. depth] | ".ArrayElement")
@@ -277,7 +277,7 @@ class FlatMap extends SummarizedCallable {
277277

278278
override InstanceCall getACallSimple() { result.getMethodName() = "flatMap" }
279279

280-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
280+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
281281
preservesValue = true and
282282
(
283283
input = "Argument[this].ArrayElement" and
@@ -309,7 +309,7 @@ class From1Arg extends SummarizedCallable {
309309
result = arrayFromCall() and result.getNumArgument() = 1
310310
}
311311

312-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
312+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
313313
preservesValue = true and
314314
(
315315
input = "Argument[0].WithArrayElement" and
@@ -346,7 +346,7 @@ class FromManyArg extends SummarizedCallable {
346346
result.getNumArgument() > 1
347347
}
348348

349-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
349+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
350350
preservesValue = true and
351351
(
352352
input = "Argument[0]." + ["ArrayElement", "SetElement", "IteratorElement"] and
@@ -380,7 +380,7 @@ class Map extends SummarizedCallable {
380380
result.getMethodName() = "map"
381381
}
382382

383-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
383+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
384384
preservesValue = true and
385385
(
386386
input = "Argument[this].ArrayElement" and
@@ -405,7 +405,7 @@ class Of extends SummarizedCallable {
405405
result = arrayConstructorRef().getAMemberCall("of")
406406
}
407407

408-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
408+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
409409
preservesValue = true and
410410
input = "Argument[0..]" and
411411
output = "ReturnValue.ArrayElement"
@@ -417,7 +417,7 @@ class Pop extends SummarizedCallable {
417417

418418
override InstanceCall getACallSimple() { result.getMethodName() = "pop" }
419419

420-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
420+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
421421
preservesValue = true and
422422
input = "Argument[this].ArrayElement" and
423423
output = "ReturnValue"
@@ -429,7 +429,7 @@ class PushLike extends SummarizedCallable {
429429

430430
override InstanceCall getACallSimple() { result.getMethodName() = ["push", "unshift"] }
431431

432-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
432+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
433433
preservesValue = true and
434434
input = "Argument[0..]" and
435435
output = "Argument[this].ArrayElement"
@@ -441,7 +441,7 @@ class ReduceLike extends SummarizedCallable {
441441

442442
override InstanceCall getACallSimple() { result.getMethodName() = ["reduce", "reduceRight"] }
443443

444-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
444+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
445445
preservesValue = true and
446446
/*
447447
* Signatures:
@@ -470,7 +470,7 @@ class Reverse extends SummarizedCallable {
470470

471471
override InstanceCall getACallSimple() { result.getMethodName() = ["reverse", "toReversed"] }
472472

473-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
473+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
474474
preservesValue = true and
475475
input = "Argument[this].ArrayElement" and
476476
output = "ReturnValue.ArrayElement"
@@ -482,7 +482,7 @@ class Shift extends SummarizedCallable {
482482

483483
override InstanceCall getACallSimple() { result.getMethodName() = "shift" }
484484

485-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
485+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
486486
preservesValue = true and
487487
input = "Argument[this].ArrayElement[0]" and
488488
output = "ReturnValue"
@@ -500,7 +500,7 @@ class Sort extends SummarizedCallable {
500500

501501
override InstanceCall getACallSimple() { result.getMethodName() = ["sort", "toSorted"] }
502502

503-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
503+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
504504
preservesValue = true and
505505
(
506506
input = "Argument[this].ArrayElement" and
@@ -517,7 +517,7 @@ class Splice extends SummarizedCallable {
517517

518518
override InstanceCall getACallSimple() { result.getMethodName() = "splice" }
519519

520-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
520+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
521521
preservesValue = true and
522522
(
523523
input = "Argument[this].ArrayElement" and
@@ -534,7 +534,7 @@ class ToSpliced extends SummarizedCallable {
534534

535535
override InstanceCall getACallSimple() { result.getMethodName() = "toSpliced" }
536536

537-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
537+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
538538
preservesValue = true and
539539
(
540540
input = "Argument[this].ArrayElement" and
@@ -551,7 +551,7 @@ class ArrayCoercionPackage extends FunctionalPackageSummary {
551551

552552
override string getAPackageName() { result = ["arrify", "array-ify"] }
553553

554-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
554+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
555555
preservesValue = true and
556556
(
557557
input = "Argument[0].WithArrayElement" and
@@ -573,7 +573,7 @@ class ArrayCopyingPackage extends FunctionalPackageSummary {
573573

574574
override string getAPackageName() { result = ["array-union", "array-uniq", "uniq"] }
575575

576-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
576+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
577577
preservesValue = true and
578578
input = "Argument[0..].ArrayElement" and
579579
output = "ReturnValue.ArrayElement"
@@ -587,7 +587,7 @@ class ArrayFlatteningPackage extends FunctionalPackageSummary {
587587
result = ["array-flatten", "arr-flatten", "flatten", "array.prototype.flat"]
588588
}
589589

590-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
590+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
591591
// TODO: properly support these. For the moment we're just adding parity with the old model
592592
preservesValue = false and
593593
input = "Argument[0..]" and

javascript/ql/lib/semmle/javascript/internal/flow_summaries/ExceptionFlow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private class ExceptionFlowSummary extends SummarizedCallable, LibraryCallableIn
4040
isCallback(result.getAnArgument().getALocalSource())
4141
}
4242

43-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
43+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
4444
preservesValue = true and
4545
input = "Argument[0..].ReturnValue[exception]" and
4646
output = "ReturnValue[exception]"

javascript/ql/lib/semmle/javascript/internal/flow_summaries/Iterators.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IteratorNext extends SummarizedCallable {
1616
result.getNumArgument() = 0
1717
}
1818

19-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
19+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
2020
preservesValue = true and
2121
(
2222
input = "Argument[this].IteratorElement" and

javascript/ql/lib/semmle/javascript/internal/flow_summaries/JsonStringify.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private class JsonStringifySummary extends SummarizedCallable {
1212

1313
override DataFlow::InvokeNode getACall() { result instanceof JsonStringifyCall }
1414

15-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
15+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
1616
preservesValue = false and
1717
input = ["Argument[0]", "Argument[0].AnyMemberDeep"] and
1818
output = "ReturnValue"

javascript/ql/lib/semmle/javascript/internal/flow_summaries/Maps.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MapConstructor extends SummarizedCallable {
1515
result = mapConstructorRef().getAnInstantiation()
1616
}
1717

18-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
18+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
1919
preservesValue = true and
2020
(
2121
input = "Argument[0]." + ["ArrayElement", "SetElement", "IteratorElement"] + ".Member[0]" and
@@ -87,7 +87,7 @@ class MapGet extends SummarizedCallable {
8787
result.getNumArgument() = 1
8888
}
8989

90-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
90+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
9191
preservesValue = true and
9292
input = "Argument[this].MapValue" and
9393
output = "ReturnValue"
@@ -102,7 +102,7 @@ class MapSet extends SummarizedCallable {
102102
result.getNumArgument() = 2
103103
}
104104

105-
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
105+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
106106
preservesValue = true and
107107
input = ["Argument[this].WithMapKey", "Argument[this].WithMapValue"] and
108108
output = "ReturnValue"

0 commit comments

Comments
 (0)