From be66525a1cb0f031befd26e72e33c6a6b4cf3722 Mon Sep 17 00:00:00 2001 From: Sushant Nariangadu Date: Mon, 23 Mar 2026 00:25:44 +0530 Subject: [PATCH] fix(repl): Dot commands not working. This commit fixes the parsing error that shows when using `dot` commands in the REPL. It fixes this by preventing the passing of the `dot` commands to the JS parser. --- cli/src/helper.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/src/helper.rs b/cli/src/helper.rs index 8cc8893240a..a0c44584788 100644 --- a/cli/src/helper.rs +++ b/cli/src/helper.rs @@ -60,6 +60,11 @@ impl Validator for RLHelper { &self, context: &mut ValidationContext<'_>, ) -> Result { + // Dot commands are handled by the REPL loop, not the JS parser. + if context.input().trim_start().starts_with('.') { + return Ok(ValidationResult::Valid(None)); + } + let mut parser = boa_parser::Parser::new(Source::from_bytes(context.input())); if self.strict { parser.set_strict();