[sprout] codemod for tests that can be run out of the box
Mofei Zhang committed
Aug 14, 2023 at 19:26 UTC
904ea6c9e44a276a43462b591f2be43dfe6d2658
94 files changed
+705
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-nested-member-path.expect.md
+10
@@ -11,6 +11,11 @@ function component() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: component,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -46,5 +51,10 @@ function component() {
51
return x;
52
}
53
54
+export const FIXTURE_ENTRYPOINT = {
55
+ fn: component,
56
+ params: [],
57
+};
58
+
59
```
60
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-nested-member-path.js
+5
@@ -6,3 +6,8 @@ function component() {
6
x.y = y;
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: component,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md
+10
@@ -9,6 +9,11 @@ function foo() {
9
return a;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: foo,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -37,5 +42,10 @@ function foo() {
42
return a;
43
}
44
45
+export const FIXTURE_ENTRYPOINT = {
46
+ fn: foo,
47
+ params: [],
48
+};
49
+
50
```
51
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.js
+5
@@ -4,3 +4,8 @@ function foo() {
4
first.set(0, 2);
5
return a;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: foo,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue.expect.md
+10
@@ -9,6 +9,11 @@ function g() {
9
return x;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: g,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -29,5 +34,10 @@ function g() {
34
return x;
35
}
36
37
+export const FIXTURE_ENTRYPOINT = {
38
+ fn: g,
39
+ params: [],
40
+};
41
+
42
```
43
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue.js
+5
@@ -4,3 +4,8 @@ function g() {
4
x.y.z *= 2;
5
return x;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: g,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations.expect.md
+10
@@ -10,6 +10,11 @@ function f() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: f,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -20,5 +25,10 @@ function f() {
25
return x;
26
}
27
28
+export const FIXTURE_ENTRYPOINT = {
29
+ fn: f,
30
+ params: [],
31
+};
32
+
33
```
34
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations.js
+5
@@ -5,3 +5,8 @@ function f() {
5
x >>>= 1;
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: f,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/chained-assignment-expressions.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return z;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -33,5 +38,10 @@ function foo() {
38
return z;
39
}
40
41
+export const FIXTURE_ENTRYPOINT = {
42
+ fn: foo,
43
+ params: [],
44
+};
45
+
46
```
47
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/chained-assignment-expressions.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
z.z += y.y *= x.x &= 3;
7
return z;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.expect.md
+10
@@ -17,6 +17,11 @@ function Component() {
17
return x;
18
}
19
20
+export const FIXTURE_ENTRYPOINT = {
21
+ fn: Component,
22
+ params: [],
23
+};
24
+
25
```
26
27
## Code
@@ -56,5 +61,10 @@ function Component() {
61
return x;
62
}
63
64
+export const FIXTURE_ENTRYPOINT = {
65
+ fn: Component,
66
+ params: [],
67
+};
68
+
69
```
70
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/computed-call-evaluation-order.js
+5
@@ -12,3 +12,8 @@ function Component() {
12
);
13
return x;
14
}
15
+
16
+export const FIXTURE_ENTRYPOINT = {
17
+ fn: Component,
18
+ params: [],
19
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/const-propagation-into-function-expression-primitive.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -25,5 +30,10 @@ function foo() {
30
return 42;
31
}
32
33
+export const FIXTURE_ENTRYPOINT = {
34
+ fn: foo,
35
+ params: [],
36
+};
37
+
38
```
39
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/const-propagation-into-function-expression-primitive.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
f();
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation-for.expect.md
+10
@@ -10,6 +10,11 @@ function foo() {
10
return y;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: foo,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -23,5 +28,10 @@ function foo() {
28
return y;
29
}
30
31
+export const FIXTURE_ENTRYPOINT = {
32
+ fn: foo,
33
+ params: [],
34
+};
35
+
36
```
37
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation-for.js
+5
@@ -5,3 +5,8 @@ function foo() {
5
}
6
return y;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: foo,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation-while.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return y;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -24,5 +29,10 @@ function foo() {
29
return y;
30
}
31
32
+export const FIXTURE_ENTRYPOINT = {
33
+ fn: foo,
34
+ params: [],
35
+};
36
+
37
```
38
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation-while.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
}
7
return y;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation.expect.md
+10
@@ -21,6 +21,11 @@ function foo() {
21
return j;
22
}
23
24
+export const FIXTURE_ENTRYPOINT = {
25
+ fn: foo,
26
+ params: [],
27
+};
28
+
29
```
30
31
## Code
@@ -31,5 +36,10 @@ function foo() {
36
return -6;
37
}
38
39
+export const FIXTURE_ENTRYPOINT = {
40
+ fn: foo,
41
+ params: [],
42
+};
43
+
44
```
45
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/constant-propagation.js
+5
@@ -16,3 +16,8 @@ function foo() {
16
const j = i;
17
return j;
18
}
19
+
20
+export const FIXTURE_ENTRYPOINT = {
21
+ fn: foo,
22
+ params: [],
23
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/do-while-continue.expect.md
+10
@@ -16,6 +16,11 @@ function Component() {
16
return ret;
17
}
18
19
+export const FIXTURE_ENTRYPOINT = {
20
+ fn: Component,
21
+ params: [],
22
+};
23
+
24
```
25
26
## Code
@@ -43,5 +48,10 @@ function Component() {
48
return ret;
49
}
50
51
+export const FIXTURE_ENTRYPOINT = {
52
+ fn: Component,
53
+ params: [],
54
+};
55
+
56
```
57
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/do-while-continue.js
+5
@@ -11,3 +11,8 @@ function Component() {
11
12
return ret;
13
}
14
+
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: Component,
17
+ params: [],
18
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/do-while-simple.expect.md
+10
@@ -12,6 +12,11 @@ function Component() {
12
return ret;
13
}
14
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: Component,
17
+ params: [],
18
+};
19
+
20
```
21
22
## Code
@@ -35,5 +40,10 @@ function Component() {
40
return ret;
41
}
42
43
+export const FIXTURE_ENTRYPOINT = {
44
+ fn: Component,
45
+ params: [],
46
+};
47
+
48
```
49
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/do-while-simple.js
+5
@@ -7,3 +7,8 @@ function Component() {
7
} while (x.length);
8
return ret;
9
}
10
+
11
+export const FIXTURE_ENTRYPOINT = {
12
+ fn: Component,
13
+ params: [],
14
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/expression-with-assignment.expect.md
+10
@@ -7,6 +7,11 @@ function f() {
7
return x + (x = 2) + x;
8
}
9
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: f,
12
+ params: [],
13
+};
14
+
15
```
16
17
## Code
@@ -16,5 +21,10 @@ function f() {
21
return 5;
22
}
23
24
+export const FIXTURE_ENTRYPOINT = {
25
+ fn: f,
26
+ params: [],
27
+};
28
+
29
```
30
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/expression-with-assignment.js
+5
@@ -2,3 +2,8 @@ function f() {
2
let x = 1;
3
return x + (x = 2) + x;
4
}
5
+
6
+export const FIXTURE_ENTRYPOINT = {
7
+ fn: f,
8
+ params: [],
9
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-break.expect.md
+10
@@ -10,6 +10,11 @@ function Component() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: Component,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -32,5 +37,10 @@ function Component() {
37
return x;
38
}
39
40
+export const FIXTURE_ENTRYPOINT = {
41
+ fn: Component,
42
+ params: [],
43
+};
44
+
45
```
46
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-break.js
+5
@@ -5,3 +5,8 @@ function Component() {
5
}
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: Component,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-conditional-break.expect.md
+10
@@ -13,6 +13,11 @@ function Component() {
13
return x;
14
}
15
16
+export const FIXTURE_ENTRYPOINT = {
17
+ fn: Component,
18
+ params: [],
19
+};
20
+
21
```
22
23
## Code
@@ -45,5 +50,10 @@ function Component() {
50
return x;
51
}
52
53
+export const FIXTURE_ENTRYPOINT = {
54
+ fn: Component,
55
+ params: [],
56
+};
57
+
58
```
59
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-conditional-break.js
+5
@@ -8,3 +8,8 @@ function Component() {
8
}
9
return x;
10
}
11
+
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: Component,
14
+ params: [],
15
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-continue.expect.md
+10
@@ -14,6 +14,11 @@ function Component() {
14
return ret;
15
}
16
17
+export const FIXTURE_ENTRYPOINT = {
18
+ fn: Component,
19
+ params: [],
20
+};
21
+
22
```
23
24
## Code
@@ -47,5 +52,10 @@ function Component() {
52
return ret;
53
}
54
55
+export const FIXTURE_ENTRYPOINT = {
56
+ fn: Component,
57
+ params: [],
58
+};
59
+
60
```
61
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-continue.js
+5
@@ -9,3 +9,8 @@ function Component() {
9
}
10
return ret;
11
}
12
+
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: Component,
15
+ params: [],
16
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-destructure.expect.md
+10
@@ -11,6 +11,11 @@ function Component() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: Component,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -33,5 +38,10 @@ function Component() {
38
return x;
39
}
40
41
+export const FIXTURE_ENTRYPOINT = {
42
+ fn: Component,
43
+ params: [],
44
+};
45
+
46
```
47
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-destructure.js
+5
@@ -6,3 +6,8 @@ function Component() {
6
}
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: Component,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-simple.expect.md
+10
@@ -11,6 +11,11 @@ function Component() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: Component,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -33,5 +38,10 @@ function Component() {
38
return x;
39
}
40
41
+export const FIXTURE_ENTRYPOINT = {
42
+ fn: Component,
43
+ params: [],
44
+};
45
+
46
```
47
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-of-simple.js
+5
@@ -6,3 +6,8 @@ function Component() {
6
}
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: Component,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.expect.md
+10
@@ -10,6 +10,11 @@ function component() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: component,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -39,5 +44,10 @@ function component() {
44
return x;
45
}
46
47
+export const FIXTURE_ENTRYPOINT = {
48
+ fn: component,
49
+ params: [],
50
+};
51
+
52
```
53
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-reassign.js
+5
@@ -5,3 +5,8 @@ function component() {
5
x = {};
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: component,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-redeclare.expect.md
+10
@@ -10,6 +10,11 @@ function component() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: component,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -29,5 +34,10 @@ function component() {
34
return x;
35
}
36
37
+export const FIXTURE_ENTRYPOINT = {
38
+ fn: component,
39
+ params: [],
40
+};
41
+
42
```
43
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/function-declaration-redeclare.js
+5
@@ -5,3 +5,8 @@ function component() {
5
function x() {}
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: component,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-reassign-primitive.expect.md
+10
@@ -17,6 +17,11 @@ function Component() {
17
return x;
18
}
19
20
+export const FIXTURE_ENTRYPOINT = {
21
+ fn: Component,
22
+ params: [],
23
+};
24
+
25
```
26
27
## Code
@@ -45,5 +50,10 @@ function Component() {
50
return x;
51
}
52
53
+export const FIXTURE_ENTRYPOINT = {
54
+ fn: Component,
55
+ params: [],
56
+};
57
+
58
```
59
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-reassign-primitive.js
+5
@@ -12,3 +12,8 @@ function Component() {
12
fn();
13
return x;
14
}
15
+
16
+export const FIXTURE_ENTRYPOINT = {
17
+ fn: Component,
18
+ params: [],
19
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.expect.md
+10
@@ -14,6 +14,11 @@ function Component() {
14
return x; // should return {}
15
}
16
17
+export const FIXTURE_ENTRYPOINT = {
18
+ fn: Component,
19
+ params: [],
20
+};
21
+
22
```
23
24
## Code
@@ -41,5 +46,10 @@ function Component() {
46
return x;
47
}
48
49
+export const FIXTURE_ENTRYPOINT = {
50
+ fn: Component,
51
+ params: [],
52
+};
53
+
54
```
55
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-reassign-shadowed-primitive.js
+5
@@ -9,3 +9,8 @@ function Component() {
9
}
10
return x; // should return {}
11
}
12
+
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: Component,
15
+ params: [],
16
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/property-call-evaluation-order.expect.md
+10
@@ -16,6 +16,11 @@ function Component() {
16
return x;
17
}
18
19
+export const FIXTURE_ENTRYPOINT = {
20
+ fn: Component,
21
+ params: [],
22
+};
23
+
24
```
25
26
## Code
@@ -54,5 +59,10 @@ function Component() {
59
return x;
60
}
61
62
+export const FIXTURE_ENTRYPOINT = {
63
+ fn: Component,
64
+ params: [],
65
+};
66
+
67
```
68
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/property-call-evaluation-order.js
+5
@@ -11,3 +11,8 @@ function Component() {
11
(console.log("A"), x).f((changeF(x), console.log("arg"), 1));
12
return x;
13
}
14
+
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: Component,
17
+ params: [],
18
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-scope-grouping.expect.md
+10
@@ -12,6 +12,11 @@ function foo() {
12
return x;
13
}
14
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: foo,
17
+ params: [],
18
+};
19
+
20
```
21
22
## Code
@@ -47,5 +52,10 @@ function foo() {
52
return x;
53
}
54
55
+export const FIXTURE_ENTRYPOINT = {
56
+ fn: foo,
57
+ params: [],
58
+};
59
+
60
```
61
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-scope-grouping.js
+5
@@ -7,3 +7,8 @@ function foo() {
7
8
return x;
9
}
10
+
11
+export const FIXTURE_ENTRYPOINT = {
12
+ fn: foo,
13
+ params: [],
14
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/sequentially-constant-progagatable-if-test-conditions.expect.md
+10
@@ -37,6 +37,11 @@ function Component() {
37
return e;
38
}
39
40
+export const FIXTURE_ENTRYPOINT = {
41
+ fn: Component,
42
+ params: [],
43
+};
44
+
45
```
46
47
## Code
@@ -46,5 +51,10 @@ function Component() {
51
return "ok";
52
}
53
54
+export const FIXTURE_ENTRYPOINT = {
55
+ fn: Component,
56
+ params: [],
57
+};
58
+
59
```
60
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/sequentially-constant-progagatable-if-test-conditions.js
+5
@@ -32,3 +32,8 @@ function Component() {
32
// should constant-propagate to "ok"
33
return e;
34
}
35
+
36
+export const FIXTURE_ENTRYPOINT = {
37
+ fn: Component,
38
+ params: [],
39
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/simple-function-1.expect.md
+10
@@ -9,6 +9,11 @@ function component() {
9
return x;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: component,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -30,5 +35,10 @@ function component() {
35
return x;
36
}
37
38
+export const FIXTURE_ENTRYPOINT = {
39
+ fn: component,
40
+ params: [],
41
+};
42
+
43
```
44
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/simple-function-1.js
+5
@@ -4,3 +4,8 @@ function component() {
4
};
5
return x;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: component,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/sketchy-code-rules-of-hooks.expect.md
+10
@@ -9,6 +9,11 @@ function lowercasecomponent() {
9
}
10
/* eslint-enable react-hooks/rules-of-hooks */
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: lowercasecomponent,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -21,5 +26,10 @@ function lowercasecomponent() {
26
}
27
/* eslint-enable react-hooks/rules-of-hooks */
28
29
+export const FIXTURE_ENTRYPOINT = {
30
+ fn: lowercasecomponent,
31
+ params: [],
32
+};
33
+
34
```
35
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/sketchy-code-rules-of-hooks.js
+5
@@ -4,3 +4,8 @@ function lowercasecomponent() {
4
return <div>{x}</div>;
5
}
6
/* eslint-enable react-hooks/rules-of-hooks */
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: lowercasecomponent,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-complex-multiple-if.expect.md
+10
@@ -15,6 +15,11 @@ function foo() {
15
y = x;
16
}
17
18
+export const FIXTURE_ENTRYPOINT = {
19
+ fn: foo,
20
+ params: [],
21
+};
22
+
23
```
24
25
## Code
@@ -22,5 +27,10 @@ function foo() {
27
```javascript
28
function foo() {}
29
30
+export const FIXTURE_ENTRYPOINT = {
31
+ fn: foo,
32
+ params: [],
33
+};
34
+
35
```
36
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-complex-multiple-if.js
+5
@@ -10,3 +10,8 @@ function foo() {
10
}
11
y = x;
12
}
13
+
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-complex-single-if.expect.md
+10
@@ -12,6 +12,11 @@ function foo() {
12
y = x;
13
}
14
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: foo,
17
+ params: [],
18
+};
19
+
20
```
21
22
## Code
@@ -19,5 +24,10 @@ function foo() {
24
```javascript
25
function foo() {}
26
27
+export const FIXTURE_ENTRYPOINT = {
28
+ fn: foo,
29
+ params: [],
30
+};
31
+
32
```
33
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-complex-single-if.js
+5
@@ -7,3 +7,8 @@ function foo() {
7
8
y = x;
9
}
10
+
11
+export const FIXTURE_ENTRYPOINT = {
12
+ fn: foo,
13
+ params: [],
14
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-for-trivial-update.expect.md
+10
@@ -10,6 +10,11 @@ function foo() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: foo,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -23,5 +28,10 @@ function foo() {
28
return x;
29
}
30
31
+export const FIXTURE_ENTRYPOINT = {
32
+ fn: foo,
33
+ params: [],
34
+};
35
+
36
```
37
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-for-trivial-update.js
+5
@@ -5,3 +5,8 @@ function foo() {
5
}
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: foo,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-for.expect.md
+10
@@ -10,6 +10,11 @@ function foo() {
10
return x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: foo,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -23,5 +28,10 @@ function foo() {
28
return x;
29
}
30
31
+export const FIXTURE_ENTRYPOINT = {
32
+ fn: foo,
33
+ params: [],
34
+};
35
+
36
```
37
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-for.js
+5
@@ -5,3 +5,8 @@ function foo() {
5
}
6
return x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: foo,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-if-else.expect.md
+10
@@ -13,6 +13,11 @@ function foo() {
13
}
14
}
15
16
+export const FIXTURE_ENTRYPOINT = {
17
+ fn: foo,
18
+ params: [],
19
+};
20
+
21
```
22
23
## Code
@@ -20,5 +25,10 @@ function foo() {
25
```javascript
26
function foo() {}
27
28
+export const FIXTURE_ENTRYPOINT = {
29
+ fn: foo,
30
+ params: [],
31
+};
32
+
33
```
34
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-if-else.js
+5
@@ -8,3 +8,8 @@ function foo() {
8
let z = x;
9
}
10
}
11
+
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: foo,
14
+ params: [],
15
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-objectexpression-phi.expect.md
+10
@@ -16,6 +16,11 @@ function foo() {
16
return t;
17
}
18
19
+export const FIXTURE_ENTRYPOINT = {
20
+ fn: foo,
21
+ params: [],
22
+};
23
+
24
```
25
26
## Code
@@ -35,5 +40,10 @@ function foo() {
40
return t;
41
}
42
43
+export const FIXTURE_ENTRYPOINT = {
44
+ fn: foo,
45
+ params: [],
46
+};
47
+
48
```
49
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-objectexpression-phi.js
+5
@@ -11,3 +11,8 @@ function foo() {
11
let t = { x: x, y: y };
12
return t;
13
}
14
+
15
+export const FIXTURE_ENTRYPOINT = {
16
+ fn: foo,
17
+ params: [],
18
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-property-call.expect.md
+10
@@ -9,6 +9,11 @@ function foo() {
9
return y;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: foo,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -29,5 +34,10 @@ function foo() {
34
return y;
35
}
36
37
+export const FIXTURE_ENTRYPOINT = {
38
+ fn: foo,
39
+ params: [],
40
+};
41
+
42
```
43
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-property-call.js
+5
@@ -4,3 +4,8 @@ function foo() {
4
y.x.push([]);
5
return y;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: foo,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-property.expect.md
+10
@@ -9,6 +9,11 @@ function foo() {
9
return y;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: foo,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -36,5 +41,10 @@ function foo() {
41
return y;
42
}
43
44
+export const FIXTURE_ENTRYPOINT = {
45
+ fn: foo,
46
+ params: [],
47
+};
48
+
49
```
50
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-property.js
+5
@@ -4,3 +4,8 @@ function foo() {
4
y.x = x;
5
return y;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: foo,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-return.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -20,5 +25,10 @@ function foo() {
25
return 2;
26
}
27
28
+export const FIXTURE_ENTRYPOINT = {
29
+ fn: foo,
30
+ params: [],
31
+};
32
+
33
```
34
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-return.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-simple-phi.expect.md
+10
@@ -14,6 +14,11 @@ function foo() {
14
let x = y;
15
}
16
17
+export const FIXTURE_ENTRYPOINT = {
18
+ fn: foo,
19
+ params: [],
20
+};
21
+
22
```
23
24
## Code
@@ -21,5 +26,10 @@ function foo() {
26
```javascript
27
function foo() {}
28
29
+export const FIXTURE_ENTRYPOINT = {
30
+ fn: foo,
31
+ params: [],
32
+};
33
+
34
```
35
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-simple-phi.js
+5
@@ -9,3 +9,8 @@ function foo() {
9
10
let x = y;
11
}
12
+
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: foo,
15
+ params: [],
16
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-simple.expect.md
+10
@@ -7,6 +7,11 @@ function foo() {
7
let y = 2;
8
}
9
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
14
+
15
```
16
17
## Code
@@ -14,5 +19,10 @@ function foo() {
19
```javascript
20
function foo() {}
21
22
+export const FIXTURE_ENTRYPOINT = {
23
+ fn: foo,
24
+ params: [],
25
+};
26
+
27
```
28
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-simple.js
+5
@@ -2,3 +2,8 @@ function foo() {
2
let x = 1;
3
let y = 2;
4
}
5
+
6
+export const FIXTURE_ENTRYPOINT = {
7
+ fn: foo,
8
+ params: [],
9
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-single-if.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
}
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -18,5 +23,10 @@ function foo() {
23
```javascript
24
function foo() {}
25
26
+export const FIXTURE_ENTRYPOINT = {
27
+ fn: foo,
28
+ params: [],
29
+};
30
+
31
```
32
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-single-if.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
let z = x + y;
7
}
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-switch.expect.md
+10
@@ -22,6 +22,11 @@ function foo() {
22
let y = x;
23
}
24
25
+export const FIXTURE_ENTRYPOINT = {
26
+ fn: foo,
27
+ params: [],
28
+};
29
+
30
```
31
32
## Code
@@ -40,5 +45,10 @@ function foo() {
45
}
46
}
47
48
+export const FIXTURE_ENTRYPOINT = {
49
+ fn: foo,
50
+ params: [],
51
+};
52
+
53
```
54
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-switch.js
+5
@@ -17,3 +17,8 @@ function foo() {
17
18
let y = x;
19
}
20
+
21
+export const FIXTURE_ENTRYPOINT = {
22
+ fn: foo,
23
+ params: [],
24
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-throw.expect.md
+10
@@ -10,6 +10,11 @@ function foo() {
10
throw x;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: foo,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -19,5 +24,10 @@ function foo() {
24
throw 2;
25
}
26
27
+export const FIXTURE_ENTRYPOINT = {
28
+ fn: foo,
29
+ params: [],
30
+};
31
+
32
```
33
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-throw.js
+5
@@ -5,3 +5,8 @@ function foo() {
5
}
6
throw x;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: foo,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-while-no-reassign.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -21,5 +26,10 @@ function foo() {
26
return 1;
27
}
28
29
+export const FIXTURE_ENTRYPOINT = {
30
+ fn: foo,
31
+ params: [],
32
+};
33
+
34
```
35
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-while-no-reassign.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-while.expect.md
+10
@@ -11,6 +11,11 @@ function foo() {
11
return x;
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: foo,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -24,5 +29,10 @@ function foo() {
29
return x;
30
}
31
32
+export const FIXTURE_ENTRYPOINT = {
33
+ fn: foo,
34
+ params: [],
35
+};
36
+
37
```
38
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/ssa-while.js
+5
@@ -6,3 +6,8 @@ function foo() {
6
7
return x;
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: foo,
12
+ params: [],
13
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-field-load.expect.md
+10
@@ -8,6 +8,11 @@ function component() {
8
return p;
9
}
10
11
+export const FIXTURE_ENTRYPOINT = {
12
+ fn: component,
13
+ params: [],
14
+};
15
+
16
```
17
18
## Code
@@ -28,5 +33,10 @@ function component() {
33
return p;
34
}
35
36
+export const FIXTURE_ENTRYPOINT = {
37
+ fn: component,
38
+ params: [],
39
+};
40
+
41
```
42
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-field-load.js
+5
@@ -3,3 +3,8 @@ function component() {
3
let p = x.t;
4
return p;
5
}
6
+
7
+export const FIXTURE_ENTRYPOINT = {
8
+ fn: component,
9
+ params: [],
10
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-test-field-store.expect.md
+10
@@ -10,6 +10,11 @@ function component() {
10
return z;
11
}
12
13
+export const FIXTURE_ENTRYPOINT = {
14
+ fn: component,
15
+ params: [],
16
+};
17
+
18
```
19
20
## Code
@@ -38,5 +43,10 @@ function component() {
43
return z;
44
}
45
46
+export const FIXTURE_ENTRYPOINT = {
47
+ fn: component,
48
+ params: [],
49
+};
50
+
51
```
52
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-test-field-store.js
+5
@@ -5,3 +5,8 @@ function component() {
5
let z = x.t;
6
return z;
7
}
8
+
9
+export const FIXTURE_ENTRYPOINT = {
10
+ fn: component,
11
+ params: [],
12
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-test-primitive.expect.md
+10
@@ -9,6 +9,11 @@ function component() {
9
return y;
10
}
11
12
+export const FIXTURE_ENTRYPOINT = {
13
+ fn: component,
14
+ params: [],
15
+};
16
+
17
```
18
19
## Code
@@ -18,5 +23,10 @@ function component() {
23
return 2;
24
}
25
26
+export const FIXTURE_ENTRYPOINT = {
27
+ fn: component,
28
+ params: [],
29
+};
30
+
31
```
32
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/type-test-primitive.js
+5
@@ -4,3 +4,8 @@ function component() {
4
5
return y;
6
}
7
+
8
+export const FIXTURE_ENTRYPOINT = {
9
+ fn: component,
10
+ params: [],
11
+};
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/update-expression-constant-propagation.expect.md
+10
@@ -11,6 +11,11 @@ function Component() {
11
return { a, b, c, d, e };
12
}
13
14
+export const FIXTURE_ENTRYPOINT = {
15
+ fn: Component,
16
+ params: [],
17
+};
18
+
19
```
20
21
## Code
@@ -29,5 +34,10 @@ function Component() {
34
return t0;
35
}
36
37
+export const FIXTURE_ENTRYPOINT = {
38
+ fn: Component,
39
+ params: [],
40
+};
41
+
42
```
43
\ No newline at end of file
compiler/forget/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/update-expression-constant-propagation.js
+5
@@ -6,3 +6,8 @@ function Component() {
6
const e = --a;
7
return { a, b, c, d, e };
8
}
9
+
10
+export const FIXTURE_ENTRYPOINT = {
11
+ fn: Component,
12
+ params: [],
13
+};