dillon1000/react
Commit
Browse files Validate that all variable references are consistently local/context
Validates that all references to a variable (pre-SSA) are consistently "local" references or "context" references. Ie, if a variable is declared as DeclareContext, any accesses must be eg LoadContext or StoreContext, not LoadLocal/StoreLocal. This will help with the issue from #2577 (assuming that we know a variable _is_ a context variable) but also provides a more precise bailout for an existing case with destructuring assignment to a context variable.
Changed paths7 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/Validation/ValidateContextVariableLValues.ts AddedM compiler/packages/babel-plugin-react-forget/src/Validation/index.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-scope-missing-mutable-range.expect.md AddedR compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-scope-missing-mutable-range.js →compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-scope-missing-mutable-range.js RenamedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo.destructure-assignment-to-context-var.expect.md ModifiedD compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/repro-scope-missing-mutable-range.expect.md DeletedPatch
Files changed
Rendering syntax-highlighted changes…