File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,16 +181,14 @@ private module ArrayDataFlow {
181181 * A step for retrieving an element from an array using `.pop()` or `.shift()`.
182182 * E.g. `array.pop()`.
183183 */
184- private class ArrayPopStep extends DataFlow:: AdditionalFlowStep , DataFlow:: MethodCallNode {
185- ArrayPopStep ( ) {
186- getMethodName ( ) = "pop" or
187- getMethodName ( ) = "shift"
188- }
189-
184+ private class ArrayPopStep extends DataFlow:: SharedFlowStep {
190185 override predicate loadStep ( DataFlow:: Node obj , DataFlow:: Node element , string prop ) {
191- prop = arrayElement ( ) and
192- obj = this .getReceiver ( ) and
193- element = this
186+ exists ( DataFlow:: MethodCallNode call |
187+ call .getMethodName ( ) = [ "pop" , "shift" ] and
188+ prop = arrayElement ( ) and
189+ obj = call .getReceiver ( ) and
190+ element = call
191+ )
194192 }
195193 }
196194
You can’t perform that action at this time.
0 commit comments