Repository navigation
Commit 0643242
committed
fix(compiler): collect arm-local bindings in singleRoot if-dep proof
armOk in collectSingleRootIfDeps filtered arm statements down to
JSX/if-directive nodes and passed only component-level locals into
singleRootComponentArmName. A const or function declared inside an
@if/@else arm that shadows a same-module component was invisible to
both checks, so the shadow resolved to the module-level componentInfo
entry. This could falsely widen info.singleRoot, causing callers to
take the markerless regime for output that may not be a single element.
Collect VariableDeclaration and FunctionDeclaration bindings from each
arm's full statement list into an extended locals set, so arm-level
shadows are properly rejected by the existing locals.has(name) guard.1 parent 16c62f2 commit 0643242
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5005 | 5005 | | |
5006 | 5006 | | |
5007 | 5007 | | |
5008 | | - | |
| 5008 | + | |
| 5009 | + | |
5009 | 5010 | | |
5010 | 5011 | | |
5011 | 5012 | | |
5012 | 5013 | | |
5013 | | - | |
| 5014 | + | |
| 5015 | + | |
| 5016 | + | |
| 5017 | + | |
| 5018 | + | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + | |
| 5022 | + | |
| 5023 | + | |
| 5024 | + | |
| 5025 | + | |
| 5026 | + | |
5014 | 5027 | | |
5015 | 5028 | | |
5016 | 5029 | | |
| |||
0 commit comments