diff options
author | 2022-07-02 01:29:58 -0700 | |
---|---|---|
committer | 2022-07-02 01:36:04 -0700 | |
commit | d3ba6f0f121b3cd3f60e3186d772e261836eaff2 (patch) | |
tree | e010fb90a2a7ade0ce61842aacab83d3a5dc50c7 /src/bun.js | |
parent | f6002b799b34dadaab1ea6701569b8a096fbe7e0 (diff) | |
download | bun-d3ba6f0f121b3cd3f60e3186d772e261836eaff2.tar.gz bun-d3ba6f0f121b3cd3f60e3186d772e261836eaff2.tar.zst bun-d3ba6f0f121b3cd3f60e3186d772e261836eaff2.zip |
Rename `defaultErrorHandler` to `runErrorHandler`
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/api/bun.zig | 2 | ||||
-rw-r--r-- | src/bun.js/bindings/bindings.zig | 1 | ||||
-rw-r--r-- | src/bun.js/test/jest.zig | 8 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index c5831ed59..7c0d1b32f 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -2852,7 +2852,7 @@ pub const EnvironmentVariables = struct { }; export fn Bun__reportError(_: *JSGlobalObject, err: JSC.JSValue) void { - JSC.VirtualMachine.vm.defaultErrorHandler(err, null); + JSC.VirtualMachine.vm.runErrorHandler(err, null); } comptime { diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig index 3a44491e4..0d665c266 100644 --- a/src/bun.js/bindings/bindings.zig +++ b/src/bun.js/bindings/bindings.zig @@ -2246,6 +2246,7 @@ pub const JSValue = enum(JSValueReprInt) { } pub fn callWithThis(this: JSValue, globalThis: *JSGlobalObject, thisValue: JSC.JSValue, args: []const JSC.JSValue) JSC.JSValue { + JSC.markBinding(); return JSC.C.JSObjectCallAsFunctionReturnValue( globalThis.ref(), this.asObjectRef(), diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index 31141472a..2e95651c0 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -692,7 +692,7 @@ pub const TestScope = struct { const initial_value = js.JSObjectCallAsFunctionReturnValue(vm.global.ref(), this.callback, null, 0, null); if (initial_value.isException(vm.global.vm()) or initial_value.isError() or initial_value.isAggregateError(vm.global)) { - vm.defaultErrorHandler(initial_value, null); + vm.runErrorHandler(initial_value, null); return .{ .fail = this.counter.actual }; } @@ -709,7 +709,7 @@ pub const TestScope = struct { vm.waitForPromise(this.promise.?); switch (this.promise.?.status(vm.global.vm())) { .Rejected => { - vm.defaultErrorHandler(this.promise.?.result(vm.global.vm()), null); + vm.runErrorHandler(this.promise.?.result(vm.global.vm()), null); return .{ .fail = this.counter.actual }; }, else => { @@ -964,7 +964,7 @@ pub const DescribeScope = struct { if (!beforeEach.isEmpty()) { Jest.runner.?.reportFailure(test_id, source.path.text, tests[i].label, 0, this); - ctx.bunVM().defaultErrorHandler(beforeEach, null); + ctx.bunVM().runErrorHandler(beforeEach, null); i += 1; continue; } @@ -986,7 +986,7 @@ pub const DescribeScope = struct { const afterAll = this.execCallback(ctx, .afterAll); if (!afterAll.isEmpty()) { - ctx.bunVM().defaultErrorHandler(afterAll, null); + ctx.bunVM().runErrorHandler(afterAll, null); } this.tests.deinit(allocator); |