mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix: False Positive "Range out of order in character class" in Regular Expressions in Unicode Modes (#58982)
This commit is contained in:
@@ -1640,7 +1640,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean
|
||||
const nextStart = pos;
|
||||
let nextPos = pos + 2;
|
||||
for (; nextPos < nextStart + 6; nextPos++) {
|
||||
if (!isHexDigit(charCodeUnchecked(pos))) {
|
||||
if (!isHexDigit(charCodeUnchecked(nextPos))) {
|
||||
// leave the error to the next call
|
||||
return escapedValueString;
|
||||
}
|
||||
@@ -3552,7 +3552,7 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean
|
||||
}
|
||||
|
||||
function scanSourceCharacter(): string {
|
||||
const size = anyUnicodeMode ? charSize(charCodeChecked(pos)) : 1;
|
||||
const size = anyUnicodeMode ? charSize(codePointChecked(pos)) : 1;
|
||||
pos += size;
|
||||
return size > 0 ? text.substring(pos - size, pos) : "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user