diff --git a/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.expect.md b/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.expect.md index f06d00eb65..e927c34942 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.expect.md +++ b/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.expect.md @@ -18,7 +18,7 @@ function foo(a, b, c) { }, o, } = b); - return { e, g, n, o }; + return { d, g, n, o }; } ``` @@ -29,22 +29,25 @@ function foo(a, b, c) { function foo(a, b, c) { const $ = React.unstable_useMemoCache(); + const d = a[0]; const g = a[1][0].e.f; const n = b.l.m[0][0]; const o = b.o; - const c_0 = $[0] !== g; - const c_1 = $[1] !== n; - const c_2 = $[2] !== o; + const c_0 = $[0] !== d; + const c_1 = $[1] !== g; + const c_2 = $[2] !== n; + const c_3 = $[3] !== o; let t0; - if (c_0 || c_1 || c_2) { - t0 = { e: e, g: g, n: n, o: o }; - $[0] = g; - $[1] = n; - $[2] = o; - $[3] = t0; + if (c_0 || c_1 || c_2 || c_3) { + t0 = { d: d, g: g, n: n, o: o }; + $[0] = d; + $[1] = g; + $[2] = n; + $[3] = o; + $[4] = t0; } else { - t0 = $[3]; + t0 = $[4]; } return t0; } diff --git a/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.js b/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.js index 1fc546fdd5..ebc2289107 100644 --- a/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.js +++ b/compiler/forget/src/__tests__/fixtures/hir/destructuring-assignment.js @@ -14,5 +14,5 @@ function foo(a, b, c) { }, o, } = b); - return { e, g, n, o }; + return { d, g, n, o }; }