Skip to content
Merged
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
12 changes: 5 additions & 7 deletions crates/oxc_semantic/src/binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ impl<'a> Binder<'a> for Function<'a> {

let symbol_id = builder.declare_symbol(ident.span, &ident.name, includes, excludes);
ident.symbol_id.set(Some(symbol_id));

// Save `@__NO_SIDE_EFFECTS__`
if self.pure {
builder.scoping.no_side_effects.insert(symbol_id);
}
}

// Bind scope flags: GetAccessor | SetAccessor
Expand All @@ -173,13 +178,6 @@ impl<'a> Binder<'a> for Function<'a> {
PropertyKind::Init => {}
}
}

// Save `@__NO_SIDE_EFFECTS__`
if self.pure {
if let Some(symbol_id) = self.id.as_ref().and_then(|id| id.symbol_id.get()) {
builder.scoping.no_side_effects.insert(symbol_id);
}
}
}
}

Expand Down
Loading