diff options
| author | 2022-03-23 01:46:47 -0700 | |
|---|---|---|
| committer | 2022-03-23 01:46:47 -0700 | |
| commit | 5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2 (patch) | |
| tree | c7b707280cba036f57ba2888bde6034845cb0448 /src/javascript/jsc/api | |
| parent | 9974142eef9909866128951f64f4beb8a9617db7 (diff) | |
| download | bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.tar.gz bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.tar.zst bun-5e5f0bd2930a0e1a2f897ba6e857be05e8ca04f2.zip | |
[bun.js] Implement Bun.write()
Diffstat (limited to 'src/javascript/jsc/api')
| -rw-r--r-- | src/javascript/jsc/api/bun.zig | 4 | ||||
| -rw-r--r-- | src/javascript/jsc/api/server.zig | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/javascript/jsc/api/bun.zig b/src/javascript/jsc/api/bun.zig index 844c04f09..6c3729f0d 100644 --- a/src/javascript/jsc/api/bun.zig +++ b/src/javascript/jsc/api/bun.zig @@ -962,6 +962,10 @@ pub const Class = NewClass( .rfn = JSC.WebCore.Blob.constructFile, .ts = d.ts{}, }, + .write = .{ + .rfn = JSC.WebCore.Blob.writeFile, + .ts = d.ts{}, + }, }, .{ .main = .{ diff --git a/src/javascript/jsc/api/server.zig b/src/javascript/jsc/api/server.zig index 62eb0b735..cd769c616 100644 --- a/src/javascript/jsc/api/server.zig +++ b/src/javascript/jsc/api/server.zig @@ -273,7 +273,7 @@ pub fn NewServer(comptime ssl_enabled: bool) type { }}; pub fn onSendfile(this: *RequestContext) bool { - const adjusted_count_temporary = @minimum(@truncate(u64, this.sendfile.remain), @as(u63, std.math.maxInt(u63))); + const adjusted_count_temporary = @minimum(@as(u64, this.sendfile.remain), @as(u63, std.math.maxInt(u63))); // TODO we should not need this int cast; improve the return type of `@minimum` const adjusted_count = @intCast(u63, adjusted_count_temporary); |
