We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e07e6c9 commit b4e6fb7Copy full SHA for b4e6fb7
javascript/ql/src/RegExp/RegExpAlwaysMatches.ql
@@ -54,6 +54,8 @@ predicate isUniversalRegExp(RegExpTerm term) {
54
or
55
child.(RegExpCharacterClass).isUniversalClass()
56
)
57
+ or
58
+ term.(RegExpSequence).getNumChild() = 0
59
}
60
61
/**
javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js
@@ -83,10 +83,10 @@ function nonWordBoundary(x) {
83
84
85
function emptyRegex(x) {
86
- return new RegExp("").test(x); // NOT OK
+ return new RegExp("").test(x); // OK
87
88
89
function parserTest(x) {
90
/(\w\s*:\s*[^:}]+|#){|@import[^\n]+(?:url|,)/.test(x); // OK
91
- /^((?:a{0,2}|-)|\w\{\d,\d\})+X$/.text(x); // ok
92
-}
+ /^((?:a{0,2}|-)|\w\{\d,\d\})+X$/.text(x); // ok
+}
0 commit comments