Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js_parser): Correctly parse global declaration when the global token and the { token are not on the same line #1731

Merged
merged 12 commits into from
Feb 2, 2024

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Feb 2, 2024

Summary

The cause of this formatting issue is the global declaration cannot be correctly parsed when the { and the global tokens are not on the same line.

declare global 
{}

declare module foo {
  global 
  {}
}

Test Plan

Add new test cases

Copy link

netlify bot commented Feb 2, 2024

Deploy Preview for biomejs canceled.

Name Link
🔨 Latest commit 5565748
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65bc8a7de91cf300087b7328

@github-actions github-actions bot added A-Parser Area: parser A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Feb 2, 2024
@ah-yu ah-yu marked this pull request as draft February 2, 2024 04:31
Copy link

codspeed-hq bot commented Feb 2, 2024

CodSpeed Performance Report

Merging #1731 will improve performances by 10.14%

⚠️ No base runs were found

Falling back to comparing ah-yu:declare_parse (5565748) with main (674ebb6)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main ah-yu:declare_parse Change
big5-added.json[uncached] 3.2 ms 2.9 ms +10.14%

@ah-yu ah-yu marked this pull request as ready for review February 2, 2024 07:31
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ematipico ematipico merged commit 93c23a2 into biomejs:main Feb 2, 2024
20 checks passed
@ah-yu ah-yu deleted the declare_parse branch February 2, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Parser Area: parser A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📝 Formatting Issue with Global Declaration
2 participants