[be] Move skipped test to kitchensink
Sathya Gunasekaran committed
Mar 7, 2023 at 16:21 UTC
cf03bac12a2381bf79300e204c06d2397b4bb3f3
4 files changed
+26
-66
compiler/forget/src/__tests__/fixtures/hir/capturing-var-in-nested-func-decl.expect.md
deleted
-50
@@ -1,50 +0,0 @@
1
-
2
-## Input
3
-
4
-```javascript
5
-function component(a) {
6
- let z = { a };
7
- let x = function () {
8
- function t() {
9
- z;
10
- }
11
- t();
12
- };
13
- return x;
14
-}
15
-
16
-```
17
-
18
-## Code
19
-
20
-```javascript
21
-function component(a) {
22
- const $ = React.useMemoCache();
23
- const c_0 = $[0] !== a;
24
- let z;
25
- if (c_0) {
26
- z = { a: a };
27
- $[0] = a;
28
- $[1] = z;
29
- } else {
30
- z = $[1];
31
- }
32
- const c_2 = $[2] !== z;
33
- let x;
34
- if (c_2) {
35
- x = function () {
36
- function t() {
37
- z;
38
- }
39
- t();
40
- };
41
- $[2] = z;
42
- $[3] = x;
43
- } else {
44
- x = $[3];
45
- }
46
- return x;
47
-}
48
-
49
-```
50
-
\ No newline at end of file
compiler/forget/src/__tests__/fixtures/hir/capturing-var-in-nested-func-decl.js
deleted
-11
@@ -1,11 +0,0 @@
1
-// @skip -- TODO: support lowering Function Declaration in HIR
2
-function component(a) {
3
- let z = { a };
4
- let x = function () {
5
- function t() {
6
- z;
7
- }
8
- t();
9
- };
10
- return x;
11
-}
compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.expect.md
+20
-5
@@ -67,6 +67,12 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
67
// Cannot assign to globals
68
someUnknownGlobal = true;
69
moduleLocal = true;
70
+
71
+ function component(a) {
72
+ // Add support for function declarations once we support `var` hoisting.
73
+ function t() {}
74
+ t();
75
+ }
76
}
77
78
let moduleLocal = false;
@@ -363,17 +369,26 @@ let moduleLocal = false;
369
> 64 | someUnknownGlobal = true;
370
| ^^^^^^^^^^^^^^^^^
371
65 | moduleLocal = true;
366
- 66 | }
367
- 67 |
372
+ 66 |
373
+ 67 | function component(a) {
374
375
[ReactForget] InvalidInputError: (BuildHIR::lowerAssignment) Assigning to an identifier defined outside the function scope is not supported.
376
63 | // Cannot assign to globals
377
64 | someUnknownGlobal = true;
378
> 65 | moduleLocal = true;
379
| ^^^^^^^^^^^
374
- 66 | }
375
- 67 |
376
- 68 | let moduleLocal = false;
380
+ 66 |
381
+ 67 | function component(a) {
382
+ 68 | // Add support for function declarations once we support `var` hoisting.
383
+
384
+[ReactForget] TodoError: (BuildHIR::lowerStatement) Handle FunctionDeclaration statements
385
+ 65 | moduleLocal = true;
386
+ 66 |
387
+> 67 | function component(a) {
388
+ | ^
389
+ 68 | // Add support for function declarations once we support `var` hoisting.
390
+ 69 | function t() {}
391
+ 70 | t();
392
```
393
394
\ No newline at end of file
compiler/forget/src/__tests__/fixtures/hir/error.todo-kitchensink.js
+6
@@ -63,6 +63,12 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
63
// Cannot assign to globals
64
someUnknownGlobal = true;
65
moduleLocal = true;
66
+
67
+ function component(a) {
68
+ // Add support for function declarations once we support `var` hoisting.
69
+ function t() {}
70
+ t();
71
+ }
72
}
73
74
let moduleLocal = false;