fix(core): Build the user regex engine lazily on reset

resetUserRegexEngine rebuilt the default engine eagerly, while every
other reset path in this module builds lazily on next use. Shutdown
paid for a second, immediately-unused engine instance every time.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Emilia 2026-10-06 09:45:52 +01:00
parent 2ba593d815
commit a1ff61a8ba
No known key found for this signature in database
GPG Key ID: 837988349B71DD1A

View File

@ -212,7 +212,7 @@ export function setUserRegexEngine(regexEngine: RegexEngine): void {
}
export function resetUserRegexEngine(): void {
userEngine = createDefaultEngine();
userEngine = undefined;
}
function getUserEngine(): RegexEngine {