-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ghstack-poisoned]
- Loading branch information
Showing
10 changed files
with
182 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
...r/src/__tests__/fixtures/compiler/bug-try-catch-maybe-null-dependency.expect.md
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...gin-react-compiler/src/__tests__/fixtures/compiler/bug-try-catch-maybe-null-dependency.ts
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
...ompiler/propagate-scope-deps-hir-fork/try-catch-maybe-null-dependency.expect.md
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...ests__/fixtures/compiler/propagate-scope-deps-hir-fork/try-catch-maybe-null-dependency.ts
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
...te-scope-deps-hir-fork/try-catch-try-value-modified-in-catch-escaping.expect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
// @enablePropagateDepsInHIR | ||
const {throwInput} = require('shared-runtime'); | ||
|
||
function Component(props) { | ||
let x; | ||
try { | ||
const y = []; | ||
y.push(props.y); | ||
throwInput(y); | ||
} catch (e) { | ||
e.push(props.e); | ||
x = e; | ||
} | ||
return x; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{y: 'foo', e: 'bar'}], | ||
}; | ||
|
||
``` | ||
|
||
## Code | ||
|
||
```javascript | ||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR | ||
const { throwInput } = require("shared-runtime"); | ||
|
||
function Component(props) { | ||
const $ = _c(2); | ||
let x; | ||
if ($[0] !== props) { | ||
try { | ||
const y = []; | ||
y.push(props.y); | ||
throwInput(y); | ||
} catch (t0) { | ||
const e = t0; | ||
e.push(props.e); | ||
x = e; | ||
} | ||
$[0] = props; | ||
$[1] = x; | ||
} else { | ||
x = $[1]; | ||
} | ||
return x; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ y: "foo", e: "bar" }], | ||
}; | ||
|
||
``` | ||
### Eval output | ||
(kind: ok) ["foo","bar"] |
20 changes: 20 additions & 0 deletions
20
.../compiler/propagate-scope-deps-hir-fork/try-catch-try-value-modified-in-catch-escaping.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// @enablePropagateDepsInHIR | ||
const {throwInput} = require('shared-runtime'); | ||
|
||
function Component(props) { | ||
let x; | ||
try { | ||
const y = []; | ||
y.push(props.y); | ||
throwInput(y); | ||
} catch (e) { | ||
e.push(props.e); | ||
x = e; | ||
} | ||
return x; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{y: 'foo', e: 'bar'}], | ||
}; |
69 changes: 69 additions & 0 deletions
69
...r/propagate-scope-deps-hir-fork/try-catch-try-value-modified-in-catch.expect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
// @enablePropagateDepsInHIR | ||
const {throwInput} = require('shared-runtime'); | ||
|
||
function Component(props) { | ||
try { | ||
const y = []; | ||
y.push(props.y); | ||
throwInput(y); | ||
} catch (e) { | ||
e.push(props.e); | ||
return e; | ||
} | ||
return null; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{y: 'foo', e: 'bar'}], | ||
}; | ||
|
||
``` | ||
|
||
## Code | ||
|
||
```javascript | ||
import { c as _c } from "react/compiler-runtime"; // @enablePropagateDepsInHIR | ||
const { throwInput } = require("shared-runtime"); | ||
|
||
function Component(props) { | ||
const $ = _c(2); | ||
let t0; | ||
if ($[0] !== props) { | ||
t0 = Symbol.for("react.early_return_sentinel"); | ||
bb0: { | ||
try { | ||
const y = []; | ||
y.push(props.y); | ||
throwInput(y); | ||
} catch (t1) { | ||
const e = t1; | ||
e.push(props.e); | ||
t0 = e; | ||
break bb0; | ||
} | ||
} | ||
$[0] = props; | ||
$[1] = t0; | ||
} else { | ||
t0 = $[1]; | ||
} | ||
if (t0 !== Symbol.for("react.early_return_sentinel")) { | ||
return t0; | ||
} | ||
return null; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ y: "foo", e: "bar" }], | ||
}; | ||
|
||
``` | ||
### Eval output | ||
(kind: ok) ["foo","bar"] |
Oops, something went wrong.