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 @@ -279,17 +279,14 @@ private module ArrayDataFlow {
279279 /**
280280 * A step for modelling that elements from an array `arr` also appear in the result from calling `slice`/`splice`/`filter`.
281281 */
282- private class ArraySliceStep extends DataFlow:: AdditionalFlowStep , DataFlow:: MethodCallNode {
283- ArraySliceStep ( ) {
284- this .getMethodName ( ) = "slice" or
285- this .getMethodName ( ) = "splice" or
286- this .getMethodName ( ) = "filter"
287- }
288-
282+ private class ArraySliceStep extends DataFlow:: SharedFlowStep {
289283 override predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
290- prop = arrayElement ( ) and
291- pred = this .getReceiver ( ) and
292- succ = this
284+ exists ( DataFlow:: MethodCallNode call |
285+ call .getMethodName ( ) = [ "slice" , "splice" , "filter" ] and
286+ prop = arrayElement ( ) and
287+ pred = call .getReceiver ( ) and
288+ succ = call
289+ )
293290 }
294291 }
295292
You can’t perform that action at this time.
0 commit comments