dillon1000/react
Commit
Browse files [hir] Traverse function to capture deps, not just body node
Technically there is a body node created for implicit return expression in a arrow function, so the existing logic should've worked fine. But there seems to be a Babel bug, so let's work around it by traversing the function. Added a test case that captures a dep as a param -- this is currently unsupported and also something that would've been ignored before this PR. Added a failing test to make sure we think about this case when we add support for default params.
Changed paths5 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.nested-function-with-param-as-captured-dep.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.nested-function-with-param-as-captured-dep.ts AddedR compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-lambda-return-expression.expect.md →compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-return-expression.expect.md RenamedR compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-lambda-return-expression.ts →compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/lambda-return-expression.ts RenamedPatch
Files changed
Rendering syntax-highlighted changes…