File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -253,14 +253,10 @@ private module ArrayDataFlow {
253
253
*/
254
254
private class ArrayCreationStep extends DataFlow:: AdditionalFlowStep , DataFlow:: ArrayCreationNode {
255
255
override predicate storeStep ( DataFlow:: Node element , DataFlow:: SourceNode obj , string prop ) {
256
- prop = arrayElement ( ) and
257
- element = this .getAnElement ( ) and
258
- obj = this
259
- or
260
256
exists ( int i |
261
257
element = this .getElement ( i ) and
262
258
obj = this and
263
- prop = i . toString ( )
259
+ prop = arrayElement ( i )
264
260
)
265
261
}
266
262
}
Original file line number Diff line number Diff line change @@ -607,6 +607,16 @@ module PseudoProperties {
607
607
*/
608
608
string arrayElement ( ) { result = pseudoProperty ( "arrayElement" ) }
609
609
610
+ /**
611
+ * Gets a pseudo-property for the location of the `i`th element in an `Array`.
612
+ */
613
+ bindingset [ i]
614
+ string arrayElement ( int i ) {
615
+ i < 5 and result = i .toString ( )
616
+ or
617
+ result = arrayElement ( )
618
+ }
619
+
610
620
/**
611
621
* Gets a pseudo-property for the location of elements in some array-like object. (Set, Array, or Iterator).
612
622
*/
You can’t perform that action at this time.
0 commit comments