From 871e19bea29c4d048f18a139a30f536c0fe57bc8 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 17 Nov 2024 05:08:59 +0000 Subject: [PATCH] refactor(transformer/arrow-function): comments on possible improvement (#7320) --- crates/oxc_transformer/src/common/arrow_function_converter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index f0b6ab18304f2..26ae678351ca9 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -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( @@ -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(