Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ pub struct BindingRestElement<'a> {
// Don't create scope if this is a method - `MethodDefinition` already created one.
// `ctx.ancestor(2).unwrap()` not `ctx.parent()` because this code is inserted
// into `walk_function` *after* `Function` is added to stack.
scope_if(matches!(ctx.ancestor(2).unwrap(), Ancestor::MethodDefinitionValue(_))),
scope_if(!matches!(ctx.ancestor(2).unwrap(), Ancestor::MethodDefinitionValue(_))),
strict_if(self.body.as_ref().is_some_and(|body| body.has_use_strict_directive()))
)]
#[derive(Debug, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_traverse/src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,7 @@ pub(crate) unsafe fn walk_function<'a, Tr: Traverse<'a>>(
) {
traverser.enter_function(&mut *node, ctx);
ctx.push_stack(Ancestor::FunctionId(ancestor::FunctionWithoutId(node)));
let has_scope = matches!(ctx.ancestor(2).unwrap(), Ancestor::MethodDefinitionValue(_));
let has_scope = !matches!(ctx.ancestor(2).unwrap(), Ancestor::MethodDefinitionValue(_));
if has_scope {
ctx.push_scope_stack(
ScopeFlags::Function.with_strict_mode(
Expand Down