mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(transformer): arrow function transform: remove unnecessary assertion (#6002)
This assertion was required previously for soundness, but now `SparseStack::pop` makes it impossible for `self.this_var_stack.len()` to be 0. Being exactly 1 is not a safety invariant, only that it's not 0.
This commit is contained in:
parent
2b17003e0b
commit
f02bf516cf
1 changed files with 0 additions and 1 deletions
|
|
@ -165,7 +165,6 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> {
|
|||
|
||||
/// Insert `var _this = this;` for the global scope.
|
||||
fn exit_program(&mut self, program: &mut Program<'a>, _ctx: &mut TraverseCtx<'a>) {
|
||||
assert!(self.this_var_stack.len() == 1);
|
||||
if let Some(this_var) = self.this_var_stack.take() {
|
||||
self.insert_this_var_statement_at_the_top_of_statements(&mut program.body, &this_var);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue