Files
codeql/javascript/ql/test/library-tests/RegExp/MissingUnicodeFlag/MissingUnicodeFlag.ql
2020-03-02 10:48:33 +00:00

16 lines
483 B
Plaintext

import javascript
from RegExpLiteral literal, RegExpConstant wideConstant
where
wideConstant.getLiteral() = literal and
not literal.getFlags().matches("%u%") and
wideConstant.getValue().length() > 1 and
(
wideConstant.getParent() instanceof RegExpCharacterClass
or
wideConstant.getParent() instanceof RegExpCharacterRange
or
wideConstant.getParent() instanceof RegExpQuantifier
)
select literal, "Split supplementary character in non-unicode literal."