mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[compiler][ez] Patch for JSX escape sequences in @babel/generator
Fall back to using JSXExpressionContainer for strings potentially containing escape sequences (a single backslash) to fix https://github.com/facebook/react/issues/32123. This is an extension of https://github.com/facebook/react/pull/29079
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
+1
-1
@@ -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];
|
||||
|
||||
+11
-3
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user