mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
refactor(transformer/arrow-function): reserve correct capacity for Vec (#7319)
This commit is contained in:
parent
e09d2df448
commit
ea08c1f495
1 changed files with 2 additions and 1 deletions
|
|
@ -743,7 +743,8 @@ impl<'a> ArrowFunctionConverter<'a> {
|
||||||
let scope_id =
|
let scope_id =
|
||||||
ctx.create_child_scope(target_scope_id, ScopeFlags::Arrow | ScopeFlags::Function);
|
ctx.create_child_scope(target_scope_id, ScopeFlags::Arrow | ScopeFlags::Function);
|
||||||
|
|
||||||
let mut items = ctx.ast.vec_with_capacity(2);
|
let mut items =
|
||||||
|
ctx.ast.vec_with_capacity(usize::from(is_computed) + usize::from(is_assignment));
|
||||||
|
|
||||||
// Create a parameter for the prop if it's a computed member expression.
|
// Create a parameter for the prop if it's a computed member expression.
|
||||||
if is_computed {
|
if is_computed {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue