dillon1000/react

Commit

[hir] Attach fnType to HIRFunction

--- 

(This came out of running a sync and observing hundreds of bailouts due from 
this validation) 

Reading `fnType` from environment overgeneralizes, as inner functions are 
usually not the type of the outer react function. 

``` 

// Component type 

function Component() { 

// not Component type 

const helper = () => {...}; 

} 

``` 

Let's attach fnType to `HIRFunction` and use that for our inference + 
validations
Browse files
Changed paths5 files
First-parent comparison
M compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/component-inner-function-with-many-args.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/component-inner-function-with-many-args.tsx Added
Patch

Files changed

Rendering syntax-highlighted changes…