mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(transformer): always create valid identifiers (#2131)
I'm not familiar with the transformer, so not 100% sure what this function does. But from the name `create_valid_identifier`, I'm guessing that `-` is a mistake - it's not a valid character to have in identifiers. If I've misunderstood, please feel free to close this.
This commit is contained in:
parent
71173a9181
commit
777352e2ba
1 changed files with 1 additions and 1 deletions
|
|
@ -162,7 +162,7 @@ fn create_valid_identifier(
|
|||
// }
|
||||
|
||||
let id = Atom::from(
|
||||
atom.chars().map(|c| if is_identifier_part(c) { c } else { '-' }).collect::<String>(),
|
||||
atom.chars().map(|c| if is_identifier_part(c) { c } else { '_' }).collect::<String>(),
|
||||
);
|
||||
|
||||
let id = if id == "" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue