Skip to content

Comments

fix(syntax): correct is_reserved_keyword_or_global_object's incorrect function calling.#4484

Merged
DonIsaac merged 1 commit intooxc-project:mainfrom
7086cmd:fix/is_reserved_keyword_or_global_object
Jul 26, 2024
Merged

fix(syntax): correct is_reserved_keyword_or_global_object's incorrect function calling.#4484
DonIsaac merged 1 commit intooxc-project:mainfrom
7086cmd:fix/is_reserved_keyword_or_global_object

Conversation

@7086cmd
Copy link
Contributor

@7086cmd 7086cmd commented Jul 26, 2024

It may be a problem, but doesn't matter previously.

Formerly, the is_reserved_keyword_or_global_object is is_reserved_keyword(s) || is_reserved_keyword(s). I think it should be is_reserved_keyword(s) || is_global_object(s) according to its name.

Also, the .idea may be because I am using RustRover, which may automatically create .idea folder. So I ignore it in .gitignore.

I think I can contribute to oxc more when I am free.

@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 26, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@7086cmd 7086cmd changed the title fix: is_reserved_keyword_or_global_object's incorrect function calling. fix(syntax): is_reserved_keyword_or_global_object's incorrect function calling. Jul 26, 2024
github-merge-queue bot pushed a commit to rolldown/rolldown that referenced this pull request Jul 26, 2024
Rolldown seems to panic when parsing the following JSON before this PR:

```json
{ "null": null }
```

I used functions in `oxc::syntax::keyword` to solve it.

