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

🐛 invalid char boundary in diagnostics #3120

Open
1 task done
Conaclos opened this issue Jun 7, 2024 · 0 comments
Open
1 task done

🐛 invalid char boundary in diagnostics #3120

Conaclos opened this issue Jun 7, 2024 · 0 comments
Labels
L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@Conaclos
Copy link
Member

Conaclos commented Jun 7, 2024

Environment information

CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "foot"
  JS_RUNTIME_VERSION:           "v22.2.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.8.1"

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

This is an error I extracted from #342
Here a reproduction:

❯ cat ./1058S11.8.3_A107522.js
if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u𪋲029>\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) {

❯ npx biome lint ./1058S11.8.3_A107522.js
./1058S11.8.3_A107522.js:1:61 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ invalid digits after unicode escape sequence
  
  > 1 │ if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u𪋲029>\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) {
      │                                                             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_diagnostics/src/display/frame.rs:242:57
Thread Name: main
Message: byte index 62 is not a char boundary; it is inside '𪋲' (bytes 61..65) of `if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u𪋲029>\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) {`

Expected result

Biome should not crash

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

No branches or pull requests

1 participant