[bun.js] Handle UTF-16 strings in StringOrBuffer

This commit is contained in:
Jarred Sumner
2022-02-16 04:01:42 -08:00
parent 5a80a2e216
commit d00fe1f8af
2 changed files with 5 additions and 13 deletions

View File

@@ -1179,7 +1179,7 @@ const Arguments = struct {
if (exception.* != null) return null;
const buffer = StringOrBuffer.fromJS(ctx.ptr(), arguments.next() orelse {
const buffer = StringOrBuffer.fromJS(ctx.ptr(), arguments.arena.allocator(), arguments.next() orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"data is required",
@@ -1490,7 +1490,7 @@ const Arguments = struct {
if (exception.* != null) return null;
const data = StringOrBuffer.fromJS(ctx.ptr(), arguments.next() orelse {
const data = StringOrBuffer.fromJS(ctx.ptr(), arguments.arena.allocator(), arguments.next() orelse {
if (exception.* == null) {
JSC.throwInvalidArguments(
"data is required",