-
Notifications
You must be signed in to change notification settings - Fork 47.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler][ez] Add entrypoints to ssa fixtures
ghstack-source-id: 05300a99db03e037f42671300587080390cd972a Pull Request resolved: #30948
- Loading branch information
Showing
27 changed files
with
415 additions
and
109 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
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
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
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
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
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
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
16 changes: 14 additions & 2 deletions
16
...ompiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction-with-mutation.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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
function foo(props) { | ||
import { mutate } from "shared-runtime"; | ||
|
||
function useFoo(props) { | ||
let x = []; | ||
x.push(props.bar); | ||
props.cond ? (({x} = {x: {}}), ([x] = [[]]), x.push(props.foo)) : null; | ||
mut(x); | ||
mutate(x); | ||
return x; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: useFoo, | ||
params: [{cond: false, foo: 2, bar: 55}], | ||
sequentialRenders: [ | ||
{cond: false, foo: 2, bar: 55}, | ||
{cond: false, foo: 3, bar: 55}, | ||
{cond: true, foo: 3, bar: 55}, | ||
], | ||
}; |
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
12 changes: 8 additions & 4 deletions
12
...plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-ternary-destruction.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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
function foo(props) { | ||
function useFoo(props) { | ||
let x = []; | ||
x.push(props.bar); | ||
props.cond ? (({x} = {x: {}}), ([x] = [[]]), x.push(props.foo)) : null; | ||
return x; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: foo, | ||
params: ['TodoAdd'], | ||
isComponent: 'TodoAdd', | ||
fn: useFoo, | ||
params: [{cond: false, foo: 2, bar: 55}], | ||
sequentialRenders: [ | ||
{cond: false, foo: 2, bar: 55}, | ||
{cond: false, foo: 3, bar: 55}, | ||
{cond: true, foo: 3, bar: 55}, | ||
], | ||
}; |
Oops, something went wrong.