diff options
author | 2023-09-18 02:33:07 -0500 | |
---|---|---|
committer | 2023-09-18 00:33:07 -0700 | |
commit | c66d4a724b675c6ebbd64ccf98e1ce9933f2ef00 (patch) | |
tree | 153d85e69bff577333100514e01cc53a61f39d1e | |
parent | 9acc081c3a25d7601d44f3249891cc258a74db55 (diff) | |
download | bun-c66d4a724b675c6ebbd64ccf98e1ce9933f2ef00.tar.gz bun-c66d4a724b675c6ebbd64ccf98e1ce9933f2ef00.tar.zst bun-c66d4a724b675c6ebbd64ccf98e1ce9933f2ef00.zip |
feat(console.log): Print annonymus when class name is unknown (#5595)
This matches the functionality in Node.
-rw-r--r-- | src/bun.js/bindings/exports.zig | 2 | ||||
-rw-r--r-- | test/js/web/console/console-log.expected.txt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig index 66bbe798f..af6bb8d7b 100644 --- a/src/bun.js/bindings/exports.zig +++ b/src/bun.js/bindings/exports.zig @@ -2158,7 +2158,7 @@ pub const ZigConsoleClient = struct { this.addForNewLine(printable.len); if (printable.len == 0) { - writer.print(comptime Output.prettyFmt("<cyan>[class]<r>", enable_ansi_colors), .{}); + writer.print(comptime Output.prettyFmt("<cyan>[class (anonymous)]<r>", enable_ansi_colors), .{}); } else { writer.print(comptime Output.prettyFmt("<cyan>[class {}]<r>", enable_ansi_colors), .{printable}); } diff --git a/test/js/web/console/console-log.expected.txt b/test/js/web/console/console-log.expected.txt index 332322665..31316a50f 100644 --- a/test/js/web/console/console-log.expected.txt +++ b/test/js/web/console/console-log.expected.txt @@ -35,7 +35,7 @@ Promise { <pending> } [Function] [Function] [class Foo] -[class] +[class (anonymous)] {} [Function: foooo] /FooRegex/ |