diff options
author | 2022-02-27 23:20:10 -0800 | |
---|---|---|
committer | 2022-02-27 23:20:10 -0800 | |
commit | 50560e169ca39c0b4ec163cb32897baf7620aa69 (patch) | |
tree | 83eb721bfd4a0318874c1f69d254a4fd9446512b /src/report.zig | |
parent | 36c249e9c1fc6e0000d23ae0055eed54a5437c74 (diff) | |
download | bun-50560e169ca39c0b4ec163cb32897baf7620aa69.tar.gz bun-50560e169ca39c0b4ec163cb32897baf7620aa69.tar.zst bun-50560e169ca39c0b4ec163cb32897baf7620aa69.zip |
WASM
Diffstat (limited to 'src/report.zig')
-rw-r--r-- | src/report.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/report.zig b/src/report.zig index 075e2fc90..0a368b733 100644 --- a/src/report.zig +++ b/src/report.zig @@ -20,9 +20,10 @@ const CrashReporter = @import("crash_reporter"); const Report = @This(); var crash_report_writer: CrashReportWriter = CrashReportWriter{ .file = null }; +const CrashWritable = if (Environment.isWasm) std.io.fixedBufferStream([2048]u8) else std.fs.File.Writer; var crash_reporter_path: [1024]u8 = undefined; pub const CrashReportWriter = struct { - file: ?std.io.BufferedWriter(4096, std.fs.File.Writer) = null, + file: ?std.io.BufferedWriter(4096, CrashWritable) = null, file_path: []const u8 = "", pub fn printFrame(_: ?*anyopaque, frame: CrashReporter.StackFrame) void { @@ -32,11 +33,13 @@ pub const CrashReportWriter = struct { } pub fn dump() void { - CrashReporter.print(); + if (comptime !Environment.isWasm) + CrashReporter.print(); } pub fn done() void { - CrashReporter.print(); + if (comptime !Environment.isWasm) + CrashReporter.print(); } pub fn print(this: *CrashReportWriter, comptime fmt: string, args: anytype) void { |