Repository navigation
Fix column reporting for invalid number literals - #1498
Conversation
|
When I run the following function fun() {
let a = 123bcd;
}V8(chrome) throws this error: But QuickJS reports: This makes it look like QuickJS reports an inaccurate column number in the stack trace when throwing an invalid number literal error. |
|
Can you add a test please? |
|
I can add a regression test. My plan is to put it in |
|
I think it would be simpler and match similar tests to have it in JS. |
|
Understood. Just to confirm, you’d prefer this as a JS test under |
|
Separate test file I think. |
|
OK. Added a JS regression test under |
|
GHA is acting up today... unrelated test failures. |
next_token()reports invalid number literals before it reaches the common token finalization path, where the token column is normally computed. Becausejs_parse_error()usess->col_numfor the error backtrace, these syntax errors could point to a stale column instead of the start of the current numeric token.This updates
s->col_numbefore throwing the invalid number literal error, using the same column calculation as the normal token path.