fix(react-compiler): implement NumericLiteral as ObjectPropertyKey (#31791)

DiffTrain build for [90b511ec7a](https://github.com/facebook/react/commit/90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1)
This commit is contained in:
mofeiZ
2025-03-17 16:37:52 -07:00
parent f8c51fc6a3
commit 952df7fd1d
3 changed files with 10 additions and 2 deletions
@@ -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) {
+1 -1
View File
@@ -1 +1 @@
02372952e4f24fa02dcb9b32af26cb2472617cef
90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1
+1 -1
View File
@@ -1 +1 @@
02372952e4f24fa02dcb9b32af26cb2472617cef
90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1