File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,9 +360,9 @@ module LodashUnderscore {
360360 /**
361361 * A data flow step propagating an exception thrown from a callback to a Lodash/Underscore function.
362362 */
363- private class ExceptionStep extends DataFlow:: CallNode , DataFlow :: AdditionalFlowStep {
364- ExceptionStep ( ) {
365- exists ( string name | this = member ( name ) . getACall ( ) |
363+ private class ExceptionStep extends DataFlow:: SharedFlowStep {
364+ override predicate step ( DataFlow :: Node pred , DataFlow :: Node succ ) {
365+ exists ( DataFlow :: CallNode call , string name |
366366 // Members ending with By, With, or While indicate that they are a variant of
367367 // another function that takes a callback.
368368 name .matches ( "%By" ) or
@@ -386,13 +386,12 @@ module LodashUnderscore {
386386 name = "replace" or
387387 name = "some" or
388388 name = "transform"
389+ |
390+ call = member ( name ) .getACall ( ) and
391+ pred = call .getAnArgument ( ) .( DataFlow:: FunctionNode ) .getExceptionalReturn ( ) and
392+ succ = call .getExceptionalReturn ( )
389393 )
390394 }
391-
392- override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
393- pred = getAnArgument ( ) .( DataFlow:: FunctionNode ) .getExceptionalReturn ( ) and
394- succ = this .getExceptionalReturn ( )
395- }
396395 }
397396
398397 /**
You can’t perform that action at this time.
0 commit comments