Skip to content

Commit be66525

Browse files
committed
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.
1 parent 0592ecc commit be66525

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/src/helper.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ impl Validator for RLHelper {
6060
&self,
6161
context: &mut ValidationContext<'_>,
6262
) -> Result<ValidationResult, ReadlineError> {
63+
// Dot commands are handled by the REPL loop, not the JS parser.
64+
if context.input().trim_start().starts_with('.') {
65+
return Ok(ValidationResult::Valid(None));
66+
}
67+
6368
let mut parser = boa_parser::Parser::new(Source::from_bytes(context.input()));
6469
if self.strict {
6570
parser.set_strict();

0 commit comments

Comments
 (0)