mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[compiler][test fixtures] Add enablePropagateDepsInHIR to forked tests
Annotates fixtures added in #31030 with `@enablePropagateDepsInHIR` to fork behavior (and commit snapshot differences) ghstack-source-id: e423e8c42db62f1bb87562b770761be09fc8ffc6 Pull Request resolved: https://github.com/facebook/react/pull/31031
This commit is contained in:
parent
943e45e910
commit
1a779207a7
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b *does* influence `a`
|
||||
*/
|
||||
|
|
@ -29,13 +30,19 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime"; /**
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b *does* influence `a`
|
||||
*/
|
||||
function Component(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(5);
|
||||
let a;
|
||||
if ($[0] !== props) {
|
||||
if (
|
||||
$[0] !== props.a ||
|
||||
$[1] !== props.b ||
|
||||
$[2] !== props.c ||
|
||||
$[3] !== props.d
|
||||
) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
bb0: {
|
||||
|
|
@ -47,10 +54,13 @@ function Component(props) {
|
|||
}
|
||||
|
||||
a.push(props.d);
|
||||
$[0] = props;
|
||||
$[1] = a;
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
$[2] = props.c;
|
||||
$[3] = props.d;
|
||||
$[4] = a;
|
||||
} else {
|
||||
a = $[1];
|
||||
a = $[4];
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b *does* influence `a`
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b does *not* influence `a`
|
||||
*/
|
||||
|
|
@ -66,14 +67,15 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime"; /**
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b does *not* influence `a`
|
||||
*/
|
||||
function ComponentA(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(5);
|
||||
let a_DEBUG;
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.a || $[1] !== props.b || $[2] !== props.d) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
a_DEBUG = [];
|
||||
|
|
@ -85,12 +87,14 @@ function ComponentA(props) {
|
|||
|
||||
a_DEBUG.push(props.d);
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = a_DEBUG;
|
||||
$[2] = t0;
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
$[2] = props.d;
|
||||
$[3] = a_DEBUG;
|
||||
$[4] = t0;
|
||||
} else {
|
||||
a_DEBUG = $[1];
|
||||
t0 = $[2];
|
||||
a_DEBUG = $[3];
|
||||
t0 = $[4];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
@ -102,9 +106,14 @@ function ComponentA(props) {
|
|||
* props.b *does* influence `a`
|
||||
*/
|
||||
function ComponentB(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(5);
|
||||
let a;
|
||||
if ($[0] !== props) {
|
||||
if (
|
||||
$[0] !== props.a ||
|
||||
$[1] !== props.b ||
|
||||
$[2] !== props.c ||
|
||||
$[3] !== props.d
|
||||
) {
|
||||
a = [];
|
||||
a.push(props.a);
|
||||
if (props.b) {
|
||||
|
|
@ -112,10 +121,13 @@ function ComponentB(props) {
|
|||
}
|
||||
|
||||
a.push(props.d);
|
||||
$[0] = props;
|
||||
$[1] = a;
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
$[2] = props.c;
|
||||
$[3] = props.d;
|
||||
$[4] = a;
|
||||
} else {
|
||||
a = $[1];
|
||||
a = $[4];
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
@ -124,10 +136,15 @@ function ComponentB(props) {
|
|||
* props.b *does* influence `a`, but only in a way that is never observable
|
||||
*/
|
||||
function ComponentC(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(6);
|
||||
let a;
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if (
|
||||
$[0] !== props.a ||
|
||||
$[1] !== props.b ||
|
||||
$[2] !== props.c ||
|
||||
$[3] !== props.d
|
||||
) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
a = [];
|
||||
|
|
@ -140,12 +157,15 @@ function ComponentC(props) {
|
|||
|
||||
a.push(props.d);
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = a;
|
||||
$[2] = t0;
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
$[2] = props.c;
|
||||
$[3] = props.d;
|
||||
$[4] = a;
|
||||
$[5] = t0;
|
||||
} else {
|
||||
a = $[1];
|
||||
t0 = $[2];
|
||||
a = $[4];
|
||||
t0 = $[5];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
@ -157,10 +177,15 @@ function ComponentC(props) {
|
|||
* props.b *does* influence `a`
|
||||
*/
|
||||
function ComponentD(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(6);
|
||||
let a;
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if (
|
||||
$[0] !== props.a ||
|
||||
$[1] !== props.b ||
|
||||
$[2] !== props.c ||
|
||||
$[3] !== props.d
|
||||
) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
a = [];
|
||||
|
|
@ -173,12 +198,15 @@ function ComponentD(props) {
|
|||
|
||||
a.push(props.d);
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = a;
|
||||
$[2] = t0;
|
||||
$[0] = props.a;
|
||||
$[1] = props.b;
|
||||
$[2] = props.c;
|
||||
$[3] = props.d;
|
||||
$[4] = a;
|
||||
$[5] = t0;
|
||||
} else {
|
||||
a = $[1];
|
||||
t0 = $[2];
|
||||
a = $[4];
|
||||
t0 = $[5];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
/**
|
||||
* props.b does *not* influence `a`
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function ComponentA(props) {
|
||||
const a = [];
|
||||
const b = [];
|
||||
|
|
@ -34,11 +35,11 @@ function mayMutate() {}
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function ComponentA(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(4);
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.p0 || $[1] !== props.p1 || $[2] !== props.p2) {
|
||||
const a = [];
|
||||
const b = [];
|
||||
if (b) {
|
||||
|
|
@ -49,18 +50,20 @@ function ComponentA(props) {
|
|||
}
|
||||
|
||||
t0 = <Foo a={a} b={b} />;
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
$[0] = props.p0;
|
||||
$[1] = props.p1;
|
||||
$[2] = props.p2;
|
||||
$[3] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
t0 = $[3];
|
||||
}
|
||||
return t0;
|
||||
}
|
||||
|
||||
function ComponentB(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(4);
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.p0 || $[1] !== props.p1 || $[2] !== props.p2) {
|
||||
const a = [];
|
||||
const b = [];
|
||||
if (mayMutate(b)) {
|
||||
|
|
@ -71,10 +74,12 @@ function ComponentB(props) {
|
|||
}
|
||||
|
||||
t0 = <Foo a={a} b={b} />;
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
$[0] = props.p0;
|
||||
$[1] = props.p1;
|
||||
$[2] = props.p2;
|
||||
$[3] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
t0 = $[3];
|
||||
}
|
||||
return t0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function ComponentA(props) {
|
||||
const a = [];
|
||||
const b = [];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
let x = [];
|
||||
if (props.cond) {
|
||||
|
|
@ -29,11 +30,11 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(5);
|
||||
const $ = _c(7);
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
const x = [];
|
||||
|
|
@ -41,12 +42,12 @@ function Component(props) {
|
|||
x.push(props.a);
|
||||
if (props.b) {
|
||||
let t1;
|
||||
if ($[2] !== props.b) {
|
||||
if ($[4] !== props.b) {
|
||||
t1 = [props.b];
|
||||
$[2] = props.b;
|
||||
$[3] = t1;
|
||||
$[4] = props.b;
|
||||
$[5] = t1;
|
||||
} else {
|
||||
t1 = $[3];
|
||||
t1 = $[5];
|
||||
}
|
||||
const y = t1;
|
||||
x.push(y);
|
||||
|
|
@ -58,20 +59,22 @@ function Component(props) {
|
|||
break bb0;
|
||||
} else {
|
||||
let t1;
|
||||
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t1 = foo();
|
||||
$[4] = t1;
|
||||
$[6] = t1;
|
||||
} else {
|
||||
t1 = $[4];
|
||||
t1 = $[6];
|
||||
}
|
||||
t0 = t1;
|
||||
break bb0;
|
||||
}
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
$[0] = props.cond;
|
||||
$[1] = props.a;
|
||||
$[2] = props.b;
|
||||
$[3] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
t0 = $[3];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
let x = [];
|
||||
if (props.cond) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
import {makeArray} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
@ -41,13 +42,13 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
import { makeArray } from "shared-runtime";
|
||||
|
||||
function Component(props) {
|
||||
const $ = _c(4);
|
||||
const $ = _c(6);
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
const x = [];
|
||||
|
|
@ -57,21 +58,23 @@ function Component(props) {
|
|||
break bb0;
|
||||
} else {
|
||||
let t1;
|
||||
if ($[2] !== props.b) {
|
||||
if ($[4] !== props.b) {
|
||||
t1 = makeArray(props.b);
|
||||
$[2] = props.b;
|
||||
$[3] = t1;
|
||||
$[4] = props.b;
|
||||
$[5] = t1;
|
||||
} else {
|
||||
t1 = $[3];
|
||||
t1 = $[5];
|
||||
}
|
||||
t0 = t1;
|
||||
break bb0;
|
||||
}
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
$[0] = props.cond;
|
||||
$[1] = props.a;
|
||||
$[2] = props.b;
|
||||
$[3] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
t0 = $[3];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
import {makeArray} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function useFoo(props: {value: {x: string; y: string} | null}) {
|
||||
const value = props.value;
|
||||
return createArray(value?.x, value?.y)?.join(', ');
|
||||
|
|
@ -22,13 +23,13 @@ export const FIXTURE_ENTRYPONT = {
|
|||
## Error
|
||||
|
||||
```
|
||||
1 | function useFoo(props: {value: {x: string; y: string} | null}) {
|
||||
2 | const value = props.value;
|
||||
> 3 | return createArray(value?.x, value?.y)?.join(', ');
|
||||
| ^^^^^^^^ Todo: Unexpected terminal kind `optional` for optional test block (3:3)
|
||||
4 | }
|
||||
5 |
|
||||
6 | function createArray<T>(...args: Array<T>): Array<T> {
|
||||
2 | function useFoo(props: {value: {x: string; y: string} | null}) {
|
||||
3 | const value = props.value;
|
||||
> 4 | return createArray(value?.x, value?.y)?.join(', ');
|
||||
| ^^^^^^^^ Todo: Unexpected terminal kind `optional` for optional test block (4:4)
|
||||
5 | }
|
||||
6 |
|
||||
7 | function createArray<T>(...args: Array<T>): Array<T> {
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function useFoo(props: {value: {x: string; y: string} | null}) {
|
||||
const value = props.value;
|
||||
return createArray(value?.x, value?.y)?.join(', ');
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const items = (() => {
|
||||
if (props.cond) {
|
||||
|
|
@ -24,11 +25,11 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(3);
|
||||
let items;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.cond || $[1] !== props.a) {
|
||||
let t0;
|
||||
if (props.cond) {
|
||||
t0 = [];
|
||||
|
|
@ -38,10 +39,11 @@ function Component(props) {
|
|||
items = t0;
|
||||
|
||||
items?.push(props.a);
|
||||
$[0] = props;
|
||||
$[1] = items;
|
||||
$[0] = props.cond;
|
||||
$[1] = props.a;
|
||||
$[2] = items;
|
||||
} else {
|
||||
items = $[1];
|
||||
items = $[2];
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const items = (() => {
|
||||
if (props.cond) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
import {makeObject_Primitives} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
@ -25,13 +26,13 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
import { makeObject_Primitives } from "shared-runtime";
|
||||
|
||||
function Component(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(3);
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.cond || $[1] !== props.value) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
const object = makeObject_Primitives();
|
||||
|
|
@ -45,10 +46,11 @@ function Component(props) {
|
|||
break bb0;
|
||||
}
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
$[0] = props.cond;
|
||||
$[1] = props.value;
|
||||
$[2] = t0;
|
||||
} else {
|
||||
t0 = $[1];
|
||||
t0 = $[2];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
import {makeObject_Primitives} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
let x = [];
|
||||
let y = null;
|
||||
|
|
@ -28,12 +29,12 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(4);
|
||||
const $ = _c(6);
|
||||
let y;
|
||||
let t0;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.cond || $[1] !== props.a || $[2] !== props.b) {
|
||||
t0 = Symbol.for("react.early_return_sentinel");
|
||||
bb0: {
|
||||
const x = [];
|
||||
|
|
@ -43,11 +44,11 @@ function Component(props) {
|
|||
break bb0;
|
||||
} else {
|
||||
let t1;
|
||||
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t1 = foo();
|
||||
$[3] = t1;
|
||||
$[5] = t1;
|
||||
} else {
|
||||
t1 = $[3];
|
||||
t1 = $[5];
|
||||
}
|
||||
y = t1;
|
||||
if (props.b) {
|
||||
|
|
@ -56,12 +57,14 @@ function Component(props) {
|
|||
}
|
||||
}
|
||||
}
|
||||
$[0] = props;
|
||||
$[1] = y;
|
||||
$[2] = t0;
|
||||
$[0] = props.cond;
|
||||
$[1] = props.a;
|
||||
$[2] = props.b;
|
||||
$[3] = y;
|
||||
$[4] = t0;
|
||||
} else {
|
||||
y = $[1];
|
||||
t0 = $[2];
|
||||
y = $[3];
|
||||
t0 = $[4];
|
||||
}
|
||||
if (t0 !== Symbol.for("react.early_return_sentinel")) {
|
||||
return t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
let x = [];
|
||||
let y = null;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
import {makeArray} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
@ -45,11 +46,11 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
import { makeArray } from "shared-runtime";
|
||||
|
||||
function Component(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(6);
|
||||
let t0;
|
||||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t0 = {};
|
||||
|
|
@ -59,7 +60,12 @@ function Component(props) {
|
|||
}
|
||||
const x = t0;
|
||||
let t1;
|
||||
if ($[1] !== props) {
|
||||
if (
|
||||
$[1] !== props.cond ||
|
||||
$[2] !== props.cond2 ||
|
||||
$[3] !== props.value ||
|
||||
$[4] !== props.value2
|
||||
) {
|
||||
let y;
|
||||
if (props.cond) {
|
||||
if (props.cond2) {
|
||||
|
|
@ -74,10 +80,13 @@ function Component(props) {
|
|||
y.push(x);
|
||||
|
||||
t1 = [x, y];
|
||||
$[1] = props;
|
||||
$[2] = t1;
|
||||
$[1] = props.cond;
|
||||
$[2] = props.cond2;
|
||||
$[3] = props.value;
|
||||
$[4] = props.value2;
|
||||
$[5] = t1;
|
||||
} else {
|
||||
t1 = $[2];
|
||||
t1 = $[5];
|
||||
}
|
||||
return t1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
import {makeArray} from 'shared-runtime';
|
||||
|
||||
function Component(props) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const x = {};
|
||||
let y;
|
||||
|
|
@ -34,9 +35,9 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(4);
|
||||
let t0;
|
||||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t0 = {};
|
||||
|
|
@ -46,7 +47,7 @@ function Component(props) {
|
|||
}
|
||||
const x = t0;
|
||||
let t1;
|
||||
if ($[1] !== props) {
|
||||
if ($[1] !== props.cond || $[2] !== props.value) {
|
||||
let y;
|
||||
if (props.cond) {
|
||||
y = [props.value];
|
||||
|
|
@ -57,10 +58,11 @@ function Component(props) {
|
|||
y.push(x);
|
||||
|
||||
t1 = [x, y];
|
||||
$[1] = props;
|
||||
$[2] = t1;
|
||||
$[1] = props.cond;
|
||||
$[2] = props.value;
|
||||
$[3] = t1;
|
||||
} else {
|
||||
t1 = $[2];
|
||||
t1 = $[3];
|
||||
}
|
||||
return t1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const x = {};
|
||||
let y;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @debug
|
||||
// @debug @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const x = {};
|
||||
let y;
|
||||
|
|
@ -30,9 +30,9 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime"; // @debug
|
||||
import { c as _c } from "react/compiler-runtime"; // @debug @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(3);
|
||||
const $ = _c(4);
|
||||
let t0;
|
||||
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
||||
t0 = {};
|
||||
|
|
@ -42,7 +42,7 @@ function Component(props) {
|
|||
}
|
||||
const x = t0;
|
||||
let t1;
|
||||
if ($[1] !== props) {
|
||||
if ($[1] !== props.cond || $[2] !== props.a) {
|
||||
let y;
|
||||
if (props.cond) {
|
||||
y = {};
|
||||
|
|
@ -53,10 +53,11 @@ function Component(props) {
|
|||
y.x = x;
|
||||
|
||||
t1 = [x, y];
|
||||
$[1] = props;
|
||||
$[2] = t1;
|
||||
$[1] = props.cond;
|
||||
$[2] = props.a;
|
||||
$[3] = t1;
|
||||
} else {
|
||||
t1 = $[2];
|
||||
t1 = $[3];
|
||||
}
|
||||
return t1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// @debug
|
||||
// @debug @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const x = {};
|
||||
let y;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
return props.post.feedback.comments?.edges?.map(render);
|
||||
}
|
||||
|
|
@ -11,7 +12,7 @@ function Component(props) {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
const $ = _c(2);
|
||||
let t0;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
function Component(props) {
|
||||
return props.post.feedback.comments?.edges?.map(render);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
## Input
|
||||
|
||||
```javascript
|
||||
// @enablePropagateDepsInHIR
|
||||
import {mutate} from 'shared-runtime';
|
||||
|
||||
function useFoo(props) {
|
||||
|
|
@ -35,13 +36,13 @@ export const FIXTURE_ENTRYPOINT = {
|
|||
## Code
|
||||
|
||||
```javascript
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR
|
||||
import { mutate } from "shared-runtime";
|
||||
|
||||
function useFoo(props) {
|
||||
const $ = _c(2);
|
||||
const $ = _c(4);
|
||||
let x;
|
||||
if ($[0] !== props) {
|
||||
if ($[0] !== props.bar || $[1] !== props.cond || $[2] !== props.foo) {
|
||||
x = [];
|
||||
x.push(props.bar);
|
||||
if (props.cond) {
|
||||
|
|
@ -53,10 +54,12 @@ function useFoo(props) {
|
|||
}
|
||||
|
||||
mutate(x);
|
||||
$[0] = props;
|
||||
$[1] = x;
|
||||
$[0] = props.bar;
|
||||
$[1] = props.cond;
|
||||
$[2] = props.foo;
|
||||
$[3] = x;
|
||||
} else {
|
||||
x = $[1];
|
||||
x = $[3];
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// @enablePropagateDepsInHIR
|
||||
import {mutate} from 'shared-runtime';
|
||||
|
||||
function useFoo(props) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user