-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
🐛 Including smart-quote ‘
with escape \
confuses the JS lexer
#1941
Comments
An observation: the crash of the playground seems to be the result of an out of range position acquired from the diagnostics. So it should be automatically fixed if the root cause is fixed. And apart from smart quotes, Chinese characters will also trigger the similar problem. Just type (or copy paste) |
This issue seems to be the same as #1788. |
Thanks for investigating, @Sec-ant. Closing this one as duplicate. |
‘
with escape \
crashes the playground, or confuses the terminal literal reading‘
with escape \
confuses the JS lexer
Reopening, since there may be two separate issues at play. This one regarding the lexer (may be specific to Unicode characters inside regex literals), and possibly another about compatibility of character offsets in diagnostics (#1385). |
FWIW, running this in a debug build yields: ❯ echo "/\’/" | ../target/debug/biome lint --stdin-file-path=a.js
Biome encountered an unexpected error
This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:
Source Location: crates/biome_js_parser/src/lexer/mod.rs:538:9
Thread Name: main
Message: assertion failed: self.source.is_char_boundary(self.position) |
Environment information
What happened?
or put that in a .js file and run
biome lint
against it.The
biome lint
gives this output:The playground crashes completely, and shows this in the browser console:
Trying to run
biome format
on it gives:This also happens with other similar types of "smart" quotes,
for instance.
Expected result
It should work just fine, the same as
Code of Conduct
The text was updated successfully, but these errors were encountered: