dillon1000/react
Commit
Browse files ForInStatement: specialize inference/types
Replaces the use of `NextIterableOf` in for-in with a new `NextPropertyOf` instruction. The key distinction is `for-of` invokes an arbitrary iterator, which means a) each iteration may mutate the collection being iterated and b) the returned value may be mutable. However, `for-in` invokes a language-level mechanism to iterate: simply iterating alone _cannot_ modify the collection, and the returned value is known to be a primitive.
Changed paths12 files
First-parent comparisoncompiler/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/HIR/PrintHIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/HIR/visitors.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Optimization/DeadCodeElimination.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/InferReactiveScopeVariables.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneNonEscapingScopes.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/TypeInference/InferTypes.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-in-statement-type-inference.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/for-in-statement-type-inference.js AddedPatch
Files changed
Rendering syntax-highlighted changes…