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: handle missing quote followed by a newline #2649

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

Conaclos
Copy link
Member

@Conaclos Conaclos commented Apr 29, 2024

Summary

Fix #2606
Fix #2410

The parser panicked on unterminated strings followed by a newline.
This is because we try to emit a diagnostic that emphasis the newline character and at least one space.
I fixed the issue by changing the diagnostics that was confusing in the first place.

Test Plan

I added two tests and updated the snapshots.

@github-actions github-actions bot added A-Parser Area: parser L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS L-JSON Language: JSON and super languages A-Changelog Area: changelog labels Apr 29, 2024
@Conaclos Conaclos force-pushed the conaclos/missing-quote-panics branch from 250dcf9 to aae1b3a Compare April 29, 2024 15:21
@github-actions github-actions bot added the A-Formatter Area: formatter label Apr 29, 2024
Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 49701 49701 0
Passed 48721 48721 0
Failed 980 980 0
Panics 0 0 0
Coverage 98.03% 98.03% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6322 6322 0
Passed 2036 2036 0
Failed 4286 4286 0
Panics 0 0 0
Coverage 32.20% 32.20% 0.00%

ts/babel

Test result main count This PR count Difference
Total 662 662 0
Passed 593 593 0
Failed 69 69 0
Panics 0 0 0
Coverage 89.58% 89.58% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 17646 17646 0
Passed 13439 13439 0
Failed 4205 4205 0
Panics 2 2 0
Coverage 76.16% 76.16% 0.00%

@Conaclos Conaclos merged commit 8f9c14a into main Apr 29, 2024
15 checks passed
@Conaclos Conaclos deleted the conaclos/missing-quote-panics branch April 29, 2024 15:36
Copy link

codspeed-hq bot commented Apr 29, 2024

CodSpeed Performance Report

Merging #2649 will improve performances by 6.6%

Comparing conaclos/missing-quote-panics (aae1b3a) with main (a85016a)

Summary

⚡ 1 improvements
✅ 89 untouched benchmarks

Benchmarks breakdown

Benchmark main conaclos/missing-quote-panics Change
router.ts[uncached] 13.2 ms 12.4 ms +6.6%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter A-Parser Area: parser L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages
Projects
None yet
1 participant