diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts index 521bd95287..42f3838df0 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts @@ -34,6 +34,7 @@ import { JsxAttribute, ObjectPattern, ObjectProperty, + ObjectPropertyKey, Place, ReturnTerminal, SourceLocation, @@ -1159,7 +1160,7 @@ function lowerStatement( function lowerObjectPropertyKey( builder: HIRBuilder, key: t.PrivateName | t.Expression -): { name: string; type: "string" | "identifier" } | null { +): ObjectPropertyKey | null { if (key.type === "Identifier") { return { name: key.name, @@ -1245,6 +1246,7 @@ function lowerExpression( const value = lowerExpressionToTemporary(builder, valuePath); properties.push({ kind: "ObjectProperty", + type: "property", place: value, key: loweredKey, }); @@ -3123,6 +3125,7 @@ function lowerAssignment( } properties.push({ kind: "ObjectProperty", + type: "property", place: identifier, key: loweredKey, }); @@ -3133,6 +3136,7 @@ function lowerAssignment( ); properties.push({ kind: "ObjectProperty", + type: "property", place: { ...temp }, key: loweredKey, }); diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts index f34a88b905..2a203c9ba2 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts @@ -554,6 +554,7 @@ export type ObjectPropertyKey = { export type ObjectProperty = { kind: "ObjectProperty"; key: ObjectPropertyKey; + type: "property" | "method"; place: Place; };