refactor(semantic): remove unused methods from AstNode

This commit is contained in:
Boshen 2023-12-21 16:07:28 +08:00
parent 6d4202241b
commit da67fe1ca2
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1

View file

@ -2,7 +2,7 @@ use bitflags::bitflags;
use oxc_ast::AstKind;
use oxc_index::{define_index_type, IndexVec};
use crate::scope::{ScopeFlags, ScopeId};
use crate::scope::ScopeId;
define_index_type! {
pub struct AstNodeId = usize;
@ -69,15 +69,6 @@ impl<'a> AstNode<'a> {
pub fn flags_mut(&mut self) -> &mut NodeFlags {
&mut self.flags
}
pub fn strict_mode(&self, flags: ScopeFlags) -> bool {
// All parts of a ClassDeclaration or a ClassExpression are strict mode code.
flags.is_strict_mode() || self.flags.has_class()
}
pub fn is_specific_id_reference(&self, name: &str) -> bool {
self.kind().is_specific_id_reference(name)
}
}
/// Untyped AST nodes flattened into an vec