mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
perf(transformer/arrow-function): stop traversal at function as super() can't appear in a nested function (#8383)
This commit is contained in:
parent
fd35866141
commit
07edf74c58
1 changed files with 5 additions and 2 deletions
|
|
@ -1209,8 +1209,11 @@ impl<'a> VisitMut<'a> for ConstructorBodyThisAfterSuperInserter<'a, '_> {
|
|||
}
|
||||
}
|
||||
}
|
||||
// TODO: Stop traversal at a `Function` too. `super()` can't appear in a nested function,
|
||||
// so no point traversing it. This is for performance, not correctness.
|
||||
|
||||
#[inline] // `#[inline]` because is a no-op
|
||||
fn visit_function(&mut self, _func: &mut Function<'a>, _flags: ScopeFlags) {
|
||||
// `super()` can't appear in a nested function
|
||||
}
|
||||
|
||||
/// `super()` -> `super(); _this = this;`
|
||||
fn visit_statements(&mut self, statements: &mut ArenaVec<'a, Statement<'a>>) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue