Commits
Click on a commit to change the comparison rangefix(traverse): `ChildScopeCollector` visit all scopes (#10292)
Fixes #9702.
Fix `ChildScopeCollector` so it doesn't miss out scopes in some cases.
Previously when a struct has its own scope, the visitor does not visit any of the struct's fields. But this is incorrect where the type's scope does not cover all of its fields (the scope starts late / ends early). If the fields outside of the scope may themselves have scopes, then those scopes are direct children of the starting point.
These types are:
* `Class` (`decorators` is outside `Class`'s scope).
* `SwitchStatement` (`discriminant` is outside `SwitchStatement`'s scope).
* `TSConditionalType` (`check_type` and `false_type` are outside `TSConditionalType`'s scope).
Additionally, make the visitor more efficient by not bothering to visit any struct fields / enum variants which don't contain a scope anywhere in their dependencies.8 months ago
by overlookmotel