diff options
Diffstat (limited to 'src/javascript')
| -rw-r--r-- | src/javascript/jsc/bindings/exports.zig | 4 | ||||
| -rw-r--r-- | src/javascript/jsc/javascript.zig | 14 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/javascript/jsc/bindings/exports.zig b/src/javascript/jsc/bindings/exports.zig index 8f055d93e..2678e9f8c 100644 --- a/src/javascript/jsc/bindings/exports.zig +++ b/src/javascript/jsc/bindings/exports.zig @@ -328,10 +328,10 @@ pub const ZigStackFrame = extern struct { pub fn format(this: SourceURLFormatter, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { try writer.writeAll(this.source_url.slice()); if (this.position.line > -1 and this.position.column_start > -1) { - try std.fmt.format(writer, ":{d}:{d}", .{ this.position.line, this.position.column_start }); + try std.fmt.format(writer, ":{d}:{d}", .{ this.position.line + 1, this.position.column_start }); } else if (this.position.line > -1) { try std.fmt.format(writer, ":{d}", .{ - this.position.line, + this.position.line + 1, }); } } diff --git a/src/javascript/jsc/javascript.zig b/src/javascript/jsc/javascript.zig index 5cc9f4f75..9d390d834 100644 --- a/src/javascript/jsc/javascript.zig +++ b/src/javascript/jsc/javascript.zig @@ -537,19 +537,9 @@ pub const VirtualMachine = struct { // We are going to print the stack trace backwards const stack = trace.frames(); if (stack.len > 0) { - var i = @intCast(i16, stack.len - 1); + var i: i16 = 0; - var func_name_pad: usize = 0; - while (i >= 0) : (i -= 1) { - const frame = stack[@intCast(usize, i)]; - func_name_pad = std.math.max(func_name_pad, std.fmt.count("{any}", .{ - frame.nameFormatter(allow_ansi_colors), - })); - } - - i = @intCast(i16, stack.len - 1); - - while (i >= 0) : (i -= 1) { + while (i < stack.len) : (i += 1) { const frame = stack[@intCast(usize, i)]; const file = frame.source_url.slice(); const func = frame.function_name.slice(); |
