Skip to content

Commit 11e2cb5

Browse files
committed
Record source column positions
And: - display them in stack traces - expose them as Function.prototype.columnNumber OP_line_num is renamed to OP_source_loc and the pc2line data structure is extended with the column number in zigzag encoding. The bytecode version number BC_VERSION is incremented because pc2line data is read and written by JS_ReadObject() and JS_WriteObject() when it is present. Fixes: #149
1 parent f6ed206 commit 11e2cb5

File tree

4 files changed

+410
-186
lines changed

4 files changed

+410
-186
lines changed

quickjs-atom.h

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ DEF(empty_string, "")
8181
DEF(length, "length")
8282
DEF(fileName, "fileName")
8383
DEF(lineNumber, "lineNumber")
84+
DEF(columnNumber, "columnNumber")
8485
DEF(message, "message")
8586
DEF(cause, "cause")
8687
DEF(errors, "errors")

quickjs-opcode.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ FMT(loc)
4444
FMT(arg)
4545
FMT(var_ref)
4646
FMT(u32)
47+
FMT(u32x2)
4748
FMT(i32)
4849
FMT(const)
4950
FMT(label)
@@ -281,7 +282,7 @@ def(scope_put_private_field, 7, 2, 0, atom_u16) /* obj value ->, emitted in phas
281282

282283
def( set_class_name, 5, 1, 1, u32) /* emitted in phase 1, removed in phase 2 */
283284

284-
def( line_num, 5, 0, 0, u32) /* emitted in phase 1, removed in phase 3 */
285+
def( source_loc, 9, 0, 0, u32x2) /* emitted in phase 1, removed in phase 3 */
285286

286287
DEF( push_minus1, 1, 0, 1, none_int)
287288
DEF( push_0, 1, 0, 1, none_int)

0 commit comments

Comments
 (0)