Repository navigation
Commit 0fa3008
committed
fix(compiler): add enum member scope and computed key walk to client-only check
The TSEnumDeclaration handler in assertNoLiveClientOnlyImports was missing
two things that the universal lexical analysis already handles correctly:
1. Enum member names were never recorded as scope bindings, so a later
initializer referencing an earlier member whose name shadows a
client-only import would falsely throw OCTANE_CLIENT_ONLY_SERVER_USE.
2. Computed member keys were never walked, so a client-only binding used
only as a computed enum key was never detected.
Fix by creating an enum scope (with the enum's own name and all non-
computed member identifier names) before walking members, and visiting
computed member keys alongside initializers. Also add TSEnumMember to
isReferenceIdentifier so non-computed keys are not treated as references.1 parent 268166f commit 0fa3008
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
566 | 576 | | |
| 577 | + | |
| 578 | + | |
567 | 579 | | |
568 | 580 | | |
569 | 581 | | |
| |||
744 | 756 | | |
745 | 757 | | |
746 | 758 | | |
| 759 | + | |
| 760 | + | |
747 | 761 | | |
748 | 762 | | |
749 | 763 | | |
| |||
0 commit comments