dillon1000/react
Commit
Browse files DeclareLocal instruction
Adds a `DeclareLocal` instruction which represents declaring a named variable without initializing it. Currently declarations without an initializer (`let x`) are transformed into a declaration to undefined (`let x = undefined`) which changes the semantics due to hoisting and TDZ (temporary dead zone). The correct thing is to represent declaration without initialization.
Changed paths15 files
First-parent comparisoncompiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/HIR.ts ModifiedM compiler/forget/src/HIR/PrintHIR.ts ModifiedM compiler/forget/src/HIR/visitors.ts ModifiedM compiler/forget/src/Inference/InferReferenceEffects.ts ModifiedM compiler/forget/src/Optimization/DeadCodeElimination.ts ModifiedM compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/forget/src/ReactiveScopes/InferReactiveScopeVariables.ts ModifiedM compiler/forget/src/ReactiveScopes/PruneNonEscapingScopes.ts ModifiedM compiler/forget/src/SSA/LeaveSSA.ts ModifiedM compiler/forget/src/__tests__/fixtures/compiler/assignment-in-nested-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/destructuring-assignment.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/ssa-leave-case.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/switch-non-final-default.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/switch.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…