Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 16, 2023
1 parent e7cd2ca commit 9e6df37
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/swc_ecma_parser/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ pub enum IdentLike {
Other(JsWord),
}

impl From<&'_ str> for IdentLike {
fn from(s: &str) -> Self {
s.parse::<KnownIdent>()
.map(Self::Known)
.unwrap_or_else(|_| Self::Other(s.into()))
}
}

impl IdentLike {
pub(crate) fn from_str(atoms: &mut AtomStore, s: &str) -> IdentLike {
s.parse::<KnownIdent>()
Expand Down

0 comments on commit 9e6df37

Please sign in to comment.