Files
codeql/javascript/ql/test/library-tests/RegExp/MissingUnicodeFlag/MissingUnicodeFlag.ql

15 lines
481 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."