feat(ast): add and auto-generate WithBindingIdentifier trait#5362
feat(ast): add and auto-generate WithBindingIdentifier trait#5362
WithBindingIdentifier trait#5362Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
WithBindingIdentifier trait
CodSpeed Performance ReportMerging #5362 will not alter performanceComparing Summary
|
Isn't this oxc/crates/oxc_ast/src/syntax_directed_operations/bound_names.rs Lines 3 to 10 in afb038e |
0ac603c to
1bc6271
Compare
2e4dd6b to
180b1a1
Compare
1bc6271 to
95f5189
Compare
95f5189 to
cda09d4
Compare
Just about... sigh... I'm noticing that let mut id: Option<&BindingIdentifier<'a>> = None;
node.bound_names(|found| {
debug_assert!(id.is_none());
*id = Some(found)
} |

What This PR Does
WithBindingIdentifiertrait for accessingBindingIdentifierson relevant AST nodes in a standard way.ast_toolsthat auto-implements this trait for most AST nodes.ast_toolsthat I did as I figured out how things worked.