mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
do not print duplicate code (#16231)
This commit is contained in:
2
.mailmap
Normal file
2
.mailmap
Normal file
@@ -0,0 +1,2 @@
|
||||
# To learn more about git's mailmap: https://ntietz.com/blog/git-mailmap-for-name-changes
|
||||
chloe caruso <git@paperclover.net> <me@paperdave.net>
|
||||
@@ -3974,15 +3974,7 @@ pub const VirtualMachine = struct {
|
||||
|
||||
// We special-case the code property. Let's avoid printing it twice.
|
||||
if (field.eqlComptime("code")) {
|
||||
if (value.isString()) {
|
||||
const str = value.toBunString(this.global);
|
||||
defer str.deref();
|
||||
if (!str.isEmpty()) {
|
||||
if (str.eql(name)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!iterator.tried_code_property) continue;
|
||||
}
|
||||
|
||||
const kind = value.jsType();
|
||||
@@ -4018,7 +4010,7 @@ pub const VirtualMachine = struct {
|
||||
|
||||
try writer.print(comptime Output.prettyFmt(" {}<r><d>:<r> ", allow_ansi_color), .{field});
|
||||
|
||||
// When we're printing errors for a top-level uncaught eception / rejection, suppress further errors here.
|
||||
// When we're printing errors for a top-level uncaught exception / rejection, suppress further errors here.
|
||||
if (allow_side_effects) {
|
||||
if (this.global.hasException()) {
|
||||
this.global.clearException();
|
||||
@@ -4039,7 +4031,7 @@ pub const VirtualMachine = struct {
|
||||
) catch {};
|
||||
|
||||
if (allow_side_effects) {
|
||||
// When we're printing errors for a top-level uncaught eception / rejection, suppress further errors here.
|
||||
// When we're printing errors for a top-level uncaught exception / rejection, suppress further errors here.
|
||||
if (this.global.hasException()) {
|
||||
this.global.clearException();
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ test("throwing inside an error suppresses the error and continues printing prope
|
||||
const { stderr, exitCode } = result;
|
||||
|
||||
expect(stderr.toString().trim()).toStartWith(`error: No such file or directory
|
||||
code: "ENOENT",
|
||||
path: "this-file-path-is-bad",
|
||||
syscall: "open",
|
||||
errno: -2,
|
||||
code: "ENOENT",
|
||||
`);
|
||||
expect(exitCode).toBe(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user