Skip to content

Commit

Permalink
refactor(transformer/arrow-function): comments on possible improvement (
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 17, 2024
1 parent ea08c1f commit 871e19b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/oxc_transformer/src/common/arrow_function_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,8 @@ impl<'a> ArrowFunctionConverter<'a> {

// Create a parameter for the prop if it's a computed member expression.
if is_computed {
// TODO(improve-on-babel): No need for UID here. Just `prop` would be fine as there's nothing
// in `prop => super[prop]` or `(prop, value) => super[prop] = value` which can clash.
let param_binding =
ctx.generate_uid("prop", scope_id, SymbolFlags::FunctionScopedVariable);
let param = ctx.ast.formal_parameter(
Expand All @@ -771,6 +773,8 @@ impl<'a> ArrowFunctionConverter<'a> {

// Create a parameter for the value if it's an assignment.
if is_assignment {
// TODO(improve-on-babel): No need for UID here. Just `value` would be fine as there's nothing
// in `value => super.prop = value` or `(prop, value) => super[prop] = value` which can clash.
let param_binding =
ctx.generate_uid("value", scope_id, SymbolFlags::FunctionScopedVariable);
let param = ctx.ast.formal_parameter(
Expand Down

0 comments on commit 871e19b

Please sign in to comment.