-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(es/ast): Reapply #10987 #11066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(es/ast): Reapply #10987 #11066
Conversation
This reverts commit d2baf6a.
🦋 Changeset detectedLatest commit: 8389b8d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @kdy1's task —— View job PR Review: feat(es/ast): Reapply #10987This PR reintroduces Unicode lone surrogate handling that was previously implemented. Here's my comprehensive code review: Review Summary✅ Code Quality & Best Practices
✅ Unicode Implementation Details
✅ Security Considerations
✅ Performance Considerations
✅ Test Coverage
Technical Deep DiveCore Implementation ( /// The string value contains lone surrogates.
///
/// `value` is encoded with `\u{FFFD}` to mark the lone surrogate as an
/// escaped value.
///
/// For example, a "\uD808" is a lone surrogate, and it's encoded as
/// `\u{FFFD}D808`.
pub lone_surrogates: bool,Lexer Integration ( pub enum UnicodeEscape {
CodePoint(char),
SurrogatePair(char),
LoneSurrogate(u32), // ← Handles invalid Unicode sequences
}Codegen Restoration ( '\u{FFFD}' if lone_surrogates => {
// Restore 4 hex characters from escaped lone surrogate
let hex1 = iter.next().unwrap();
let hex2 = iter.next().unwrap();
let hex3 = iter.next().unwrap();
let hex4 = iter.next().unwrap();
buf.extend(['\\', 'u', hex1, hex2, hex3, hex4]);
}Minor ObservationsPotential Improvements:
No Critical Issues Found:
Final Recommendation✅ APPROVED - This PR implements a robust solution for Unicode lone surrogate handling with:
The reapplication appears complete and well-executed. The Unicode handling follows ECMAScript standards and provides proper fallback mechanisms for invalid sequences. |
CodSpeed Performance ReportMerging #11066 will not alter performanceComparing Summary
Footnotes |
No description provided.