Skip to content

Commit 52330e8

Browse files
committed
JS: Add: Test case for checking if regex via using splice
1 parent 84234d5 commit 52330e8

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| tst.js:1:12:1:38 | '^http: ... le.com' | is a regular expression |
2+
| tst.js:4:37:4:43 | 'regex' | is a regular expression |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import javascript
2+
3+
from RegExpPatternSource regex
4+
select regex, "is a regular expression"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
new RegExp('^http://test\.example.com'); // NOT OK
2+
3+
function detectRegexViaSplice(string) {
4+
let found = getMyThing().search('regex'); // NOT OK
5+
arr.splice(found, 1);
6+
};

0 commit comments

Comments
 (0)