From 952df7fd1d4627007d757e5b862eec4166efd1b1 Mon Sep 17 00:00:00 2001 From: mofeiZ Date: Mon, 17 Mar 2025 16:37:52 -0700 Subject: [PATCH] fix(react-compiler): implement NumericLiteral as ObjectPropertyKey (#31791) DiffTrain build for [90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1](https://github.com/facebook/react/commit/90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1) --- compiled/eslint-plugin-react-hooks/index.js | 8 ++++++++ compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/compiled/eslint-plugin-react-hooks/index.js b/compiled/eslint-plugin-react-hooks/index.js index 1802cfa501..c237a91b05 100644 --- a/compiled/eslint-plugin-react-hooks/index.js +++ b/compiled/eslint-plugin-react-hooks/index.js @@ -29533,6 +29533,9 @@ PERFORMANCE OF THIS SOFTWARE. case "computed": { return "[".concat(printPlace(key.name), "]"); } + case "number": { + return String(key.name); + } } } function printInstructionValue(instrValue) { @@ -35935,6 +35938,8 @@ PERFORMANCE OF THIS SOFTWARE. return { kind: "computed", name: place }; } else if (key.isIdentifier()) { return { kind: "identifier", name: key.node.name }; + } else if (key.isNumericLiteral()) { + return { kind: "identifier", name: String(key.node.value) }; } builder.errors.push({ reason: "(BuildHIR::lowerExpression) Expected Identifier, got ".concat( @@ -54070,6 +54075,9 @@ PERFORMANCE OF THIS SOFTWARE. }); return expr; } + case "number": { + return libExports.numericLiteral(key.name); + } } } function codegenArrayPattern(cx, pattern) { diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index d2d9d1d4b5..747d29a238 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -02372952e4f24fa02dcb9b32af26cb2472617cef +90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index d2d9d1d4b5..747d29a238 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -02372952e4f24fa02dcb9b32af26cb2472617cef +90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1