@@ -1498,7 +1498,6 @@ static void emit_atom(JSParseState *s, JSAtom name)
1498
1498
static void emit_column (JSParseState * s , int column_num ) {
1499
1499
emit_u8 (s , OP_column_num );
1500
1500
emit_u32 (s , column_num );
1501
- // printf("line: %d, column: %d\n", s->line_num, column_num);
1502
1501
}
1503
1502
1504
1503
static int update_label (JSFunctionDef * s , int label , int delta )
@@ -4720,8 +4719,6 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
4720
4719
if (js_parse_expect (s , ',' ))
4721
4720
return -1 ;
4722
4721
}
4723
-
4724
- emit_column (s , column_num );
4725
4722
4726
4723
if (s -> token .val == TOK_ELLIPSIS ) {
4727
4724
emit_op (s , OP_array_from );
@@ -4824,6 +4821,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
4824
4821
break ;
4825
4822
}
4826
4823
} else {
4824
+ emit_column (s , column_num );
4827
4825
if (next_token (s ))
4828
4826
return -1 ;
4829
4827
emit_func_call :
@@ -9554,7 +9552,7 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
9554
9552
len = opcode_info [op ].size ;
9555
9553
pos_next = pos + len ;
9556
9554
}
9557
-
9555
+
9558
9556
s -> column_number_size ++ ;
9559
9557
goto no_change ;
9560
9558
case OP_eval : /* convert scope index to adjusted variable index */
@@ -10265,16 +10263,20 @@ static __exception int resolve_labels(JSContext *ctx, JSFunctionDef *s)
10265
10263
case OP_call_method :
10266
10264
{
10267
10265
/* detect and transform tail calls */
10268
- int argc ;
10269
- argc = get_u16 (bc_buf + pos + 1 );
10266
+ int argc = get_u16 (bc_buf + pos + 1 );
10267
+ s -> column_number_size ++ ;
10268
+
10270
10269
if (code_match (& cc , pos_next , OP_return , -1 )) {
10271
10270
if (cc .line_num >= 0 ) line_num = cc .line_num ;
10272
10271
add_pc2line_info (s , bc_out .size , line_num );
10272
+ add_pc2col_info (s , bc_out .size , column_num );
10273
10273
put_short_code (& bc_out , op + 1 , argc );
10274
10274
pos_next = skip_dead_code (s , bc_buf , bc_len , cc .pos , & line_num );
10275
10275
break ;
10276
10276
}
10277
+
10277
10278
add_pc2line_info (s , bc_out .size , line_num );
10279
+ add_pc2col_info (s , bc_out .size , column_num );
10278
10280
put_short_code (& bc_out , op , argc );
10279
10281
break ;
10280
10282
}
0 commit comments