Skip to content

Commit 952df7f

Browse files
committed
fix(react-compiler): implement NumericLiteral as ObjectPropertyKey (#31791)
DiffTrain build for [90b511e](90b511e)
1 parent f8c51fc commit 952df7f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

compiled/eslint-plugin-react-hooks/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -29533,6 +29533,9 @@ PERFORMANCE OF THIS SOFTWARE.
2953329533
case "computed": {
2953429534
return "[".concat(printPlace(key.name), "]");
2953529535
}
29536+
case "number": {
29537+
return String(key.name);
29538+
}
2953629539
}
2953729540
}
2953829541
function printInstructionValue(instrValue) {
@@ -35935,6 +35938,8 @@ PERFORMANCE OF THIS SOFTWARE.
3593535938
return { kind: "computed", name: place };
3593635939
} else if (key.isIdentifier()) {
3593735940
return { kind: "identifier", name: key.node.name };
35941+
} else if (key.isNumericLiteral()) {
35942+
return { kind: "identifier", name: String(key.node.value) };
3593835943
}
3593935944
builder.errors.push({
3594035945
reason: "(BuildHIR::lowerExpression) Expected Identifier, got ".concat(
@@ -54070,6 +54075,9 @@ PERFORMANCE OF THIS SOFTWARE.
5407054075
});
5407154076
return expr;
5407254077
}
54078+
case "number": {
54079+
return libExports.numericLiteral(key.name);
54080+
}
5407354081
}
5407454082
}
5407554083
function codegenArrayPattern(cx, pattern) {

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
02372952e4f24fa02dcb9b32af26cb2472617cef
1+
90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
02372952e4f24fa02dcb9b32af26cb2472617cef
1+
90b511ec7a9f2f3fd2b7f0039d8fc52c23f573a1

0 commit comments

Comments
 (0)