File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -818,23 +818,23 @@ predicate isInterpretedAsRegExp(DataFlow::Node source) {
818818 source = DataFlow:: globalVarRef ( "RegExp" ) .getAnInvocation ( ) .getArgument ( 0 )
819819 or
820820 // The argument of a call that coerces the argument to a regular expression.
821- exists ( MethodCallExpr mce , string methodName |
821+ exists ( DataFlow :: MethodCallNode mce , string methodName |
822822 mce .getReceiver ( ) .analyze ( ) .getAType ( ) = TTString ( ) and
823823 mce .getMethodName ( ) = methodName and
824824 not exists ( Function func |
825- func = any ( DataFlow :: MethodCallNode call | call . getEnclosingExpr ( ) = mce ) .getACallee ( )
825+ func = mce .getACallee ( )
826826 |
827827 not isNativeStringMethod ( func , methodName )
828828 )
829829 |
830- methodName = "match" and source . asExpr ( ) = mce .getArgument ( 0 ) and mce .getNumArgument ( ) = 1
830+ methodName = "match" and source = mce .getArgument ( 0 ) and mce .getNumArgument ( ) = 1
831831 or
832832 methodName = "search" and
833- source . asExpr ( ) = mce .getArgument ( 0 ) and
833+ source = mce .getArgument ( 0 ) and
834834 mce .getNumArgument ( ) = 1 and
835835 // "search" is a common method name, and so we exclude chained accesses
836836 // because `String.prototype.search` returns a number
837- not exists ( PropAccess p | p .getBase ( ) = mce )
837+ not exists ( PropAccess p | p .getBase ( ) = mce . getEnclosingExpr ( ) )
838838 )
839839 )
840840}
You can’t perform that action at this time.
0 commit comments