-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Adds evaluator support for a few compiler test fixtures ghstack-source-id: 202654992a9876cea59885b54a338c908e369ddb Pull Request resolved: #30948
- Loading branch information
Showing
27 changed files
with
413 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.