mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
Better edge case handling in napi_value<->String conversion (#18107)
This commit is contained in:
@@ -208,7 +208,7 @@ pub const WTFStringImplStruct = extern struct {
|
||||
return if (input.len > 0) JSC.WebCore.Encoder.byteLengthU8(input.ptr, input.len, .utf8) else 0;
|
||||
} else {
|
||||
const input = this.utf16Slice();
|
||||
return if (input.len > 0) JSC.WebCore.Encoder.byteLengthU16(input.ptr, input.len, .utf8) else 0;
|
||||
return if (input.len > 0) bun.strings.elementLengthUTF16IntoUTF8([]const u16, input) else 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user