mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
no usingnamespace, organize jsc namespace, enable -fincremental (#19122)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
This commit is contained in:
@@ -191,7 +191,7 @@ pub const String = extern struct {
|
||||
}
|
||||
|
||||
pub fn createUTF8(bytes: []const u8) String {
|
||||
return JSC.WebCore.Encoder.toBunStringComptime(bytes, .utf8);
|
||||
return JSC.WebCore.encoding.toBunStringComptime(bytes, .utf8);
|
||||
}
|
||||
|
||||
pub fn createUTF16(bytes: []const u16) String {
|
||||
@@ -447,7 +447,7 @@ pub const String = extern struct {
|
||||
/// Max WTFStringImpl length.
|
||||
/// **Not** in bytes. In characters.
|
||||
pub inline fn max_length() usize {
|
||||
return JSC.string_allocation_limit;
|
||||
return JSC.VirtualMachine.string_allocation_limit;
|
||||
}
|
||||
|
||||
/// If the allocation fails, this will free the bytes and return a dead string.
|
||||
@@ -673,14 +673,14 @@ pub const String = extern struct {
|
||||
|
||||
pub fn encodeInto(self: String, out: []u8, comptime enc: JSC.Node.Encoding) !usize {
|
||||
if (self.isUTF16()) {
|
||||
return JSC.WebCore.Encoder.encodeIntoFrom16(self.utf16(), out, enc, true);
|
||||
return JSC.WebCore.encoding.encodeIntoFrom16(self.utf16(), out, enc, true);
|
||||
}
|
||||
|
||||
if (self.isUTF8()) {
|
||||
@panic("TODO");
|
||||
}
|
||||
|
||||
return JSC.WebCore.Encoder.encodeIntoFrom8(self.latin1(), out, enc);
|
||||
return JSC.WebCore.encoding.encodeIntoFrom8(self.latin1(), out, enc);
|
||||
}
|
||||
|
||||
pub fn encode(self: String, enc: JSC.Node.Encoding) []u8 {
|
||||
@@ -1157,7 +1157,7 @@ pub const SliceWithUnderlyingString = struct {
|
||||
}
|
||||
|
||||
return .{
|
||||
.underlying = JSC.WebCore.Encoder.toBunStringFromOwnedSlice(owned_input_bytes, encoding),
|
||||
.underlying = JSC.WebCore.encoding.toBunStringFromOwnedSlice(owned_input_bytes, encoding),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user