Notice that `is_reserved_keyword_or_global_object` function is suffering
wrong calling (related pr: oxc-project/oxc#4484), I'll separately call
them in this PR.
@7086cmd 7086cmd changed the title fix(syntax): is_reserved_keyword_or_global_object's incorrect function calling. fix(syntax): correct is_reserved_keyword_or_global_object's incorrect function calling. Jul 26, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 26, 2024

CodSpeed Performance Report

Merging #4484 will not alter performance

Comparing 7086cmd:fix/is_reserved_keyword_or_global_object (0ed80ce) with main (4d10c6c)

Summary

✅ 32 untouched benchmarks

@DonIsaac DonIsaac merged commit 1667491 into oxc-project:main Jul 26, 2024
@overlookmotel
Copy link
Member

@7086cmd @DonIsaac Just a quick note: .idea and files like that shouldn't be in .gitignore. Please see #4355 for the reason (when I tried to add .DS_Store!)

@DonIsaac
Copy link
Contributor

@overlookmotel thanks for the heads up, I'll make a PR removing it tomorrow

overlookmotel added a commit that referenced this pull request Jul 26, 2024
`.idea` snuck its way into `.gitignore` in #4484. Remove it again.

See #4355 for reason why it shouldn't be there.
@overlookmotel
Copy link
Member

No worries. I already removed it, just wanted to let you know why.

@7086cmd
Copy link
Contributor Author

7086cmd commented Jul 27, 2024

@7086cmd @DonIsaac Just a quick note: .idea and files like that shouldn't be in .gitignore. Please see #4355 for the reason (when I tried to add .DS_Store!)

Thanks! I understood.

@7086cmd 7086cmd deleted the fix/is_reserved_keyword_or_global_object branch July 27, 2024 01:01
@oxc-bot oxc-bot mentioned this pull request Jul 27, 2024
Dunqing pushed a commit that referenced this pull request Jul 28, 2024
## [0.22.1] - 2024-07-27

### Features

- 2477330 ast: Add `AstKind::TSExportAssignment` (#4501) (Dunqing)
- aaee07e ast: Add `AstKind::AssignmentTargetPattern`,
`AstKind::ArrayAssignmentTarget` and `AstKind::ObjectAssignmentTarget`
(#4456) (Dunqing)
- fd363d1 ast: Add AstKind::get_container_scope_id (#4450) (DonIsaac)
- e2735ca span: Add `contains_inclusive` method (#4491) (DonIsaac)

### Bug Fixes

- 368112c ast: Remove `#[visit(ignore)]` from
`ExportDefaultDeclarationKind`'s `TSInterfaceDeclaration` (#4497)
(Dunqing)
- 36bb680 semantic: `TSExportAssignment` cannot reference type binding
(#4502) (Dunqing)
- cb2fa49 semantic: `typeof` operator cannot reference type-only import
(#4500) (Dunqing)
- ef0e953 semantic: Generic passed to typeof not counted as a reference
(#4499) (Dunqing)
- 40cafb8 semantic: Params in `export default (function() {})` flagged
as `SymbolFlags::Export` (#4480) (Dunqing)
- 2e01a45 semantic: Non-exported namespace member symbols flagged as
exported (#4493) (Don Isaac)
- e4ca06a semantic: Incorrect symbol’s scope_id after var hoisting
(#4458) (Dunqing)
- 77bd5f1 semantic: Use correct span for namespace symbols (#4448) (Don
Isaac)
- 5db7bed sourcemap: Fix pre-calculation of required segments for
building JSON (#4490) (overlookmotel)
- 1667491 syntax: Correct `is_reserved_keyword_or_global_object`'s
incorrect function calling. (#4484) (Ethan Goh)
- 82ba2a0 syntax: Fix unsound use of `NonZeroU32` (#4466)
(overlookmotel)
- c04b9aa transformer: Add to `SymbolTable::declarations` for all
symbols (#4460) (overlookmotel)
- ecdee88 transformer/typescript: Incorrect eliminate exports when the
referenced symbol is both value and type (#4507) (Dunqing)

### Performance

- 963a2d1 mangler: Reduce unnecessary allocation (#4498) (Dunqing)
- 868fc87 parser: Optimize conditional advance on ASCII values (#4298)
(lucab)
- 24beaeb semantic: Give `AstNodeId` a niche (#4469) (overlookmotel)
- 348c1ad semantic: Remove `span` field from `Reference` (#4464)
(overlookmotel)
- 6a9f4db semantic: Reduce storage size for symbol redeclarations
(#4463) (overlookmotel)
- 705e19f sourcemap: Reduce memory copies encoding JSON (#4489)
(overlookmotel)
- 4d10c6c sourcemap: Pre allocate String buf while encoding (#4476)
(Brooooooklyn)

### Documentation

- f5f0ba8 ast: Add doc comments to more AST nodes (#4413) (Don Isaac)
- 871b3d6 semantic: Add doc comments for SymbolTester and SemanticTester
(#4433) (DonIsaac)

### Refactor

- 9c5d2f9 ast/builder: Use `Box::new_in` over `.into_in` (#4428)
(overlookmotel)
- ccb1835 semantic: Methods take `Span` as param, not `&Span` (#4470)
(overlookmotel)
- f17254a semantic: Populate `declarations` field in
`SymbolTable::create_symbol` (#4461) (overlookmotel)
- a49f491 semantic: Re-order `SymbolTable` fields (#4459)
(overlookmotel)
- 7cd53f3 semantic: Var hoisting (#4379) (Dunqing)
- 4f5a7cb semantic: Mark SemanticTester and SymbolTester as must_use
(#4430) (DonIsaac)
- c958a55 sourcemap: `push_list` method for building JSON (#4486)
(overlookmotel)
- c99b3eb syntax: Give `ScopeId` a niche (#4468) (overlookmotel)
- 96fc94f syntax: Use `NonMaxU32` for IDs (#4467) (overlookmotel)

### Testing

- 4b274a8 semantic: Add more test cases for symbol references (#4429)
(DonIsaac)

Co-authored-by: Boshen <[email protected]>
github-merge-queue bot pushed a commit to rolldown/rolldown that referenced this pull request Sep 9, 2024