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 {
253253 */
254254 private class ArrayCreationStep extends DataFlow:: AdditionalFlowStep , DataFlow:: ArrayCreationNode {
255255 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
260256 exists ( int i |
261257 element = this .getElement ( i ) and
262258 obj = this and
263- prop = i . toString ( )
259+ prop = arrayElement ( i )
264260 )
265261 }
266262 }
Original file line number Diff line number Diff line change @@ -607,6 +607,16 @@ module PseudoProperties {
607607 */
608608 string arrayElement ( ) { result = pseudoProperty ( "arrayElement" ) }
609609
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+
610620 /**
611621 * Gets a pseudo-property for the location of elements in some array-like object. (Set, Array, or Iterator).
612622 */
You can’t perform that action at this time.
0 commit comments