[Bun.js] Fix TypedArray/ArrayBuffer <> Zig interop

This commit is contained in:
Jarred Sumner
2022-01-20 16:19:07 -08:00
parent 85084c6db9
commit 97f0cef391
12 changed files with 198 additions and 104 deletions

View File

@@ -3320,7 +3320,7 @@ pub const NodeFS = struct {
return switch (args.encoding) {
.buffer => .{
.result = .{
.buffer = Buffer.fromBytes(buf.items, _global.default_allocator, JSC.C.JSTypedArrayType.kJSTypedArrayTypeUint8Array),
.buffer = Buffer.fromBytes(buf.items, _global.default_allocator, .Uint8Array),
},
},
else => .{