Fix console.log regression with emoji

This commit is contained in:
Jarred Sumner
2022-11-30 07:28:48 -08:00
parent f8b87e3ee2
commit 3cb462a3e6
2 changed files with 6 additions and 2 deletions

View File

@@ -1485,7 +1485,7 @@ pub const ZigConsoleClient = struct {
if (!any_non_ascii)
writer.writeAll(end)
else
writer.writeLatin1(end);
writer.writeAll(end);
any_non_ascii = false;
slice = slice[@minimum(slice.len, i + 1)..];
i = 0;
@@ -1518,7 +1518,7 @@ pub const ZigConsoleClient = struct {
}
}
if (slice.len > 0) writer.writeLatin1(slice);
if (slice.len > 0) writer.writeAll(slice);
}
pub fn WrappedWriter(comptime Writer: type) type {

View File

@@ -321,3 +321,7 @@ describe("crash testing", () => {
});
}
});
it("possibly formatted emojis log", () => {
expect(Bun.inspect("✔", "hey")).toBe("✔ hey");
});