Skip to content

Commit

Permalink
[compiler][ez] Patch for JSX escape sequences in @babel/generator (#3…
Browse files Browse the repository at this point in the history
…2131)

Fall back to using JSXExpressionContainer for strings potentially
containing escape sequences (a single backslash) to fix
#32123. This is an extension of
#29079
  • Loading branch information
mofeiZ authored Jan 22, 2025
1 parent 1955744 commit 7c864c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ function codegenInstructionValue(
* https://en.wikipedia.org/wiki/List_of_Unicode_characters#Control_codes
*/
const STRING_REQUIRES_EXPR_CONTAINER_PATTERN =
/[\u{0000}-\u{001F}\u{007F}\u{0080}-\u{FFFF}]|"/u;
/[\u{0000}-\u{001F}\u{007F}\u{0080}-\u{FFFF}]|"|\\/u;
function codegenJsxAttribute(
cx: Context,
attribute: JsxAttribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function MyApp() {
const $ = _c(1);
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t0 = <input pattern="\\w" />;
t0 = <input pattern={"\\w"} />;
$[0] = t0;
} else {
t0 = $[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ function V0(t0) {
<ComponentC cd="TxqUy" ce="oh`]uc" cf="Bdbo" c10={!V9.va && v11.v12}>
gmhubcw
{v1 === V3.V13 ? (
<c14 c15="L^]w\\\\T\\\\qrGmqrlQyrvBgf\\\\inuRdkEqwVPwixiriYGSZmKJf]E]RdT{N[WyVPiEJIbdFzvDohJV[BV`H[[K^xoy[HOGKDqVzUJ^h">
<c14
c15={
"L^]w\\\\T\\\\qrGmqrlQyrvBgf\\\\inuRdkEqwVPwixiriYGSZmKJf]E]RdT{N[WyVPiEJIbdFzvDohJV[BV`H[[K^xoy[HOGKDqVzUJ^h"
}
>
iawyneijcgamsfgrrjyvhjrrqvzexxwenxqoknnilmfloafyvnvkqbssqnxnexqvtcpvjysaiovjxyqrorqskfph
</c14>
) : v16.v17("pyorztRC]EJzVuP^e") ? (
<c14 c15="CRinMqvmOknWRAKERI]RBzB_LXGKQe{SUpoN[\\\\gL[`bLMOhvFqDVVMNOdY">
<c14
c15={
"CRinMqvmOknWRAKERI]RBzB_LXGKQe{SUpoN[\\\\gL[`bLMOhvFqDVVMNOdY"
}
>
goprinbjmmjhfserfuqyluxcewpyjihektogc
</c14>
) : (
<c14 c15="H\\\\\\\\GAcTc\\\\lfGMW[yHriCpvW`w]niSIKj\\\\kdgFI">
<c14 c15={"H\\\\\\\\GAcTc\\\\lfGMW[yHriCpvW`w]niSIKj\\\\kdgFI"}>
yejarlvudihqdrdgpvahovggdnmgnueedxpbwbkdvvkdhqwrtoiual
</c14>
)}
Expand Down

0 comments on commit 7c864c9

Please sign in to comment.