mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add test for bailouts skipping compilation
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
// @gating @panicThreshold(NONE) @compilationMode(annotation)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
"use forget";
|
||||
someGlobal = "wat";
|
||||
return null;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
// @gating @panicThreshold(NONE) @compilationMode(annotation)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
"use forget";
|
||||
someGlobal = "wat";
|
||||
return null;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// @gating @panicThreshold(NONE) @compilationMode(annotation)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
"use forget";
|
||||
someGlobal = "wat";
|
||||
return null;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
// @gating @panicThreshold(NONE) @compilationMode(infer)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
someGlobal = "wat";
|
||||
return <div>{someGlobal}</div>;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
// @gating @panicThreshold(NONE) @compilationMode(infer)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
someGlobal = "wat";
|
||||
return <div>{someGlobal}</div>;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// @gating @panicThreshold(NONE) @compilationMode(infer)
|
||||
let someGlobal = "joe";
|
||||
|
||||
function Component() {
|
||||
someGlobal = "wat";
|
||||
return <div>{someGlobal}</div>;
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [],
|
||||
};
|
||||
Reference in New Issue
Block a user