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:
chloe caruso
2025-04-22 16:34:15 -07:00
committed by GitHub
parent 842fe8664e
commit 3349c995b5
271 changed files with 30131 additions and 30868 deletions

View File

@@ -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),
};
}