Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jun 14, 2024
1 parent dea108b commit df7093d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions crates/swc_ecma_ast/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static RESERVED_IN_ES3: phf::Set<&str> = phf_set!(
"volatile",
);

pub trait IdentExt: AsRef<str> {
pub trait EsReserved: AsRef<str> {
fn is_reserved(&self) -> bool {
RESERVED.contains(self.as_ref())
}
Expand Down Expand Up @@ -487,7 +487,7 @@ pub trait IdentExt: AsRef<str> {
}
}

impl IdentExt for Atom {}
impl IdentExt for Ident {}
impl IdentExt for &'_ str {}
impl IdentExt for String {}
impl EsReserved for Atom {}
impl EsReserved for Ident {}
impl EsReserved for &'_ str {}
impl EsReserved for String {}
2 changes: 1 addition & 1 deletion crates/swc_ecma_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub use self::{
decl::{ClassDecl, Decl, FnDecl, UsingDecl, VarDecl, VarDeclKind, VarDeclarator},
expr::*,
function::{Function, Param, ParamOrTsParamProp},
ident::{BindingIdent, Id, Ident, IdentExt, PrivateName},
ident::{BindingIdent, EsReserved, Id, Ident, PrivateName},
jsx::{
JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, JSXClosingElement, JSXClosingFragment,
JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpr, JSXExpr, JSXExprContainer,
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2015/src/classes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use swc_ecma_transforms_macros::fast_path;
use swc_ecma_utils::{
alias_if_required, contains_this_expr, default_constructor, is_valid_ident,
is_valid_prop_ident, prepend_stmt, private_ident, prop_name_to_expr, quote_expr, quote_ident,
quote_str, replace_ident, ExprFactory, IdentExt, ModuleItemLike, StmtLike,
quote_str, replace_ident, EsReserved, ExprFactory, ModuleItemLike, StmtLike,
};
use swc_ecma_visit::{
as_folder, noop_visit_mut_type, noop_visit_type, Fold, Visit, VisitMut, VisitMutWith, VisitWith,
Expand Down
4 changes: 2 additions & 2 deletions crates/swc_ecma_compat_es2015/src/object_super.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use swc_common::{util::take::Take, Span, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::helper;
use swc_ecma_utils::{
alias_ident_for, is_rest_arguments, prepend_stmt, private_ident, quote_ident, ExprFactory,
IdentExt,
alias_ident_for, is_rest_arguments, prepend_stmt, private_ident, quote_ident, EsReserved,
ExprFactory,
};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use swc_ecma_transforms_base::{helper, helper_expr};
use swc_ecma_utils::{
alias_ident_for, constructor::inject_after_super, default_constructor,
is_maybe_branch_directive, private_ident, prop_name_to_expr_value, quote_ident, replace_ident,
stack_size::maybe_grow_default, ExprFactory, IdentExt, IdentRenamer,
stack_size::maybe_grow_default, EsReserved, ExprFactory, IdentRenamer,
};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};

Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_transforms_proposal/src/decorators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder;
use swc_ecma_utils::{
alias_ident_for, constructor::inject_after_super, default_constructor, prepend_stmt,
private_ident, prop_name_to_expr, prop_name_to_expr_value, quote_ident, quote_str, undefined,
ExprFactory, IdentExt,
EsReserved, ExprFactory,
};
use swc_ecma_visit::{as_folder, noop_fold_type, Fold, FoldWith, Visit, VisitWith};

Expand Down

0 comments on commit df7093d

Please sign in to comment.