Skip to content

Commit 92166ca

Browse files
committed
fix! use token line/col info
1 parent 59185dc commit 92166ca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

quickjs.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -19928,8 +19928,6 @@ static __exception int next_token(JSParseState *s)
1992819928
}
1992919929
s->token.col_num = max_int(1, s->mark - s->eol);
1993019930
s->buf_ptr = p;
19931-
s->last_line_num = s->token.line_num;
19932-
s->last_col_num = s->token.col_num;
1993319931

1993419932
// dump_token(s, &s->token);
1993519933
return 0;
@@ -20399,8 +20397,8 @@ static void emit_source_loc(JSParseState *s)
2039920397
DynBuf *bc = &fd->byte_code;
2040020398

2040120399
dbuf_putc(bc, OP_source_loc);
20402-
dbuf_put_u32(bc, s->last_line_num);
20403-
dbuf_put_u32(bc, s->last_col_num);
20400+
dbuf_put_u32(bc, s->token.line_num);
20401+
dbuf_put_u32(bc, s->token.col_num);
2040420402
}
2040520403

2040620404
static void emit_op(JSParseState *s, uint8_t val)

0 commit comments

Comments
 (0)