Skip to content

Commit

Permalink
removed js_word!
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Dec 30, 2023
1 parent d24a866 commit a94ed50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/jsx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use swc_core::common::iter::IdentifyLast;
use swc_core::common::util::take::Take;
use swc_core::common::{FileName, Mark, SourceMap, Span, Spanned, DUMMY_SP};
use swc_core::ecma::ast::*;
use swc_core::ecma::atoms::{js_word, Atom, JsWord};
use swc_core::ecma::atoms::{Atom, JsWord};
use swc_core::ecma::utils::{drop_span, prepend_stmt, quote_ident, ExprFactory, StmtLike};
use swc_core::ecma::visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};
use swc_core::plugin::errors::HANDLER;
Expand Down Expand Up @@ -391,7 +391,7 @@ where

match el.opening.name {
JSXElementName::Ident(ident) => {
if ident.sym == js_word!("this") {
if ident.sym == "this" {
vnode_kind = Component;
mut_flags = VNodeFlags::ComponentUnknown as u16;
name_expr = Expr::This(ThisExpr { span: name_span });
Expand Down Expand Up @@ -433,7 +433,7 @@ where

(match obj {
JSXObject::Ident(i) => {
if i.sym == js_word!("this") {
if i.sym == "this" {
Expr::This(ThisExpr { span })
} else {
Expr::Ident(i)
Expand Down Expand Up @@ -487,7 +487,7 @@ where
match attr.name {
JSXAttrName::Ident(i) => {
//
if i.sym == js_word!("class") || i.sym == "className" {
if i.sym == "class" || i.sym == "className" {
if vnode_kind == VNodeType::Element {
if let Some(v) = attr.value {
class_name_param = jsx_attr_value_to_expr(v)
Expand All @@ -502,7 +502,7 @@ where
key: PropName::Str(Str {
span: i.span,
raw: None,
value: js_word!("for"),
value: "for".into(),
}),
value: match attr.value {
Some(v) => jsx_attr_value_to_expr(v)
Expand Down Expand Up @@ -532,7 +532,7 @@ where
},
))));
continue;
} else if i.sym == js_word!("key") {
} else if i.sym == "key" {
key_prop = attr
.value
.and_then(jsx_attr_value_to_expr)
Expand Down Expand Up @@ -629,7 +629,7 @@ where
continue;
}

if i.sym.to_ascii_lowercase() == js_word!("contenteditable") {
if i.sym.to_ascii_lowercase() == "contenteditable" {
content_editable_props = true;
} else if i.sym == "children" {
if !el.children.is_empty() {
Expand Down Expand Up @@ -1044,7 +1044,7 @@ where
//
match &attr.name {
JSXAttrName::Ident(i) => {
if i.sym == js_word!("key") {
if i.sym == "key" {
return true;
}
}
Expand Down Expand Up @@ -1416,7 +1416,7 @@ fn add_require(imports: Vec<&str>, src: &str, unresolved_mark: Mark) -> Stmt {
span: DUMMY_SP,
callee: Callee::Expr(Box::new(Expr::Ident(Ident {
span: DUMMY_SP.apply_mark(unresolved_mark),
sym: js_word!("require"),
sym: "require".into(),
optional: false,
}))),
args: vec![ExprOrSpread {
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::*;
use crate::{inferno, pure_annotations, PluginDiagnosticsEmitter};

test!(
::swc_ecma_parser::Syntax::Typescript(::swc_ecma_parser::TsConfig {
Syntax::Typescript(::swc_ecma_parser::TsConfig {
tsx: true,
..Default::default()
}),
Expand Down

0 comments on commit a94ed50

Please sign in to comment.