mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
JS: Add: Test case for checking if regex via using splice
This commit is contained in:
@@ -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 |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from RegExpPatternSource regex
|
||||
select regex, "is a regular expression"
|
||||
6
javascript/ql/test/library-tests/RegExp/IsRegex/tst.js
Normal file
6
javascript/ql/test/library-tests/RegExp/IsRegex/tst.js
Normal file
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user