fix errors

Former-commit-id: ac66d6af52f6a2340c57a957bed078f94a8cf8ed
This commit is contained in:
Jarred Sumner
2021-08-02 21:22:58 -07:00
parent b6e19438ea
commit dbda84ff87
18 changed files with 1352 additions and 936 deletions

View File

@@ -55,7 +55,6 @@ pub const Response = struct {
pub fn finalize(
this: *Response,
ctx: js.JSObjectRef,
) void {
this.body.deinit(this.allocator);
this.allocator.destroy(this);
@@ -121,16 +120,15 @@ pub const Response = struct {
// return null;
// }
var tup = Repsonse.Class.makeObject(
ctx,
getAllocator(ctx),
);
tup.ptr.* = Response{
var response = getAllocator(ctx).create(Response) catch unreachable;
response.* = Response{
.body = body,
.allocator = getAllocator(ctx),
};
return tup.ref;
return Response.Class.make(
ctx,
response,
);
}
};
@@ -298,7 +296,6 @@ pub const Headers = struct {
pub fn finalize(
this: *Headers,
ctx: js.JSObjectRef,
) void {
this.deinit();
}