We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
split_regex_literal
1 parent df8fe06 commit f50723bCopy full SHA for f50723b
.changeset/khaki-vans-learn.md
@@ -0,0 +1,5 @@
1
+---
2
+"@biomejs/biome": patch
3
4
+
5
+Fixed #8563: fixed a bounds check on bogus regex literals that caused panics when doing type inference
crates/biome_js_type_info/src/local_inference.rs
@@ -2688,7 +2688,7 @@ fn split_regex_literal(token: SyntaxResult<JsSyntaxToken>) -> Option<RegexpLiter
2688
let literal = token.ok()?.token_text_trimmed();
2689
let open_index: usize = literal.find('/')? + 1;
2690
let close_index: usize = literal.rfind('/')?;
2691
- if open_index == close_index {
+ if open_index >= close_index {
2692
return None;
2693
}
2694
0 commit comments