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();