* Fixes #9521

* Another test

* Update load-file-loader-a-lot.test.ts

* Update module_loader.zig

* comments

* Rename variable

* Update module_loader.zig

* Update exports.zig

* small cleanup

* bundows

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2024-03-21 00:06:24 -07:00
committed by GitHub
parent 650dc552d4
commit 0948727243
14 changed files with 189 additions and 47 deletions

View File

@@ -308,6 +308,16 @@ pub const String = extern struct {
}
}
pub fn createIfDifferent(other: String, utf8_slice: []const u8) String {
if (other.tag == .WTFStringImpl) {
if (other.eqlUTF8(utf8_slice)) {
return other.dupeRef();
}
}
return createUTF8(utf8_slice);
}
fn createUninitializedLatin1(len: usize) struct { String, []u8 } {
std.debug.assert(len > 0);
const string = BunString__fromLatin1Unitialized(len);