Skip to content

Commit 36f8e89

Browse files
authored
Recover numeric warning errors in AST single mode (#9303)
Match ordinary single compilation by allowing later numeric warnings raised as errors to take precedence after a parser-origin escape warning. Preserve tokenizer-origin guards and the separate prompt path. Assisted-by: Codex:unknown
1 parent 6c171ff commit 36f8e89

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎crates/vm/src/vm/compile.rs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,8 +1983,15 @@ mod escape_warnings {
19831983
module.map(AsObject::as_object),
19841984
collected.warnings,
19851985
WarningEmission::Ast {
1986+
// Unlike an interactive prompt, Single compile input recovers
1987+
// after a parser warning becomes an error. Later numeric
1988+
// tokenizer warnings raised as errors still take precedence,
1989+
// including on a following logical line.
19861990
tokenizer_recovery: collected.tokenizer_recovery
1987-
&& matches!(start, CompileStart::File | CompileStart::Eval),
1991+
&& matches!(
1992+
start,
1993+
CompileStart::File | CompileStart::Eval | CompileStart::Single
1994+
),
19881995
},
19891996
)
19901997
}

0 commit comments

Comments
 (0)