mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Fix FP from word boundaries
This commit is contained in:
@@ -73,3 +73,11 @@ function searchPrefix(x) {
|
||||
function searchSuffix(x) {
|
||||
return /foo?$/.search(x); // OK - `foo?` affects the returned index
|
||||
}
|
||||
|
||||
function wordBoundary(x) {
|
||||
return /\b/.test(x); // OK - some strings don't have word boundaries
|
||||
}
|
||||
|
||||
function nonWordBoundary(x) {
|
||||
return /\B/.test(x); // OK - some strings don't have non-word boundaries
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user