mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
dc09a3aa9d
## Summary Fix a parser panic when a string-named export decodes to a literal `\u` sequence. Lone-surrogate validation now uses the metadata captured by the lexer instead of rescanning decoded string contents. This also prevents false diagnostics for names such as `"\\uD800"`. ## Before: ``` thread 'main' (10990283) panicked at crates/oxc_ast/src/ast_impl/literal.rs:89:42: end byte index 4 is out of bounds for string of length 0 stack backtrace: 0: __rustc::rust_begin_unwind 1: core::panicking::panic_fmt 2: core::str::slice_error_fail_rt 3: core::str::slice_error_fail 4: <core::ops::range::RangeTo<usize> as core::slice::index::SliceIndex<str>>::index 5: <str as core::ops::index::Index<core::ops::range::RangeTo<usize>>>::index 6: <oxc_ast::ast::literal::StringLiteral>::is_string_well_formed_unicode 7: <oxc_parser::ParserImpl<oxc_parser::config::NoTokensParserConfig>>::parse_module_export_name ```
4 lines
88 B
Plaintext
4 lines
88 B
Plaintext
codegen_misc Summary:
|
|
AST Parsed : 80/80 (100.00%)
|
|
Positive Passed: 80/80 (100.00%)
|