Closed
Conversation
58d8f73 to
1a220e7
Compare
Contributor
|
I'll defer this review to @bnoordhuis who worked on adding column numbers :-P |
cac9960 to
cfcc36d
Compare
- simplify column number tracking using a pointer to the beginning of line instead of `eol` + `mark`. - add `js_parse_error_pos` to report syntax errors with exact source position for token parsing errors. This makes the syntax error reports much more precise. eg: exact position of UTF-8 encoding error, invalid escape sequence, etc. - add `JSSourcePos` type to use single opaque object for token source position - add `emit_pos` to set the precise source position in code generation - change `emit_op` to no longer emit source positions from `s->last_line_num` and `s->last_col_num`. - remove `last_line_num` and `last_col_num` `JSParserState` members - runtime errors on calls report the column number of calling function or method name. - runtime errors on `new` expressions report the column number of the `neẁ` keyword. - do not show source position in backtrace if debug information is missing - fix spurious parsing bugs when `js_parse_skip_parens_token` could not reparse the current token because of stack overflow detection. - `js_parse_save_pos` now saves the current token and `js_parse_seek_back` always restores the token, hence never fails, while `js_parse_seek_token` reparses the saved token. This is needed to handle the weird semantics of `"\1"; "use strict";` - simplify html comment detection - update **tests/test_builtin,js** with more informative messages - improve `assert()` and **tests/test_language.js** tests - update **v8.txt** for updated column numbers in remaining errors
cfcc36d to
5946221
Compare
Closed
saghul
approved these changes
Jun 24, 2024
| === json-errors.js | ||
| Failure: | ||
| expected: | ||
| "Unexpected end of JSON input" |
Contributor
|
Is this expected to improve the issue in #236? |
Collaborator
Author
Yes it should. Let me try this test after I fix the conflicts. |
Contributor
|
Hi, I am working on a project that is blocked due to this, can we possibly get this merged anytime soon. |
Contributor
|
@chqrlie are you planning on picking this back up? It likely needs a rebase at least 😅 |
Contributor
|
I fixed this just now in #660. Please file a new issue if anything still doesn't work as expected. |
cuiweixie
pushed a commit
to cuiweixie/quickjs
that referenced
this pull request
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
instead of
eol+mark.js_parse_error_posto report syntax errors with correct column numberfor token parsing errors. This makes the syntax error reports much more precise.
JSSourcePostype to keep track of token source positionemit_op_posto set the precise source position in code generationthis is work in progress: it should be the only way to generate source positions
and we should get rid of
s->last_line_numands->last_col_num.newexpressions report the column number of theneẁkeyword.assert()and tests/test_language.js tests