Skip to content

Commit

Permalink
fix: use is_reserved_keyword_or_global_object (#2222)
Browse files Browse the repository at this point in the history
<!-- Thank you for contributing! -->

### Description
1. follow todo, see oxc-project/oxc#4484
<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
  • Loading branch information
IWANABETHATGUY authored Sep 12, 2024
1 parent c853e81 commit ca6a4db
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/rolldown_utils/src/ecma_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ pub fn is_validate_identifier_name(name: &str) -> bool {
}

pub fn is_validate_assignee_identifier_name(name: &str) -> bool {
// Because of the mistake in oxc (related: oxc-project/oxc#4484, we need to use separated functions in `keyword`.
// TODO use `is_reserved_keyword_or_global_object` after the fix
identifier::is_identifier_name(name)
&& !keyword::is_reserved_keyword(name)
&& !keyword::is_global_object(name)
identifier::is_identifier_name(name) && !keyword::is_reserved_keyword_or_global_object(name)
}

pub fn legitimize_identifier_name(name: &str) -> Cow<str> {
Expand Down

0 comments on commit ca6a4db

Please sign in to comment.