-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS: Add: Test case for checking if regex via using splice
- Loading branch information
Showing
3 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
javascript/ql/test/library-tests/RegExp/IsRegex/IsRegex.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
| tst.js:1:12:1:38 | '^http: ... le.com' | is a regular expression | | ||
| tst.js:4:37:4:43 | 'regex' | is a regular expression | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import javascript | ||
|
||
from RegExpPatternSource regex | ||
select regex, "is a regular expression" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
new RegExp('^http://test\.example.com'); // NOT OK | ||
|
||
function detectRegexViaSplice(string) { | ||
let found = getMyThing().search('regex'); // NOT OK | ||
arr.splice(found, 1); | ||
}; |