@@ -141,9 +141,11 @@ int __attribute__((format(printf, 2, 3))) js_parse_error(JSParseState *s, const
141
141
backtrace_flags = 0 ;
142
142
if (s -> cur_func && s -> cur_func -> backtrace_barrier )
143
143
backtrace_flags = JS_BACKTRACE_FLAG_SINGLE_LEVEL ;
144
+
145
+ int column_num = s -> column_last_ptr - s -> column_ptr ;
144
146
build_backtrace (ctx , ctx -> rt -> current_exception ,
145
147
s -> filename , s -> line_num ,
146
- s -> column_last_ptr - s -> column_ptr ,
148
+ column_num < 0 ? -1 : column_num ,
147
149
backtrace_flags );
148
150
return -1 ;
149
151
}
@@ -4719,10 +4721,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
4719
4721
return -1 ;
4720
4722
}
4721
4723
4722
- /** new expr should location at 'new' keywords */
4723
- if (call_type == FUNC_CALL_NEW ) {
4724
- emit_column (s , column_num );
4725
- }
4724
+ emit_column (s , column_num );
4726
4725
4727
4726
if (s -> token .val == TOK_ELLIPSIS ) {
4728
4727
emit_op (s , OP_array_from );
@@ -4869,7 +4868,8 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
4869
4868
if (next_token (s ))
4870
4869
return -1 ;
4871
4870
4872
- emit_column (s , s -> token .column_num );
4871
+ column_num = s -> token .column_num ;
4872
+ emit_column (s , column_num );
4873
4873
parse_property :
4874
4874
if (s -> token .val == TOK_PRIVATE_NAME ) {
4875
4875
/* private class field */
0 commit comments