@samitouri / QOS-React-2 / commits / 64b4605cb8

[compiler] fix source location for return statements (#35660)

Fixes missing source locations for ReturnStatement nodes in generated ast. Simple change using existing pattern, only required changes to the codegen step, no other pipeline changes. **Most file changes are new lines in generated code.** [First commit](https://github.com/facebook/react/commit/d15e90ebe09250afc111f27109f4e698ea0d4361) has the relevant changes, second commit has the noisy snap updates. I added an exception to the validator to not report an error when a return statement will be optimized to an implicit return by codegen, as there's no separate return statement to instrument anyways in the final ast. An edge case when it comes to preserving source locations for instrumentation that is likely not as common for most babel transforms since they are not doing optimizations.

Nathan committed Jan 30, 2026 at 11:37 UTC 64b4605cb82367fa78a08b99bbee1c800e6af21a
229 files changed +250 -41
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
+3 -2
@@ -1160,9 +1160,9 @@ function codegenTerminal(
1160 const value = codegenPlaceToExpression(cx, terminal.value);
1161 if (value.type === 'Identifier' && value.name === 'undefined') {
1162 // Use implicit undefined
1163 - return t.returnStatement();
1163 + return createReturnStatement(terminal.loc);
1164 }
1165 - return t.returnStatement(value);
1165 + return createReturnStatement(terminal.loc, value);
1166 }
1167 case 'switch': {
1168 return createSwitchStatement(
@@ -1545,6 +1545,7 @@ const createThrowStatement = withLoc(t.throwStatement);
1545 const createTryStatement = withLoc(t.tryStatement);
1546 const createBreakStatement = withLoc(t.breakStatement);
1547 const createContinueStatement = withLoc(t.continueStatement);
1548 +const createReturnStatement = withLoc(t.returnStatement);
1549
1550 function createVariableDeclarator(
1551 id: t.LVal,
compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateSourceLocations.ts
+17
@@ -149,6 +149,23 @@ export function validateSourceLocations(
149 return;
150 }
151
152 + /*
153 + * Skip return statements inside arrow functions that will be simplified to expression body.
154 + * The compiler transforms `() => { return expr }` to `() => expr` in CodegenReactiveFunction
155 + */
156 + if (t.isReturnStatement(node) && node.argument != null) {
157 + const parentBody = path.parentPath;
158 + const parentFunc = parentBody?.parentPath;
159 + if (
160 + parentBody?.isBlockStatement() &&
161 + parentFunc?.isArrowFunctionExpression() &&
162 + parentBody.node.body.length === 1 &&
163 + parentBody.node.directives.length === 0
164 + ) {
165 + return;
166 + }
167 + }
168 +
169 // Collect the location if it exists
170 if (node.loc) {
171 const key = locationKey(node.loc);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/alias-while.expect.md
+1
@@ -46,6 +46,7 @@ function foo(cond) {
46 } else {
47 a = $[1];
48 }
49 +
50 return a;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-nested-block-structure.expect.md
+1
@@ -145,6 +145,7 @@ function useFoo(t0) {
145 if (t1 !== Symbol.for("react.early_return_sentinel")) {
146 return t1;
147 }
148 +
149 return s;
150 }
151
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-reactive-scope-overlaps-if.expect.md
+1
@@ -61,6 +61,7 @@ function useFoo(t0) {
61 } else {
62 items = $[2];
63 }
64 +
65 return items;
66 }
67
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-trycatch-nested-overlapping-range.expect.md
+1
@@ -47,6 +47,7 @@ function Foo() {
47 } else {
48 thing = $[0];
49 }
50 +
51 return thing;
52 } catch {}
53 }
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md
+1
@@ -33,6 +33,7 @@ function Component(props) {
33 } else {
34 x = $[1];
35 }
36 +
37 return x;
38 }
39
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/arrow-function-one-line-directive.expect.md
+1
@@ -23,6 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ```javascript
24 function useFoo() {
25 const update = _temp;
26 +
27 return update;
28 }
29 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/assignment-in-nested-if.expect.md
+1
@@ -36,6 +36,7 @@ function useBar(props) {
36 z = t0;
37 }
38 }
39 +
40 return z;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/block-scoping-switch-variable-scoping.expect.md
+1
@@ -53,6 +53,7 @@ function Component(props) {
53 default:
54 }
55 const outerHandlers = handlers;
56 +
57 return outerHandlers;
58 }
59
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/bug-type-inference-control-flow.expect.md
+1
@@ -98,6 +98,7 @@ function useFoo(t0) {
98 }
99 result = t1;
100 }
101 +
102 return result;
103 }
104
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias-iife.expect.md
+1
@@ -40,6 +40,7 @@ function component(a) {
40 } else {
41 x = $[1];
42 }
43 +
44 return x;
45 }
46
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture-indirect-mutate-alias.expect.md
+1
@@ -48,6 +48,7 @@ function component(a) {
48 } else {
49 x = $[1];
50 }
51 +
52 return x;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capture_mutate-across-fns-iife.expect.md
+1
@@ -37,6 +37,7 @@ function component(a) {
37 } else {
38 z = $[1];
39 }
40 +
41 return z;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-arrow-function-1.expect.md
+1
@@ -36,6 +36,7 @@ function component(a) {
36 t0 = $[1];
37 }
38 const x = t0;
39 +
40 return x;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-mutate-3.expect.md
+1
@@ -35,6 +35,7 @@ function component(a, b) {
35 t0 = $[1];
36 }
37 const z = t0;
38 +
39 return z;
40 }
41
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-1.expect.md
+1
@@ -36,6 +36,7 @@ function component(a) {
36 t0 = $[1];
37 }
38 const x = t0;
39 +
40 return x;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2-iife.expect.md
+1
@@ -45,6 +45,7 @@ function bar(a) {
45 } else {
46 y = $[3];
47 }
48 +
49 return y;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-2.expect.md
+1
@@ -41,6 +41,7 @@ function bar(a) {
41 } else {
42 y = $[1];
43 }
44 +
45 return y;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3-iife.expect.md
+1
@@ -53,6 +53,7 @@ function bar(a, b) {
53 } else {
54 y = $[5];
55 }
56 +
57 return y;
58 }
59
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-3.expect.md
+1
@@ -48,6 +48,7 @@ function bar(a, b) {
48 } else {
49 y = $[2];
50 }
51 +
52 return y;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4-iife.expect.md
+1
@@ -45,6 +45,7 @@ function bar(a) {
45 } else {
46 y = $[3];
47 }
48 +
49 return y;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-4.expect.md
+1
@@ -41,6 +41,7 @@ function bar(a) {
41 } else {
42 y = $[1];
43 }
44 +
45 return y;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load-iife.expect.md
+1
@@ -44,6 +44,7 @@ function bar(a) {
44 } else {
45 y = $[3];
46 }
47 +
48 return y;
49 }
50
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-alias-computed-load.expect.md
+1
@@ -41,6 +41,7 @@ function bar(a) {
41 } else {
42 y = $[1];
43 }
44 +
45 return y;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-capture-ref-before-rename.expect.md
+1
@@ -72,6 +72,7 @@ function Component(t0) {
72 t2 = $[6];
73 }
74 y = t2;
75 +
76 return y;
77 }
78
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-conditional-capture-mutate.expect.md
+1
@@ -48,6 +48,7 @@ function useHook(a, b) {
48 t1 = $[4];
49 }
50 const x = t1;
51 +
52 return x;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-member-expr-arguments.expect.md
+1
@@ -32,6 +32,7 @@ function Foo(props) {
32 t0 = $[1];
33 }
34 const onFoo = t0;
35 +
36 return onFoo;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-renamed-ref.expect.md
+1
@@ -50,6 +50,7 @@ function useHook(t0) {
50 const z_0 = { b };
51
52 mutate(z_0);
53 +
54 return z;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-function-within-block.expect.md
+1
@@ -48,6 +48,7 @@ function component(a) {
48 t1 = $[3];
49 }
50 x = t1;
51 +
52 return x;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-member-expr.expect.md
+1
@@ -44,6 +44,7 @@ function component(a) {
44 t1 = $[3];
45 }
46 const x = t1;
47 +
48 return x;
49 }
50
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-call.expect.md
+1
@@ -33,6 +33,7 @@ function component(a) {
33 t0 = $[1];
34 }
35 const z = t0;
36 +
37 return z;
38 }
39
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr-in-nested-func.expect.md
+1
@@ -48,6 +48,7 @@ function component(a) {
48 t1 = $[3];
49 }
50 const x = t1;
51 +
52 return x;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-nested-member-expr.expect.md
+1
@@ -44,6 +44,7 @@ function component(a) {
44 t1 = $[3];
45 }
46 const x = t1;
47 +
48 return x;
49 }
50
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-block.expect.md
+1
@@ -38,6 +38,7 @@ function component(a) {
38 t0 = $[1];
39 }
40 const x = t0;
41 +
42 return x;
43 }
44
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-variable-in-nested-function.expect.md
+1
@@ -40,6 +40,7 @@ function component(a) {
40 t0 = $[1];
41 }
42 const x = t0;
43 +
44 return x;
45 }
46
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/change-detect-reassign.expect.md
+1
@@ -41,6 +41,7 @@ function Component(props) {
41 }
42 }
43 }
44 +
45 return x;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/complex-while.expect.md
+1
@@ -32,6 +32,7 @@ function foo(a, b, c) {
32 }
33 }
34 }
35 +
36 return c;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/conditional-set-state-in-render.expect.md
+1
@@ -39,6 +39,7 @@ function Component(props) {
39 setX(2);
40 foo();
41 }
42 +
43 return x;
44 }
45
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-prop-across-objectmethod-def.expect.md
+1
@@ -37,6 +37,7 @@ function Component() {
37 const obj = { method() {} };
38
39 identity(obj);
40 +
41 return 4;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-prop-colliding-identifier.expect.md
+1
@@ -30,6 +30,7 @@ function Component() {
30 const fn = _temp;
31
32 invoke(fn);
33 +
34 return 3;
35 }
36 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-for.expect.md
+1
@@ -26,6 +26,7 @@ function foo() {
26 for (const x = 100; false; 100) {
27 y = y + 1;
28 }
29 +
30 return y;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-phi.expect.md
+1
@@ -30,6 +30,7 @@ export const FIXTURE_ENTRYPOINT = {
30 function foo(a, b, c) {
31 if (a) {
32 }
33 +
34 return b;
35 }
36
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-while.expect.md
+1
@@ -27,6 +27,7 @@ function foo() {
27 while (false) {
28 y = y + 1;
29 }
30 +
31 return y;
32 }
33
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation.expect.md
+1
@@ -34,6 +34,7 @@ export const FIXTURE_ENTRYPOINT = {
34 ```javascript
35 function foo() {
36 console.log("foo");
37 +
38 return -6;
39 }
40
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dce-loop.expect.md
+1
@@ -28,6 +28,7 @@ function foo(props) {
28 while (y < props.max) {
29 y++;
30 }
31 +
32 return y;
33 }
34
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/declare-reassign-variable-in-closure.expect.md
+1
@@ -37,6 +37,7 @@ function Component(p) {
37 } else {
38 x = $[0];
39 }
40 +
41 return x;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies-outputs.expect.md
+1
@@ -56,6 +56,7 @@ function foo(a, b) {
56 } else {
57 y = $[4];
58 }
59 +
60 return y;
61 }
62
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dependencies.expect.md
+1
@@ -50,6 +50,7 @@ function foo(x, y, z) {
50 if (y) {
51 items.push(x);
52 }
53 +
54 return items2;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-assignment-array-default.expect.md
+1
@@ -41,6 +41,7 @@ function Component(props) {
41 } else {
42 x = props.fallback;
43 }
44 +
45 return x;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-continue.expect.md
+1
@@ -46,6 +46,7 @@ function Component() {
46 } else {
47 ret = $[0];
48 }
49 +
50 return ret;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-early-unconditional-break.expect.md
+1
@@ -28,6 +28,7 @@ function Component(props) {
28 } else {
29 x = $[0];
30 }
31 +
32 return x;
33 }
34
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/dominator.expect.md
+1
@@ -75,6 +75,7 @@ function Component(props) {
75 if (props.d) {
76 return null;
77 }
78 +
79 return x;
80 }
81
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/drop-methodcall-usememo.expect.md
+1
@@ -38,6 +38,7 @@ function Component(props) {
38 x = $[1];
39 }
40 const x_0 = x;
41 +
42 return x_0;
43 }
44
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-missing-source-locations.expect.md
+1 -39
@@ -52,7 +52,7 @@ function Component({prop1, prop2}) {
52 ## Error
53
54 ```
55 -Found 25 errors:
55 +Found 22 errors:
56
57 Todo: Important source location missing in generated code
58
@@ -302,19 +302,6 @@ error.todo-missing-source-locations.ts:32:14
302
303 Todo: Important source location missing in generated code
304
305 -Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
306 -
307 -error.todo-missing-source-locations.ts:33:4
308 - 31 |
309 - 32 | const foo = useCallback(() => {
310 -> 33 | return a + b;
311 - | ^^^^^^^^^^^^^
312 - 34 | }, [a, b]);
313 - 35 |
314 - 36 | function bar() {
315 -
316 -Todo: Important source location missing in generated code
317 -
305 Source location for Identifier is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
306
307 error.todo-missing-source-locations.ts:34:6
@@ -341,19 +328,6 @@ error.todo-missing-source-locations.ts:34:9
328
329 Todo: Important source location missing in generated code
330
344 -Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
345 -
346 -error.todo-missing-source-locations.ts:37:4
347 - 35 |
348 - 36 | function bar() {
349 -> 37 | return (c + d) * 2;
350 - | ^^^^^^^^^^^^^^^^^^^
351 - 38 | }
352 - 39 |
353 - 40 | console.log('Hello, world!');
354 -
355 -Todo: Important source location missing in generated code
356 -
331 Source location for ExpressionStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
332
333 error.todo-missing-source-locations.ts:40:2
@@ -377,18 +351,6 @@ error.todo-missing-source-locations.ts:40:10
351 41 |
352 42 | return [y, foo, bar];
353 43 | }
380 -
381 -Todo: Important source location missing in generated code
382 -
383 -Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
384 -
385 -error.todo-missing-source-locations.ts:42:2
386 - 40 | console.log('Hello, world!');
387 - 41 |
388 -> 42 | return [y, foo, bar];
389 - | ^^^^^^^^^^^^^^^^^^^^^
390 - 43 | }
391 - 44 |
354 ```
355
356
\ No newline at end of file
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-jsx-child.expect.md
+1
@@ -61,6 +61,7 @@ function foo(a, b, c) {
61 } else {
62 x = $[3];
63 }
64 +
65 return x;
66 }
67
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-logical.expect.md
+1
@@ -52,6 +52,7 @@ function Component(props) {
52 t2 = $[5];
53 }
54 const c = t2;
55 +
56 return (a && b) || c;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-dependency.expect.md
+1
@@ -53,6 +53,7 @@ function Component(props) {
53 } else {
54 b = $[4];
55 }
56 +
57 return b;
58 }
59
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-allocating-nested-dependency.expect.md
+1
@@ -63,6 +63,7 @@ function Component(props) {
63 } else {
64 c = $[4];
65 }
66 +
67 return c;
68 }
69
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-non-escaping-interleaved-primitive-dependency.expect.md
+1
@@ -48,6 +48,7 @@ function Component(props) {
48 } else {
49 b = $[2];
50 }
51 +
52 return b;
53 }
54
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/escape-analysis-not-if-test.expect.md
+1
@@ -32,6 +32,7 @@ function Component(props) {
32 } else {
33 y = props.c;
34 }
35 +
36 return y;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/exhaustive-deps/exhaustive-deps-allow-constant-folded-values.expect.md
+1
@@ -32,6 +32,7 @@ function Component() {
32 t0 = $[0];
33 }
34 const y = t0;
35 +
36 return y;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/extend-scopes-if.expect.md
+1
@@ -52,6 +52,7 @@ function foo(a, b, c) {
52 if (x.length) {
53 return x;
54 }
55 +
56 return null;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-empty-update-with-continue.expect.md
+1
@@ -29,6 +29,7 @@ function Component(props) {
29 x = x + i;
30 i = i + 1;
31 }
32 +
33 return x;
34 }
35
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-empty-update.expect.md
+1
@@ -32,6 +32,7 @@ function Component(props) {
32 break;
33 }
34 }
35 +
36 return x;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-body-always-returns.expect.md
+1
@@ -23,6 +23,7 @@ function Component(props) {
23 for (const x in props.value) {
24 return x;
25 }
26 +
27 return null;
28 }
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-break.expect.md
+1
@@ -45,6 +45,7 @@ function Component(props) {
45
46 x = object[y];
47 }
48 +
49 return x;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-continue.expect.md
+1
@@ -54,6 +54,7 @@ function Component(props) {
54
55 x = object[y];
56 }
57 +
58 return x;
59 }
60
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-in-statement-empty-body.expect.md
+1
@@ -23,6 +23,7 @@ function Component(props) {
23 let x;
24 for (const y in props.value) {
25 }
26 +
27 return x;
28 }
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-logical.expect.md
+1
@@ -36,6 +36,7 @@ function foo(props) {
36 x = x * 2;
37 y = y + x;
38 }
39 +
40 return y;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-multiple-variable-declarations-in-initializer.expect.md
+1
@@ -37,6 +37,7 @@ function Component(props) {
37 } else {
38 items = $[1];
39 }
40 +
41 return items;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-break.expect.md
+1
@@ -35,6 +35,7 @@ function Component() {
35 for (const item of [1, 2]) {
36 break;
37 }
38 +
39 return x;
40 }
41
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-capture-item-of-local-collection-mutate-later-value-initially-null.expect.md
+1
@@ -47,6 +47,7 @@ function Component(props) {
47 } else {
48 items = $[0];
49 }
50 +
51 return items;
52 }
53
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-capture-item-of-local-collection-mutate-later.expect.md
+1
@@ -47,6 +47,7 @@ function Component(props) {
47 } else {
48 items = $[0];
49 }
50 +
51 return items;
52 }
53
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-conditional-break.expect.md
+1
@@ -41,6 +41,7 @@ function Component() {
41 } else {
42 x = $[0];
43 }
44 +
45 return x;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-continue.expect.md
+1
@@ -43,6 +43,7 @@ function Component() {
43 } else {
44 ret = $[0];
45 }
46 +
47 return ret;
48 }
49
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-destructure.expect.md
+1
@@ -36,6 +36,7 @@ function Component() {
36 } else {
37 x = $[0];
38 }
39 +
40 return x;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-immutable-collection.expect.md
+1
@@ -51,6 +51,7 @@ function Router(t0) {
51 } else {
52 array = $[2];
53 }
54 +
55 return array;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-iterator-of-immutable-collection.expect.md
+1
@@ -51,6 +51,7 @@ function Router(t0) {
51 } else {
52 array = $[2];
53 }
54 +
55 return array;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-mutate-item-of-local-collection.expect.md
+1
@@ -38,6 +38,7 @@ function Component(props) {
38 } else {
39 items = $[0];
40 }
41 +
42 return items;
43 }
44
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/for-of-simple.expect.md
+1
@@ -36,6 +36,7 @@ function Component() {
36 } else {
37 x = $[0];
38 }
39 +
40 return x;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/global-types/set-for-of-iterate-values.expect.md
+1
@@ -44,6 +44,7 @@ function useFoo(t0) {
44 for (const el of s1.values()) {
45 s2.add(el);
46 }
47 +
48 return [s1, s2];
49 }
50
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisted-declaration-with-scope.expect.md
+1
@@ -60,6 +60,7 @@ function useFoo(t0) {
60 );
61
62 const dispatcher = useHook();
63 +
64 return button;
65 }
66
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisted-function-declaration.expect.md
+1
@@ -42,6 +42,7 @@ function component(a) {
42 } else {
43 t = $[1];
44 }
45 +
46 return t;
47 }
48
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-const-declaration-2.expect.md
+1
@@ -44,6 +44,7 @@ function hoisting(cond) {
44 } else {
45 items = $[1];
46 }
47 +
48 return items;
49 }
50 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-nested-let-declaration-2.expect.md
+1
@@ -44,6 +44,7 @@ function hoisting(cond) {
44 } else {
45 items = $[1];
46 }
47 +
48 return items;
49 }
50 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/independently-memoize-object-property.expect.md
+1
@@ -44,6 +44,7 @@ function foo(a, b, c) {
44 } else {
45 x = $[3];
46 }
47 +
48 return x;
49 }
50
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-types-through-type-cast.flow.expect.md
+1
@@ -29,6 +29,7 @@ import { getNumber } from "shared-runtime";
29
30 function Component(props) {
31 const x = getNumber();
32 +
33 return x;
34 }
35
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inline-jsx-transform.expect.md
+1
@@ -412,6 +412,7 @@ function ConditionalJsx(t0) {
412 }
413 content = t3;
414 }
415 +
416 return content;
417 }
418
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-function/nullable-objects/bug-invalid-array-map-manual.expect.md
+1
@@ -51,6 +51,7 @@ function useFoo(t0) {
51 } else {
52 y = $[4];
53 }
54 +
55 return y;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inverted-if-else.expect.md
+1
@@ -35,6 +35,7 @@ function foo(a, b, c) {
35
36 x = c;
37 }
38 +
39 return x;
40 }
41
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inverted-if.expect.md
+1
@@ -47,6 +47,7 @@ function foo(a, b, c, d) {
47 } else {
48 y = $[4];
49 }
50 +
51 return y;
52 }
53
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-outlining-jsx-stored-in-id.expect.md
+1
@@ -58,6 +58,7 @@ function Component(t0) {
58 t2 = (i, id) => {
59 const T0 = _temp;
60 const jsx = <T0 i={i} key={id} x={x} />;
61 +
62 return jsx;
63 };
64 $[3] = x;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/labeled-break-within-label-loop.expect.md
+1
@@ -50,6 +50,7 @@ function useHook(end) {
50 } else {
51 log = $[1];
52 }
53 +
54 return log;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutate-shadowed-object.expect.md
+1
@@ -37,6 +37,7 @@ function Component() {
37 };
38
39 fn();
40 +
41 return x;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.expect.md
+1
@@ -43,6 +43,7 @@ function Component() {
43 };
44
45 fn();
46 +
47 return x;
48 }
49
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-consecutive-nested-scopes.expect.md
+1
@@ -41,6 +41,7 @@ function Component(props) {
41 }
42 x = t0;
43 }
44 +
45 return x;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merge-nested-scopes-with-same-inputs.expect.md
+1
@@ -49,6 +49,7 @@ function Component(props) {
49 } else {
50 y = $[1];
51 }
52 +
53 return y;
54 }
55
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/merged-scopes-are-valid-effect-deps.expect.md
+1
@@ -57,6 +57,7 @@ function Component(props) {
57 t2 = $[4];
58 }
59 useEffect(t1, t2);
60 +
61 return y;
62 }
63
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/meta-property.expect.md
+3
@@ -44,6 +44,7 @@ function b() {
44 if (import.meta.url) {
45 a = 1;
46 }
47 +
48 return a;
49 }
50
@@ -52,6 +53,7 @@ function c() {
53 if (import.meta.foo) {
54 a = 1;
55 }
56 +
57 return a;
58 }
59
@@ -60,6 +62,7 @@ function d() {
62 if (import.meta) {
63 a = 1;
64 }
65 +
66 return a;
67 }
68
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-capture-and-mutablerange.expect.md
+1
@@ -67,6 +67,7 @@ function useFoo(t0) {
67 } else {
68 z = $[2];
69 }
70 +
71 return z;
72 }
73
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx-and-break.expect.md
+1
@@ -71,6 +71,7 @@ function useFoo(t0) {
71 obj = $[2];
72 myDiv = $[3];
73 }
74 +
75 return myDiv;
76 }
77
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutation-within-jsx.expect.md
+1
@@ -112,6 +112,7 @@ function useFoo(t0) {
112 myDiv = $[2];
113 }
114 }
115 +
116 return myDiv;
117 }
118
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/array-map-captures-receiver-noAlias.expect.md
+1
@@ -37,6 +37,7 @@ function Component(props) {
37 t0 = $[1];
38 }
39 const mapped = t0;
40 +
41 return mapped;
42 }
43 function _temp(item_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/capturing-function-alias-computed-load-2-iife.expect.md
+1
@@ -46,6 +46,7 @@ function bar(a) {
46 } else {
47 y = $[3];
48 }
49 +
50 return y;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/capturing-function-alias-computed-load-3-iife.expect.md
+1
@@ -54,6 +54,7 @@ function bar(a, b) {
54 } else {
55 y = $[5];
56 }
57 +
58 return y;
59 }
60
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/capturing-function-alias-computed-load-4-iife.expect.md
+1
@@ -46,6 +46,7 @@ function bar(a) {
46 } else {
47 y = $[3];
48 }
49 +
50 return y;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/capturing-function-alias-computed-load-iife.expect.md
+1
@@ -45,6 +45,7 @@ function bar(a) {
45 } else {
46 y = $[3];
47 }
48 +
49 return y;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/shared-hook-calls.expect.md
+1
@@ -71,6 +71,7 @@ function Component(t0) {
71 t5 = $[8];
72 }
73 useEffect(t5);
74 +
75 return null;
76 }
77
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/nonmutating-capture-in-unsplittable-memo-block.expect.md
+1
@@ -93,6 +93,7 @@ function useFoo(t0) {
93 if (z[0] !== y) {
94 throw new Error("oh no!");
95 }
96 +
97 return z;
98 }
99
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-literal-cached-in-if-else.expect.md
+1
@@ -43,6 +43,7 @@ function foo(a, b, c, d) {
43 }
44 x = t0;
45 }
46 +
47 return x;
48 }
49
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-shadowing-within-block.expect.md
+1
@@ -62,6 +62,7 @@ function foo(a, b, c) {
62 } else {
63 x = $[3];
64 }
65 +
66 return x;
67 }
68
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/overlapping-scopes-within-block.expect.md
+1
@@ -55,6 +55,7 @@ function foo(a, b, c) {
55 } else {
56 x = $[3];
57 }
58 +
59 return x;
60 }
61
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/partial-early-return-within-reactive-scope.expect.md
+1
@@ -68,6 +68,7 @@ function Component(props) {
68 if (t0 !== Symbol.for("react.early_return_sentinel")) {
69 return t0;
70 }
71 +
72 return y;
73 }
74
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.expect.md
+1
@@ -45,6 +45,7 @@ function Foo(cond) {
45 } else {
46 x = $[1];
47 }
48 +
49 return x;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-captures-reassigned-context.expect.md
+1
@@ -55,6 +55,7 @@ function Foo(props) {
55 }
56 x;
57 const cb = t0;
58 +
59 return cb;
60 }
61
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prop-capturing-function-1.expect.md
+1
@@ -37,6 +37,7 @@ function component(a, b) {
37 t0 = $[2];
38 }
39 const x = t0;
40 +
41 return x;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/partial-early-return-within-reactive-scope.expect.md
+1
@@ -69,6 +69,7 @@ function Component(props) {
69 if (t0 !== Symbol.for("react.early_return_sentinel")) {
70 return t0;
71 }
72 +
73 return y;
74 }
75
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/reduce-reactive-deps/promote-uncond.expect.md
+1
@@ -51,6 +51,7 @@ function usePromoteUnconditionalAccessToDependency(props, other) {
51 } else {
52 x = $[3];
53 }
54 +
55 return x;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/try-catch-maybe-null-dependency.expect.md
+1
@@ -61,6 +61,7 @@ function useFoo(maybeNullObject) {
61 } else {
62 y = $[1];
63 }
64 +
65 return y;
66 }
67
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/try-catch-mutate-outer-value.expect.md
+1
@@ -58,6 +58,7 @@ function Component(props) {
58 } else {
59 x = $[1];
60 }
61 +
62 return x;
63 }
64
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/try-catch-try-value-modified-in-catch-escaping.expect.md
+1
@@ -50,6 +50,7 @@ function Component(props) {
50 } else {
51 x = $[2];
52 }
53 +
54 return x;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/try-catch-try-value-modified-in-catch.expect.md
+1
@@ -56,6 +56,7 @@ function Component(props) {
56 if (t0 !== Symbol.for("react.early_return_sentinel")) {
57 return t0;
58 }
59 +
60 return null;
61 }
62
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/propagate-scope-deps-hir-fork/useMemo-multiple-if-else.expect.md
+1
@@ -65,6 +65,7 @@ function Component(props) {
65 t0 = $[4];
66 }
67 const x = t0;
68 +
69 return x;
70 }
71
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-array.expect.md
+1
@@ -32,6 +32,7 @@ function Component(props) {
32 x.push(props.value);
33
34 const y = [x];
35 +
36 return [y];
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-new.expect.md
+1
@@ -34,6 +34,7 @@ function Component(props) {
34 x.value = props.value;
35
36 const y = { x };
37 +
38 return { y };
39 }
40
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/prune-scopes-whose-deps-invalidate-object.expect.md
+1
@@ -32,6 +32,7 @@ function Component(props) {
32 x.value = props.value;
33
34 const y = { x };
35 +
36 return { y };
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md
+1
@@ -106,6 +106,7 @@ function Foo(t0) {
106 } else {
107 invariant(setState === setY, "Expected the correct setState function");
108 }
109 +
110 return "ok";
111 }
112
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scope-grouping.expect.md
+1
@@ -37,6 +37,7 @@ function foo() {
37 } else {
38 x = $[0];
39 }
40 +
41 return x;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reactive-scopes-if.expect.md
+1
@@ -60,6 +60,7 @@ function foo(a, b, c) {
60 } else {
61 x = $[3];
62 }
63 +
64 return x;
65 }
66
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-global-hook-arg.expect.md
+1
@@ -27,6 +27,7 @@ let b = 1;
27
28 export default function MyApp() {
29 const fn = _temp;
30 +
31 return useFoo(fn);
32 }
33 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassign-global-return.expect.md
+1
@@ -25,6 +25,7 @@ let b = 1;
25
26 export default function useMyHook() {
27 const fn = _temp;
28 +
29 return fn;
30 }
31 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/recursive-function-expression.expect.md
+2
@@ -43,12 +43,14 @@ function Component1() {
43 if (x_0 == 0) {
44 return null;
45 }
46 +
47 return callback(x_0 - 1);
48 }
49 $[0] = x;
50 } else {
51 x = $[0];
52 }
53 +
54 return x;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/recursive-function.expect.md
+1
@@ -23,6 +23,7 @@ function foo(x) {
23 if (x <= 0) {
24 return 0;
25 }
26 +
27 return x + foo(x - 1) + foo(x - 2);
28 }
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-break-in-scope.expect.md
+1
@@ -51,6 +51,7 @@ function useFoo(t0) {
51 } else {
52 x = $[2];
53 }
54 +
55 return x;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-cond-deps-cfg-nested-testifelse.expect.md
+1
@@ -52,6 +52,7 @@ function useFoo(t0) {
52 } else {
53 x = $[2];
54 }
55 +
56 return x;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-ifelse.expect.md
+1
@@ -50,6 +50,7 @@ function useCondDepInDirectIfElse(props, cond) {
50 } else {
51 x = $[2];
52 }
53 +
54 return x;
55 }
56
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse-missing.expect.md
+1
@@ -52,6 +52,7 @@ function useCondDepInNestedIfElse(props, cond) {
52 } else {
53 x = $[2];
54 }
55 +
56 return x;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cfg-nested-ifelse.expect.md
+1
@@ -64,6 +64,7 @@ function useCondDepInNestedIfElse(props, cond) {
64 } else {
65 x = $[2];
66 }
67 +
68 return x;
69 }
70
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/cond-scope.expect.md
+1
@@ -83,6 +83,7 @@ function useReactiveDepsInCondScope(props) {
83 } else {
84 x = $[1];
85 }
86 +
87 return x;
88 }
89
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-in-scope.expect.md
+1
@@ -51,6 +51,7 @@ function useFoo(t0) {
51 } else {
52 x = $[2];
53 }
54 +
55 return x;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/break-poisons-outer-scope.expect.md
+1
@@ -64,6 +64,7 @@ function useFoo(t0) {
64 } else {
65 x = $[2];
66 }
67 +
68 return x;
69 }
70
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/loop-break-in-scope.expect.md
+1
@@ -51,6 +51,7 @@ function useFoo(t0) {
51 } else {
52 x = $[2];
53 }
54 +
55 return x;
56 }
57
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps.expect.md
+1
@@ -86,6 +86,7 @@ function useFoo(t0) {
86 if (t1 !== Symbol.for("react.early_return_sentinel")) {
87 return t1;
88 }
89 +
90 return x;
91 }
92
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-poisoned/reduce-if-nonexhaustive-poisoned-deps1.expect.md
+1
@@ -97,6 +97,7 @@ function useFoo(t0) {
97 if (t1 !== Symbol.for("react.early_return_sentinel")) {
98 return t1;
99 }
100 +
101 return x;
102 }
103
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/else-branch-scope-unpoisoned.expect.md
+1
@@ -64,6 +64,7 @@ function useFoo(t0) {
64 } else {
65 x = $[2];
66 }
67 +
68 return x[0];
69 }
70
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps.expect.md
+1
@@ -77,6 +77,7 @@ function useFoo(t0) {
77 if (t1 !== Symbol.for("react.early_return_sentinel")) {
78 return t1;
79 }
80 +
81 return x;
82 }
83
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/jump-unpoisoned/reduce-if-exhaustive-nonpoisoned-deps1.expect.md
+1
@@ -97,6 +97,7 @@ function useFoo(t0) {
97 if (t1 !== Symbol.for("react.early_return_sentinel")) {
98 return t1;
99 }
100 +
101 return x;
102 }
103
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/no-uncond.expect.md
+1
@@ -56,6 +56,7 @@ function useOnlyConditionalDependencies(t0) {
56 } else {
57 x = $[2];
58 }
59 +
60 return x;
61 }
62
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/promote-uncond.expect.md
+1
@@ -49,6 +49,7 @@ function usePromoteUnconditionalAccessToDependency(props, other) {
49 } else {
50 x = $[3];
51 }
52 +
53 return x;
54 }
55
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/reduce-if-exhaustive-poisoned-deps.expect.md
+1
@@ -87,6 +87,7 @@ function useFoo(t0) {
87 if (t1 !== Symbol.for("react.early_return_sentinel")) {
88 return t1;
89 }
90 +
91 return x;
92 }
93
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/subpath-order1.expect.md
+1
@@ -52,6 +52,7 @@ function useConditionalSubpath1(props, cond) {
52 } else {
53 x = $[2];
54 }
55 +
56 return x;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/superpath-order1.expect.md
+1
@@ -60,6 +60,7 @@ function useConditionalSuperpath1(t0) {
60 } else {
61 x = $[2];
62 }
63 +
64 return x;
65 }
66
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reduce-reactive-deps/todo-merge-ssa-phi-access-nodes.expect.md
+1
@@ -100,6 +100,7 @@ function useFoo(cond) {
100 } else {
101 y = $[4];
102 }
103 +
104 return y;
105 }
106
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-backedge-reference-effect.expect.md
+1
@@ -47,6 +47,7 @@ function Foo(t0) {
47 for (const selectedUser of userIds) {
48 arr.push(selectedUser);
49 }
50 +
51 return arr;
52 }}
53 shouldInvokeFns={true}
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-false-positive-ref-validation-in-use-effect.expect.md
+1
@@ -77,6 +77,7 @@ function Component() {
77 t2 = $[4];
78 }
79 useEffect(t1, t2);
80 +
81 return "ok";
82 }
83
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-invalid-phi-as-dependency.expect.md
+1
@@ -64,6 +64,7 @@ function Component() {
64 if (boxedInner[0] !== obj?.inner) {
65 throw new Error("invariant broken");
66 }
67 +
68 return <Stringify obj={obj} inner={boxedInner} />;
69 }
70
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-invalid-pruned-scope-leaks-value-via-alias.expect.md
+1
@@ -90,6 +90,7 @@ function MyApp(t0) {
90 if (thing[1] !== z) {
91 invariant(false, "oh no!");
92 }
93 +
94 return thing;
95 }
96
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-invalid-pruned-scope-leaks-value.expect.md
+1
@@ -88,6 +88,7 @@ function MyApp(t0) {
88 if (thing[1] !== z) {
89 invariant(false, "oh no!");
90 }
91 +
92 return thing;
93 }
94
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-invalid-reactivity-value-block.expect.md
+1
@@ -86,6 +86,7 @@ function Foo() {
86 if (shouldCaptureObj && result[0] !== obj) {
87 throw new Error("Unexpected");
88 }
89 +
90 return result;
91 }
92
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-no-value-for-temporary.expect.md
+1
@@ -45,6 +45,7 @@ function Component(listItem, thread) {
45 t3 = $[6];
46 }
47 const body = t1(t2, t3);
48 +
49 return body;
50 }
51
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-preserve-memoization-inner-destructured-value-mistaken-as-dependency.expect.md
+1
@@ -74,6 +74,7 @@ function useInputValue(input) {
74 t1 = $[3];
75 }
76 const object = t1;
77 +
78 return object;
79 }
80
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-propagate-type-of-ternary-nested.expect.md
+1
@@ -71,6 +71,7 @@ function V0(t0) {
71 t1 = $[1];
72 }
73 const vb = t1;
74 +
75 return vb;
76 }
77
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-ref-mutable-range.expect.md
+1
@@ -75,6 +75,7 @@ function Foo(props, ref) {
75 }
76 return t2;
77 }
78 +
79 return value;
80 }
81
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/return-ref-callback.expect.md
+1
@@ -41,6 +41,7 @@ function Foo() {
41 t0 = $[0];
42 }
43 const s = t0;
44 +
45 return s;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/return-undefined.expect.md
+1
@@ -24,6 +24,7 @@ function Component(props) {
24 if (props.cond) {
25 return;
26 }
27 +
28 return props.value;
29 }
30
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rewrite-phis-in-lambda-capture-context.expect.md
+1
@@ -24,6 +24,7 @@ function Component() {
24 ```javascript
25 function Component() {
26 const get4 = _temp2;
27 +
28 return get4;
29 }
30 function _temp2() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/sequence-expression.expect.md
+1
@@ -36,6 +36,7 @@ function sequence(props) {
36 } else {
37 x = $[1];
38 }
39 +
40 return x;
41 }
42
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/simple-function-1.expect.md
+1
@@ -22,6 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
22 ```javascript
23 function component() {
24 const x = _temp;
25 +
26 return x;
27 }
28 function _temp(a) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for-of.expect.md
+1
@@ -39,6 +39,7 @@ function foo(cond) {
39 if (cond) {
40 }
41 }
42 +
43 return items;
44 }
45
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for-trivial-update.expect.md
+1
@@ -26,6 +26,7 @@ function foo() {
26 for (const i = 0; true; 0) {
27 x = x + 1;
28 }
29 +
30 return x;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-for.expect.md
+1
@@ -26,6 +26,7 @@ function foo() {
26 for (let i = 0; i < 10; i++) {
27 x = x + 1;
28 }
29 +
30 return x;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-multiple-phis.expect.md
+1
@@ -37,6 +37,7 @@ function foo(a, b, c, d) {
37 let x;
38
39 x = a;
40 +
41 return x;
42 }
43
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-nested-loops-no-reassign.expect.md
+1
@@ -33,6 +33,7 @@ function foo(a, b, c) {
33 while (c) {}
34 }
35 }
36 +
37 return 0;
38 }
39
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-nested-partial-phi.expect.md
+1
@@ -30,6 +30,7 @@ function foo(a, b, c) {
30 if (c) {
31 x = c;
32 }
33 +
34 return x;
35 }
36 }
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-nested-partial-reassignment.expect.md
+1
@@ -34,6 +34,7 @@ function foo(a, b, c, d, e) {
34 x = d;
35 }
36 }
37 +
38 return x;
39 }
40
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-if.expect.md
+1
@@ -57,6 +57,7 @@ function foo(a) {
57 } else {
58 x = $[1];
59 }
60 +
61 return x;
62 }
63
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-property-alias-mutate-inside-if.expect.md
+1
@@ -46,6 +46,7 @@ function foo(a) {
46 } else {
47 x = $[1];
48 }
49 +
50 return x;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-via-destructuring.expect.md
+1
@@ -46,6 +46,7 @@ function foo(props) {
46 x = $[3];
47 }
48 }
49 +
50 return x;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming.expect.md
+1
@@ -46,6 +46,7 @@ function foo(props) {
46 x = $[3];
47 }
48 }
49 +
50 return x;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-while-no-reassign.expect.md
+1
@@ -24,6 +24,7 @@ export const FIXTURE_ENTRYPOINT = {
24 ```javascript
25 function foo() {
26 while (true) {}
27 +
28 return 1;
29 }
30
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-while.expect.md
+1
@@ -27,6 +27,7 @@ function foo() {
27 while (x < 10) {
28 x = x + 1;
29 }
30 +
31 return x;
32 }
33
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/tagged-template-literal.expect.md
+1
@@ -32,6 +32,7 @@ function component() {
32 t0 = $[0];
33 }
34 const t = t0;
35 +
36 return t;
37 }
38
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.memoize-loops-that-produce-memoizeable-values.expect.md
+1
@@ -53,6 +53,7 @@ function useHook(nodeID, condition) {
53 } else {
54 value = $[5];
55 }
56 +
57 return value;
58 }
59
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/bailout-retry/bailout-capitalized-fn-call.expect.md
+1
@@ -41,6 +41,7 @@ function Component(t0) {
41 t1();
42 t2();
43 });
44 +
45 return CapitalizedCall();
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/bailout-retry/bailout-validate-preserve-memo.expect.md
+1
@@ -41,6 +41,7 @@ function Component(t0) {
41 t1();
42 t2();
43 });
44 +
45 return useMemo(() => sum(bar), []);
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/bailout-retry/no-fire-todo-syntax-shouldnt-throw.expect.md
+1
@@ -82,6 +82,7 @@ function FireComponent(props) {
82 t1 = $[2];
83 }
84 useEffect(t1);
85 +
86 return null;
87 }
88 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/bailout-validate-conditional-hook.expect.md
+1
@@ -46,6 +46,7 @@ function Component(props) {
46 t0(props);
47 });
48 }
49 +
50 return <Stringify />;
51 }
52 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/basic.expect.md
+1
@@ -40,6 +40,7 @@ function Component(props) {
40 t1 = $[2];
41 }
42 useEffect(t1);
43 +
44 return null;
45 }
46 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/deep-scope.expect.md
+1
@@ -61,6 +61,7 @@ function Component(props) {
61 t1 = $[2];
62 }
63 useEffect(t1);
64 +
65 return null;
66 }
67 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/hook-guard.expect.md
+1
@@ -57,6 +57,7 @@ function Component(props) {
57 $dispatcherGuard(3);
58 }
59 })();
60 +
61 return null;
62 } finally {
63 $dispatcherGuard(1);
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/multiple-scope.expect.md
+1
@@ -53,6 +53,7 @@ function Component(props) {
53 t1 = $[2];
54 }
55 useEffect(t1);
56 +
57 return null;
58 }
59 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/repeated-calls.expect.md
+1
@@ -52,6 +52,7 @@ function Component(props) {
52 t2 = $[4];
53 }
54 useEffect(t2);
55 +
56 return null;
57 }
58
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/repro-dont-add-hook-guards-on-retry.expect.md
+1
@@ -36,6 +36,7 @@ function Component(props, useDynamicHook) {
36 useEffect(() => {
37 t0(props);
38 });
39 +
40 return <div>hello world</div>;
41 }
42 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/rewrite-deps.expect.md
+1
@@ -44,6 +44,7 @@ function Component(props) {
44 t2 = $[3];
45 }
46 useEffect(t1, t2);
47 +
48 return null;
49 }
50 function _temp(props_0) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/shared-hook-calls.expect.md
+1
@@ -71,6 +71,7 @@ function Component(t0) {
71 t5 = $[8];
72 }
73 useEffect(t5);
74 +
75 return null;
76 }
77
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transform-fire/use-effect-no-args-no-op.expect.md
+1
@@ -21,6 +21,7 @@ import { fire } from "react";
21
22 function Component(props) {
23 useEffect();
24 +
25 return null;
26 }
27
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/transitive-freeze-function-expressions.expect.md
+1
@@ -80,6 +80,7 @@ function Component(props) {
80 t3 = $[8];
81 }
82 const items = t3;
83 +
84 return items;
85 }
86 function _temp(x) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-empty-try.expect.md
+1
@@ -23,6 +23,7 @@ export const FIXTURE_ENTRYPOINT = {
23 ```javascript
24 function Component(props) {
25 const x = props.default;
26 +
27 return x;
28 }
29
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-in-nested-scope.expect.md
+1
@@ -79,6 +79,7 @@ function useFoo(t0) {
79 if (t1 !== Symbol.for("react.early_return_sentinel")) {
80 return t1;
81 }
82 +
83 return y;
84 }
85
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-maybe-null-dependency.expect.md
+1
@@ -60,6 +60,7 @@ function useFoo(maybeNullObject) {
60 } else {
61 y = $[1];
62 }
63 +
64 return y;
65 }
66
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-mutate-outer-value.expect.md
+1
@@ -57,6 +57,7 @@ function Component(props) {
57 } else {
58 x = $[1];
59 }
60 +
61 return x;
62 }
63
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-immediately-returns.expect.md
+1
@@ -27,6 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ```javascript
28 function Component(props) {
29 let x;
30 +
31 return 42;
32 }
33
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-immediately-throws-after-constant-propagation.expect.md
+1
@@ -27,6 +27,7 @@ export const FIXTURE_ENTRYPOINT = {
27 ```javascript
28 function Component(props) {
29 let x;
30 +
31 return 42;
32 }
33
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch-escaping.expect.md
+1
@@ -49,6 +49,7 @@ function Component(props) {
49 } else {
50 x = $[2];
51 }
52 +
53 return x;
54 }
55
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-try-value-modified-in-catch.expect.md
+1
@@ -55,6 +55,7 @@ function Component(props) {
55 if (t0 !== Symbol.for("react.early_return_sentinel")) {
56 return t0;
57 }
58 +
59 return null;
60 }
61
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-catch-param.expect.md
+1
@@ -56,6 +56,7 @@ function Component(props) {
56 if (t0 !== Symbol.for("react.early_return_sentinel")) {
57 return t0;
58 }
59 +
60 return x;
61 }
62
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch-with-return.expect.md
+1
@@ -61,6 +61,7 @@ function Component(props) {
61 if (t0 !== Symbol.for("react.early_return_sentinel")) {
62 return t0;
63 }
64 +
65 return x;
66 }
67
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/try-catch.expect.md
+1
@@ -42,6 +42,7 @@ function Component(props) {
42 } catch {
43 x = null;
44 }
45 +
46 return x;
47 }
48
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unlabeled-break-within-label-loop.expect.md
+1
@@ -49,6 +49,7 @@ function useHook(end) {
49 } else {
50 log = $[1];
51 }
52 +
53 return log;
54 }
55
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/unmemoized-nonreactive-dependency-is-pruned-as-dependency.expect.md
+1
@@ -31,6 +31,7 @@ function Component(props) {
31 const x = [];
32 useNoAlias();
33 mutate(x);
34 +
35 return <div>{x}</div>;
36 }
37
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/use-effect-cleanup-reassigns.expect.md
+1
@@ -75,6 +75,7 @@ function Component(t0) {
75
76 0,
77 );
78 +
79 return () => {
80 if (!cleanedUp) {
81 cleanedUp = true;
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-global-pruned.expect.md
+1
@@ -52,6 +52,7 @@ function useFoo() {
52 t1 = $[1];
53 }
54 useEffect(t0, t1);
55 +
56 return null;
57 }
58 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect-namespace-pruned.expect.md
+1
@@ -52,6 +52,7 @@ function useFoo() {
52 t1 = $[1];
53 }
54 React.useEffect(t0, t1);
55 +
56 return null;
57 }
58 function _temp() {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-if-else-multiple-return.expect.md
+1
@@ -46,6 +46,7 @@ function Component(props) {
46 t0 = t1;
47 }
48 const x = t0;
49 +
50 return x;
51 }
52
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-inlining-block-return.expect.md
+1
@@ -42,6 +42,7 @@ function component(a, b) {
42 t0 = undefined;
43 }
44 const x = t0;
45 +
46 return x;
47 }
48
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-inverted-if.expect.md
+1
@@ -43,6 +43,7 @@ function Component(props) {
43 t0 = props.b;
44 }
45 const x = t0;
46 +
47 return x;
48 }
49
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-labeled-statement-unconditional-return.expect.md
+1
@@ -26,6 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
26 // @validateExhaustiveMemoizationDependencies:false
27 function Component(props) {
28 const x = props.value;
29 +
30 return x;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-mabye-modified-free-variable-preserve-memoization-guarantees.expect.md
+1
@@ -85,6 +85,7 @@ function Component(props) {
85
86 identity(free);
87 identity(part);
88 +
89 return object;
90 }
91
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-multiple-if-else.expect.md
+1
@@ -65,6 +65,7 @@ function Component(props) {
65 t0 = $[4];
66 }
67 const x = t0;
68 +
69 return x;
70 }
71
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-nested-ifs.expect.md
+1
@@ -38,6 +38,7 @@ function Component(props) {
38 t0 = undefined;
39 }
40 const x = t0;
41 +
42 return x;
43 }
44
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-switch-no-fallthrough.expect.md
+1
@@ -41,6 +41,7 @@ function Component(props) {
41 }
42 }
43 const x = t0;
44 +
45 return x;
46 }
47
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useMemo-switch-return.expect.md
+1
@@ -55,6 +55,7 @@ function Component(props) {
55 t0 = y;
56 }
57 const x = t0;
58 +
59 return x;
60 }
61
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/valid-setState-in-useEffect-via-useEffectEvent-with-ref.expect.md
+1
@@ -157,6 +157,7 @@ function Component(t0) {
157 t6 = $[17];
158 }
159 useEffect(t5, t6);
160 +
161 return data;
162 }
163
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/value-block-mutates-outer-value.expect.md
+1
@@ -53,6 +53,7 @@ function Foo(t0) {
53 const result = cond
54 ? [...customList.sort(comparator), { text: ["text"] }]
55 : defaultList;
56 +
57 return result;
58 }
59 function _temp(a, b) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/while-break.expect.md
+1
@@ -24,6 +24,7 @@ function foo(a, b) {
24 while (a) {
25 break;
26 }
27 +
28 return b;
29 }
30
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/while-logical.expect.md
+1
@@ -26,6 +26,7 @@ function foo(props) {
26 while (x > props.min && x < props.max) {
27 x = x * 2;
28 }
29 +
30 return x;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/while-property.expect.md
+1
@@ -26,6 +26,7 @@ function foo(a, b) {
26 while (a.b.c) {
27 x = x + b;
28 }
29 +
30 return x;
31 }
32
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/while-with-assignment-in-test.expect.md
+1
@@ -31,6 +31,7 @@ function Component() {
31 while ((value = queue.pop()) != null) {
32 sum = sum + value;
33 }
34 +
35 return sum;
36 }
37