Skip to content

Commit 4a26c29

Browse files
committed
fix number of arguments for String.prototype.split
1 parent f586639 commit 4a26c29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/StandardLibrary.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ class StringReplaceCall extends DataFlow::MethodCallNode {
151151
* A call to `String.prototype.split`.
152152
*
153153
* We heuristically include any call to a method called `split`, provided it either
154-
* has exactly one arguments, or local data flow suggests that the receiver may be a string.
154+
* has one or two arguments, or local data flow suggests that the receiver may be a string.
155155
*/
156156
class StringSplitCall extends DataFlow::MethodCallNode {
157157
StringSplitCall() {
158158
this.getMethodName() = "split" and
159-
(getNumArgument() = 1 or getReceiver().mayHaveStringValue(_))
159+
(getNumArgument() = [1,2] or getReceiver().mayHaveStringValue(_))
160160
}
161161

162162
/**

0 commit comments

Comments
 (0)