oxc-project / backlog

backlog for collborators only
1 stars 0 forks source link

Remove `AstNode::scope_id` field #98

Open overlookmotel opened 3 months ago

overlookmotel commented 3 months ago

This field is only used:

  1. Within SemanticBuilder - where builder.current_scope_id can be used instead.
  2. In linter - where could get the ScopeId by traversing up nodes via AstNodes::parent_ids until find a node with a scope (we can do that now as AST nodes contain scope_id fields, and it shouldn't cost much as you generally don't have to go up far to find a BlockStatement or Function).

I don't know if that'd be a perf gain or loss overall in the linter, but it'd be a gain for everything else which uses Semantic.