Skip to content

Commit

Permalink
refactor(transformer): comment about potential improvement to arrow f…
Browse files Browse the repository at this point in the history
…unction transform (#5841)
  • Loading branch information
overlookmotel committed Sep 18, 2024
1 parent 635e918 commit 03e02a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/oxc_transformer/src/es2015/arrow_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ impl<'a> ArrowFunctions<'a> {
span: Span,
ctx: &mut TraverseCtx<'a>,
) -> IdentifierReference<'a> {
// TODO(improve-on-babel): We create a new UID for every scope. This is pointless, as only one
// `this` can be in scope at a time. We could create a single `_this` UID and reuse it in each
// scope. But this does not match output for some of Babel's test cases.
// <https://github.com/oxc-project/oxc/pull/5840>
let this_var = self.this_var_stack.last_mut().unwrap();
if this_var.is_none() {
let target_scope_id =
Expand Down

0 comments on commit 03e02a0

Please sign in to comment.