Skip to content

Commit 3e3b017

Browse files
committed
Skip reference effects when meta-property is not guaranteed to be immutable
1 parent 713b81c commit 3e3b017

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

compiler/packages/babel-plugin-react-compiler/src/Inference/InferReferenceEffects.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,18 @@ function inferBlock(
12161216
};
12171217
break;
12181218
}
1219-
case "MetaProperty":
1219+
case "MetaProperty": {
1220+
if (instrValue.meta !== "import" || instrValue.property !== "meta") {
1221+
continue;
1222+
}
1223+
1224+
valueKind = {
1225+
kind: ValueKind.Global,
1226+
reason: new Set([ValueReason.Global]),
1227+
context: new Set(),
1228+
};
1229+
break;
1230+
}
12201231
case "LoadGlobal":
12211232
valueKind = {
12221233
kind: ValueKind.Global,

0 commit comments

Comments
 (0)