Implement Blob.stream()

This commit is contained in:
Jarred Sumner
2022-05-24 03:12:57 -07:00
parent 7f3bc2b9e6
commit b18b0efb8b
21 changed files with 704 additions and 838 deletions

View File

@@ -2375,7 +2375,7 @@ pub const FFI = struct {
return JSC.toInvalidArguments("ptr to invalid memory, that would segfault Bun :(", .{}, globalThis.ref());
}
return JSC.JSValue.jsNumber(@bitCast(f64, @as(usize, addr)));
return JSC.JSValue.fromPtrAddress(addr);
}
const ValueOrError = union(enum) {

View File

@@ -351,7 +351,7 @@ pub const FFI = struct {
return ZigString.init("Failed to compile (nothing happend!)").toErrorInstance(global);
},
.compiled => |compiled| {
var cb = Bun__CreateFFIFunction(
var cb = JSC.NewFunctionPtr(
global,
&ZigString.init(std.mem.span(function_name)),
@intCast(u32, function.arg_types.items.len),
@@ -443,7 +443,7 @@ pub const FFI = struct {
return ZigString.init("Failed to compile (nothing happend!)").toErrorInstance(global);
},
.compiled => |compiled| {
var cb = Bun__CreateFFIFunction(
var cb = JSC.NewFunctionPtr(
global,
&ZigString.init(std.mem.span(function_name)),
@intCast(u32, function.arg_types.items.len),
@@ -1434,10 +1434,3 @@ pub const FFI = struct {
}
};
};
extern fn Bun__CreateFFIFunction(
globalObject: *JSGlobalObject,
symbolName: *const ZigString,
argCount: u32,
functionPointer: *anyopaque,
) *anyopaque;