mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[be] Move skipped test to kitchensink
This commit is contained in:
-50
@@ -1,50 +0,0 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
function component(a) {
|
||||
let z = { a };
|
||||
let x = function () {
|
||||
function t() {
|
||||
z;
|
||||
}
|
||||
t();
|
||||
};
|
||||
return x;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function component(a) {
|
||||
const $ = React.useMemoCache();
|
||||
const c_0 = $[0] !== a;
|
||||
let z;
|
||||
if (c_0) {
|
||||
z = { a: a };
|
||||
$[0] = a;
|
||||
$[1] = z;
|
||||
} else {
|
||||
z = $[1];
|
||||
}
|
||||
const c_2 = $[2] !== z;
|
||||
let x;
|
||||
if (c_2) {
|
||||
x = function () {
|
||||
function t() {
|
||||
z;
|
||||
}
|
||||
t();
|
||||
};
|
||||
$[2] = z;
|
||||
$[3] = x;
|
||||
} else {
|
||||
x = $[3];
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// @skip -- TODO: support lowering Function Declaration in HIR
|
||||
function component(a) {
|
||||
let z = { a };
|
||||
let x = function () {
|
||||
function t() {
|
||||
z;
|
||||
}
|
||||
t();
|
||||
};
|
||||
return x;
|
||||
}
|
||||
@@ -67,6 +67,12 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
|
||||
// Cannot assign to globals
|
||||
someUnknownGlobal = true;
|
||||
moduleLocal = true;
|
||||
|
||||
function component(a) {
|
||||
// Add support for function declarations once we support `var` hoisting.
|
||||
function t() {}
|
||||
t();
|
||||
}
|
||||
}
|
||||
|
||||
let moduleLocal = false;
|
||||
@@ -363,17 +369,26 @@ let moduleLocal = false;
|
||||
> 64 | someUnknownGlobal = true;
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
65 | moduleLocal = true;
|
||||
66 | }
|
||||
67 |
|
||||
66 |
|
||||
67 | function component(a) {
|
||||
|
||||
[ReactForget] InvalidInputError: (BuildHIR::lowerAssignment) Assigning to an identifier defined outside the function scope is not supported.
|
||||
63 | // Cannot assign to globals
|
||||
64 | someUnknownGlobal = true;
|
||||
> 65 | moduleLocal = true;
|
||||
| ^^^^^^^^^^^
|
||||
66 | }
|
||||
67 |
|
||||
68 | let moduleLocal = false;
|
||||
66 |
|
||||
67 | function component(a) {
|
||||
68 | // Add support for function declarations once we support `var` hoisting.
|
||||
|
||||
[ReactForget] TodoError: (BuildHIR::lowerStatement) Handle FunctionDeclaration statements
|
||||
65 | moduleLocal = true;
|
||||
66 |
|
||||
> 67 | function component(a) {
|
||||
| ^
|
||||
68 | // Add support for function declarations once we support `var` hoisting.
|
||||
69 | function t() {}
|
||||
70 | t();
|
||||
```
|
||||
|
||||
|
||||
@@ -63,6 +63,12 @@ function foo([a, b], { c, d, e = "e" }, f = "f", ...args) {
|
||||
// Cannot assign to globals
|
||||
someUnknownGlobal = true;
|
||||
moduleLocal = true;
|
||||
|
||||
function component(a) {
|
||||
// Add support for function declarations once we support `var` hoisting.
|
||||
function t() {}
|
||||
t();
|
||||
}
|
||||
}
|
||||
|
||||
let moduleLocal = false;
|
||||
|
||||
Reference in New Issue
Block a user