diff options
author | 2022-12-30 04:46:17 -0800 | |
---|---|---|
committer | 2022-12-30 04:46:52 -0800 | |
commit | 2fc69130858870a21e63e4e67a9844ea3f361b17 (patch) | |
tree | dc032412e67b02d18666c88c1e90ac5d03fe62f4 /src/bun.js | |
parent | f444e628ca676a7966a34a1da7cf9f4f26af7fe0 (diff) | |
download | bun-2fc69130858870a21e63e4e67a9844ea3f361b17.tar.gz bun-2fc69130858870a21e63e4e67a9844ea3f361b17.tar.zst bun-2fc69130858870a21e63e4e67a9844ea3f361b17.zip |
More assertions
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/api/server.zig | 6 | ||||
-rw-r--r-- | src/bun.js/webcore/streams.zig | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 3a50a472f..384db3a60 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -1449,7 +1449,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp .sink = .{ .res = this.resp, .allocator = this.allocator, - .buffer = bun.ByteList.init(""), + .buffer = bun.ByteList{}, }, }; var signal = &response_stream.sink.signal; @@ -2291,14 +2291,14 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp if (!last) { readable.ptr.Bytes.onData( .{ - .temporary = bun.ByteList.init(chunk), + .temporary = bun.ByteList.initConst(chunk), }, bun.default_allocator, ); } else { readable.ptr.Bytes.onData( .{ - .temporary_and_done = bun.ByteList.init(chunk), + .temporary_and_done = bun.ByteList.initConst(chunk), }, bun.default_allocator, ); diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig index 6428fb566..f4f4ffb7c 100644 --- a/src/bun.js/webcore/streams.zig +++ b/src/bun.js/webcore/streams.zig @@ -2058,10 +2058,10 @@ pub fn NewJSSink(comptime SinkType: type, comptime name_: []const u8) type { } if (str.is16Bit()) { - return this.sink.writeUTF16(.{ .temporary = bun.ByteList.init(std.mem.sliceAsBytes(str.utf16SliceAligned())) }).toJS(globalThis); + return this.sink.writeUTF16(.{ .temporary = bun.ByteList.initConst(std.mem.sliceAsBytes(str.utf16SliceAligned())) }).toJS(globalThis); } - return this.sink.writeLatin1(.{ .temporary = bun.ByteList.init(str.slice()) }).toJS(globalThis); + return this.sink.writeLatin1(.{ .temporary = bun.ByteList.initConst(str.slice()) }).toJS(globalThis); } pub fn writeUTF8(globalThis: *JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue { |