-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
A-semanticArea - SemanticArea - SemanticC-cleanupCategory - technical debt or refactoring. Solution not expected to change behaviorCategory - technical debt or refactoring. Solution not expected to change behavior
Description
From #4208 (comment):
Once #4203 is merged, node IDs will be generated before scope is created, so we can add node_id to params of this function, and push the actual AstNodeId here. Then we can remove set_node_id.
In particular, this is about refactoring the logic here below and getting rid of the dummy node ID:
oxc/crates/oxc_semantic/src/scope.rs
Lines 182 to 195 in be82c28
| pub fn add_scope(&mut self, parent_id: Option<ScopeId>, flags: ScopeFlags) -> ScopeId { | |
| let scope_id = self.parent_ids.push(parent_id); | |
| _ = self.child_ids.push(vec![]); | |
| _ = self.flags.push(flags); | |
| _ = self.bindings.push(Bindings::default()); | |
| _ = self.node_ids.push(AstNodeId::dummy()); | |
| // Set this scope as child of parent scope. | |
| if let Some(parent_id) = parent_id { | |
| self.child_ids[parent_id].push(scope_id); | |
| } | |
| scope_id | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-semanticArea - SemanticArea - SemanticC-cleanupCategory - technical debt or refactoring. Solution not expected to change behaviorCategory - technical debt or refactoring. Solution not expected to change behavior
Type
Fields
Give feedbackPriority
None yet