mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[hir] Try to resolve a dep into a property load only if it's a temporary.
This commit is contained in:
@@ -110,8 +110,12 @@ class Context {
|
||||
} else {
|
||||
// Otherwise if this operand is a temporary created for a property load, resolve it to
|
||||
// the expanded Place. Fall back to using the operand as-is.
|
||||
maybeDependency =
|
||||
this.#properties.get(dependency.place.identifier) ?? dependency;
|
||||
let propDep = this.#properties.get(dependency.place.identifier);
|
||||
if (dependency.place.identifier.name === null && propDep !== undefined) {
|
||||
maybeDependency = propDep;
|
||||
} else {
|
||||
maybeDependency = dependency;
|
||||
}
|
||||
}
|
||||
|
||||
const decl = this.#declarations.get(maybeDependency.place.identifier);
|
||||
|
||||
+2
-2
@@ -16,11 +16,11 @@ function component(t) {
|
||||
function component(t) {
|
||||
const $ = React.useMemoCache();
|
||||
const a = t.a;
|
||||
const c_0 = $[0] !== t6.a;
|
||||
const c_0 = $[0] !== a;
|
||||
let y;
|
||||
if (c_0) {
|
||||
y = { a: a };
|
||||
$[0] = t6.a;
|
||||
$[0] = a;
|
||||
$[1] = y;
|
||||
} else {
|
||||
y = $[1];
|
||||
Reference in New Issue
Block a user