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_isolated_declarations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'a> IsolatedDeclarations<'a> {
ast: AstBuilder::new(allocator),
strip_internal,
internal_annotations: FxHashSet::default(),
scope: ScopeTree::new(allocator),
scope: ScopeTree::new(),
errors: RefCell::new(vec![]),
}
}
Expand Down
12 changes: 5 additions & 7 deletions crates/oxc_isolated_declarations/src/scope.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use std::cell::Cell;

use bitflags::bitflags;
use oxc_allocator::{Allocator, Vec};
use rustc_hash::FxHashMap;

#[allow(clippy::wildcard_imports)]
use oxc_ast::ast::*;
use oxc_ast::AstBuilder;
#[allow(clippy::wildcard_imports)]
use oxc_ast::{visit::walk::*, Visit};
use oxc_span::Atom;
use oxc_syntax::scope::{ScopeFlags, ScopeId};
use rustc_hash::FxHashMap;

bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -37,13 +36,12 @@ impl<'a> Scope<'a> {
/// Linear tree of declaration scopes.
#[derive(Debug)]
pub struct ScopeTree<'a> {
levels: Vec<'a, Scope<'a>>,
levels: Vec<Scope<'a>>,
}

impl<'a> ScopeTree<'a> {
pub fn new(allocator: &'a Allocator) -> Self {
let ast = AstBuilder::new(allocator);
let levels = ast.vec1(Scope::new(ScopeFlags::Top));
pub fn new() -> Self {
let levels = vec![Scope::new(ScopeFlags::Top)];
Self { levels }
}

Expand Down