@@ -111,13 +111,10 @@ private module ArrayDataFlow {
111
111
this .getMethodName ( ) = "unshift"
112
112
}
113
113
114
- /**
115
- * Holds if `pred` should be stored in the object `succ` under the property `prop`.
116
- */
117
- override predicate storeStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
114
+ override predicate storeStep ( DataFlow:: Node element , DataFlow:: Node obj , string prop ) {
118
115
prop = arrayElement ( ) and
119
- ( pred = this .getAnArgument ( ) or pred = this .getASpreadArgument ( ) ) and
120
- succ = this .getReceiver ( ) .getALocalSource ( )
116
+ ( element = this .getAnArgument ( ) or element = this .getASpreadArgument ( ) ) and
117
+ obj = this .getReceiver ( ) .getALocalSource ( )
121
118
}
122
119
}
123
120
@@ -141,22 +138,16 @@ private module ArrayDataFlow {
141
138
)
142
139
}
143
140
144
- /**
145
- * Holds if the property `prop` of the object `pred` should be loaded into `succ`.
146
- */
147
- override predicate loadStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
141
+ override predicate loadStep ( DataFlow:: Node obj , DataFlow:: Node element , string prop ) {
148
142
prop = arrayElement ( ) and
149
- pred = this .( DataFlow:: PropRead ) .getBase ( ) and
150
- succ = this
143
+ obj = this .( DataFlow:: PropRead ) .getBase ( ) and
144
+ element = this
151
145
}
152
146
153
- /**
154
- * Holds if `pred` should be stored in the object `succ` under the property `prop`.
155
- */
156
- override predicate storeStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
147
+ override predicate storeStep ( DataFlow:: Node element , DataFlow:: Node obj , string prop ) {
157
148
prop = arrayElement ( ) and
158
- pred = this .( DataFlow:: PropWrite ) .getRhs ( ) and
159
- this = succ .( DataFlow:: SourceNode ) .getAPropertyWrite ( )
149
+ element = this .( DataFlow:: PropWrite ) .getRhs ( ) and
150
+ this = obj .( DataFlow:: SourceNode ) .getAPropertyWrite ( )
160
151
}
161
152
}
162
153
@@ -170,13 +161,10 @@ private module ArrayDataFlow {
170
161
getMethodName ( ) = "shift"
171
162
}
172
163
173
- /**
174
- * Holds if the property `prop` of the object `pred` should be loaded into `succ`.
175
- */
176
- override predicate loadStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
164
+ override predicate loadStep ( DataFlow:: Node obj , DataFlow:: Node element , string prop ) {
177
165
prop = arrayElement ( ) and
178
- pred = this .getReceiver ( ) and
179
- succ = this
166
+ obj = this .getReceiver ( ) and
167
+ element = this
180
168
}
181
169
}
182
170
@@ -196,28 +184,19 @@ private module ArrayDataFlow {
196
184
this .getMethodName ( ) = "forEach"
197
185
}
198
186
199
- /**
200
- * Holds if the property `prop` of the object `pred` should be loaded into `succ`.
201
- */
202
- override predicate loadStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
187
+ override predicate loadStep ( DataFlow:: Node obj , DataFlow:: Node element , string prop ) {
203
188
prop = arrayElement ( ) and
204
- pred = this .getReceiver ( ) and
205
- succ = getCallback ( 0 ) .getParameter ( 0 )
189
+ obj = this .getReceiver ( ) and
190
+ element = getCallback ( 0 ) .getParameter ( 0 )
206
191
}
207
192
208
- /**
209
- * Holds if `pred` should be stored in the object `succ` under the property `prop`.
210
- */
211
- override predicate storeStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
193
+ override predicate storeStep ( DataFlow:: Node element , DataFlow:: Node obj , string prop ) {
212
194
this .getMethodName ( ) = "map" and
213
195
prop = arrayElement ( ) and
214
- pred = this .getCallback ( 0 ) .getAReturn ( ) and
215
- succ = this
196
+ element = this .getCallback ( 0 ) .getAReturn ( ) and
197
+ obj = this
216
198
}
217
199
218
- /**
219
- * Holds if the property `prop` should be copied from the object `pred` to the object `succ`.
220
- */
221
200
override predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
222
201
prop = arrayElement ( ) and
223
202
pred = this .getReceiver ( ) and
@@ -233,13 +212,10 @@ private module ArrayDataFlow {
233
212
this instanceof DataFlow:: ArrayCreationNode
234
213
}
235
214
236
- /**
237
- * Holds if `pred` should be stored in the object `succ` under the property `prop`.
238
- */
239
- override predicate storeStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
215
+ override predicate storeStep ( DataFlow:: Node element , DataFlow:: Node obj , string prop ) {
240
216
prop = arrayElement ( ) and
241
- pred = this .( DataFlow:: ArrayCreationNode ) .getAnElement ( ) and
242
- succ = this
217
+ element = this .( DataFlow:: ArrayCreationNode ) .getAnElement ( ) and
218
+ obj = this
243
219
}
244
220
}
245
221
@@ -250,13 +226,10 @@ private module ArrayDataFlow {
250
226
private class ArraySpliceStep extends DataFlow:: AdditionalFlowStep , DataFlow:: MethodCallNode {
251
227
ArraySpliceStep ( ) { this .getMethodName ( ) = "splice" }
252
228
253
- /**
254
- * Holds if `pred` should be stored in the object `succ` under the property `prop`.
255
- */
256
- override predicate storeStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
229
+ override predicate storeStep ( DataFlow:: Node element , DataFlow:: Node obj , string prop ) {
257
230
prop = arrayElement ( ) and
258
- pred = getArgument ( 2 ) and
259
- succ = this .getReceiver ( ) .getALocalSource ( )
231
+ element = getArgument ( 2 ) and
232
+ obj = this .getReceiver ( ) .getALocalSource ( )
260
233
}
261
234
}
262
235
@@ -267,9 +240,6 @@ private module ArrayDataFlow {
267
240
private class ArrayConcatStep extends DataFlow:: AdditionalFlowStep , DataFlow:: MethodCallNode {
268
241
ArrayConcatStep ( ) { this .getMethodName ( ) = "concat" }
269
242
270
- /**
271
- * Holds if the property `prop` should be copied from the object `pred` to the object `succ`.
272
- */
273
243
override predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
274
244
prop = arrayElement ( ) and
275
245
( pred = this .getReceiver ( ) or pred = this .getAnArgument ( ) ) and
@@ -287,9 +257,6 @@ private module ArrayDataFlow {
287
257
this .getMethodName ( ) = "filter"
288
258
}
289
259
290
- /**
291
- * Holds if the property `prop` should be copied from the object `pred` to the object `succ`.
292
- */
293
260
override predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
294
261
prop = arrayElement ( ) and
295
262
pred = this .getReceiver ( ) and
0 commit comments