diff --git a/src/bake/DevServer.zig b/src/bake/DevServer.zig index 1304a99608..18fc8f48f8 100644 --- a/src/bake/DevServer.zig +++ b/src/bake/DevServer.zig @@ -2946,12 +2946,12 @@ pub fn handleRenderRedirect( var params: FrameworkRouter.MatchedParams = undefined; if (dev.router.matchSlow(render_path, ¶ms)) |route_index| { // Found a matching route, bundle it and handle the request - dev.ensureRouteIsBundled( - dev.getOrPutRouteBundle(.{ .framework = route_index }) catch bun.outOfMemory(), + try dev.ensureRouteIsBundled( + dev.getOrPutRouteBundle(.{ .framework = route_index }) catch |err| bun.handleOom(err), .server_handler, .{ .saved = saved_request }, resp, - ) catch bun.outOfMemory(); + ); return; } diff --git a/src/bake/DevServer/SourceMapStore.zig b/src/bake/DevServer/SourceMapStore.zig index 561d9d4897..d7c088ce45 100644 --- a/src/bake/DevServer/SourceMapStore.zig +++ b/src/bake/DevServer/SourceMapStore.zig @@ -213,7 +213,7 @@ pub const Entry = struct { // On the server, escape special characters for JSON var remaining = utf8_input; while (remaining.len > 0) { - if (std.mem.indexOfAny(u8, remaining, "\"\\\n\r\t")) |index| { + if (bun.strings.indexOfAny(remaining, "\"\\\n\r\t")) |index| { // Write everything before the special character if (index > 0) { try writer.appendSlice(remaining[0..index]); diff --git a/src/bun.js/SavedSourceMap.zig b/src/bun.js/SavedSourceMap.zig index c37b32a61e..746c6be99c 100644 --- a/src/bun.js/SavedSourceMap.zig +++ b/src/bun.js/SavedSourceMap.zig @@ -110,7 +110,7 @@ pub fn putBakeSourceProvider(this: *SavedSourceMap, opaque_source_provider: *Bak } pub fn putDevServerSourceProvider(this: *SavedSourceMap, opaque_source_provider: *DevServerSourceProvider, path: []const u8) void { - this.putValue(path, Value.init(opaque_source_provider)) catch bun.outOfMemory(); + this.putValue(path, Value.init(opaque_source_provider)) catch |err| bun.handleOom(err); } pub fn removeDevServerSourceProvider(this: *SavedSourceMap, opaque_source_provider: *anyopaque, path: []const u8) void { @@ -315,7 +315,7 @@ fn getWithContent( if (parse.map) |map| { map.ref(); // The mutex is not locked. We have to check the hash table again. - this.putValue(path, Value.init(map)) catch bun.outOfMemory(); + this.putValue(path, Value.init(map)) catch |err| bun.handleOom(err); return parse; } diff --git a/src/bun.js/api/server/RequestContext.zig b/src/bun.js/api/server/RequestContext.zig index 1fb30d3e16..7d4beafe4a 100644 --- a/src/bun.js/api/server/RequestContext.zig +++ b/src/bun.js/api/server/RequestContext.zig @@ -1917,7 +1917,7 @@ pub fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, const resp = this.resp; this.detachResponse(); - const new_request_ctx = server.request_pool_allocator.tryGet() catch bun.outOfMemory(); + const new_request_ctx = server.request_pool_allocator.tryGet() catch |err| bun.handleOom(err); new_request_ctx.* = .{ .allocator = server.allocator, .resp = resp, @@ -1936,7 +1936,7 @@ pub fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, .request_context = AnyRequestContext.init(new_request_ctx), .https = ssl_enabled, .signal = if (signal) |s| s.ref() else null, - .body = server.vm.initRequestBodyValue(body) catch bun.outOfMemory(), + .body = server.vm.initRequestBodyValue(body) catch |err| bun.handleOom(err), .url = url, }); diff --git a/src/bun.js/webcore/Response.zig b/src/bun.js/webcore/Response.zig index d396956ce4..9f781c1a36 100644 --- a/src/bun.js/webcore/Response.zig +++ b/src/bun.js/webcore/Response.zig @@ -551,7 +551,7 @@ pub fn constructRender( globalThis: *jsc.JSGlobalObject, callframe: *jsc.CallFrame, ) bun.JSError!JSValue { - const arguments = callframe.arguments_old(2); + const arguments = callframe.argumentsAsArray(2); const vm = globalThis.bunVM(); // Check if dev server async local_storage is set @@ -566,7 +566,7 @@ pub fn constructRender( return globalThis.throwInvalidArguments("Response.render() requires at least a path argument", .{}); } - const path_arg = arguments.ptr[0]; + const path_arg = arguments[0]; if (!path_arg.isString()) { return globalThis.throwInvalidArguments("Response.render() path must be a string", .{}); } diff --git a/test/package.json b/test/package.json index 8d448facf5..fd2e375971 100644 --- a/test/package.json +++ b/test/package.json @@ -68,7 +68,7 @@ "node-gyp": "10.0.1", "nodemailer": "6.9.3", "p-queue": "8.1.0", - "peechy": "^0.4.310", + "peechy": "0.4.310", "pg": "8.11.1", "pg-connection-string": "2.6.1", "pg-gateway": "0.3.0-beta.4",