Support using WTF::StringImpl from Zig (#3279)

* Fix `make headers`

* [JS parser] Fix bug with printing non-ascii import paths in ascii mode

* Introduce `bun.String`

* Add test for non-ascii imports & entry points

* Add comment

* Fix build issue

* Support HTTP server

* Make it print the same

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-06-11 05:26:37 -07:00
committed by GitHub
parent 02eafd5019
commit ef65f3c305
34 changed files with 1437 additions and 415 deletions

View File

@@ -1467,6 +1467,17 @@ pub fn toUTF8ListWithType(list_: std.ArrayList(u8), comptime Type: type, utf16:
return toUTF8ListWithTypeBun(list_, Type, utf16);
}
pub fn toUTF8FromLatin1(allocator: std.mem.Allocator, latin1: []const u8) !?std.ArrayList(u8) {
if (bun.JSC.is_bindgen)
unreachable;
if (isAllASCII(latin1))
return null;
var list = try std.ArrayList(u8).initCapacity(allocator, latin1.len);
return try allocateLatin1IntoUTF8WithList(list, 0, []const u8, latin1);
}
pub fn toUTF8ListWithTypeBun(list_: std.ArrayList(u8), comptime Type: type, utf16: Type) !std.ArrayList(u8) {
var list = list_;
var utf16_remaining = utf16;