You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Read a `\u{000...}` escape sequence and return the code point value.
561
+
/// This expects the current char to be the `{`.
562
+
///
563
+
/// This is intended for use in string literal escapes.
564
+
///
565
+
/// This doesn't return `char` intentionally. JS strings allow surrogate code points in unicode escapes, which are not valid unicode scalar values and would cause `char::from_u32` to return None.
"out of bounds codepoint for unicode codepoint escape sequence",
@@ -626,6 +618,25 @@ impl<'src> JsLexer<'src> {
626
618
}
627
619
}
628
620
621
+
// Read a `\u{000...}` escape sequence and convert it to a valid Unicode scalar value.
622
+
// This expects the current char to be the `{`.
623
+
//
624
+
// This is intended for use in identifier escapes, so it will not attempt to match surrogate pairs, since those are not valid characters in JS identifiers.
0 commit comments