diff --git a/src/editor/refactor/safeDelete.ts b/src/editor/refactor/safeDelete.ts index 81b94be0a..215af366b 100644 --- a/src/editor/refactor/safeDelete.ts +++ b/src/editor/refactor/safeDelete.ts @@ -365,7 +365,8 @@ export function textOccurrences( const out: { from: number; to: number }[] = []; for (let m = re.exec(text); m; m = re.exec(text)) { const from = m.index; - if (/[\p{L}\p{N}_$]$/u.test(text.slice(Math.max(0, from - 2), from))) continue; + // Not `[\p{L}\p{N}_$]$`: V8 (Node 26) misses an astral letter with a lone class before `$`. + if (/(?:\p{L}|\p{N}|[_$])$/u.test(text.slice(Math.max(0, from - 2), from))) continue; if (ids.has(from) || (from >= exclude.from && from < exclude.to)) continue; out.push({ from, to: from + name.length }); } diff --git a/src/features/debugger/editor/smartStep.ts b/src/features/debugger/editor/smartStep.ts index c5617ab41..6740d2ffb 100644 --- a/src/features/debugger/editor/smartStep.ts +++ b/src/features/debugger/editor/smartStep.ts @@ -29,7 +29,8 @@ function callPattern(name: string, flags: string): RegExp { } function isCallBoundary(text: string, from: number): boolean { - return !/[\p{L}\p{N}_$]$/u.test(text.slice(Math.max(0, from - 2), from)); + // Not `[\p{L}\p{N}_$]$`: V8 (Node 26) misses an astral letter with a lone class before `$`. + return !/(?:\p{L}|\p{N}|[_$])$/u.test(text.slice(Math.max(0, from - 2), from)); } function identifierEnd(text: string, from: number): number {