From 3a8e26e45284c15eb0dba4382d497877f548c988 Mon Sep 17 00:00:00 2001 From: "codefix-patchflow[bot]" <292349666+codefix-patchflow[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 11:18:51 +0000 Subject: [PATCH] fix: shared default lexer state by cloning effective options during lexer construction --- src/Lexer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lexer.ts b/src/Lexer.ts index 84560a1b6c..3275aecdf7 100644 --- a/src/Lexer.ts +++ b/src/Lexer.ts @@ -24,7 +24,7 @@ export class _Lexer { // TokenList cannot be created in one go this.tokens = [] as unknown as TokensList; this.tokens.links = Object.create(null); - this.options = options || _defaults; + this.options = { ..._defaults, ...options }; this.options.tokenizer = this.options.tokenizer || new _Tokenizer(); this.tokenizer = this.options.tokenizer; this.tokenizer.options = this.options;