mirror of
https://github.com/oven-sh/bun
synced 2026-02-19 15:21:54 +00:00
no usingnamespace, organize jsc namespace, enable -fincremental (#19122)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ const Output = bun.Output;
|
||||
const ZigString = JSC.ZigString;
|
||||
const validators = @import("./util/validators.zig");
|
||||
const debug = bun.Output.scoped(.zlib, true);
|
||||
const Buffer = bun.api.node.Buffer;
|
||||
|
||||
pub fn crc32(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSError!JSC.JSValue {
|
||||
const arguments = callframe.arguments_old(2).ptr;
|
||||
@@ -20,7 +21,7 @@ pub fn crc32(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) bun.JSE
|
||||
if (data.isString()) {
|
||||
break :blk data.asString().toSlice(globalThis, bun.default_allocator);
|
||||
}
|
||||
const buffer: JSC.Buffer = JSC.Buffer.fromJS(globalThis, data) orelse {
|
||||
const buffer: Buffer = Buffer.fromJS(globalThis, data) orelse {
|
||||
const ty_str = data.jsTypeString(globalThis).toSlice(globalThis, bun.default_allocator);
|
||||
defer ty_str.deinit();
|
||||
return globalThis.ERR(.INVALID_ARG_TYPE, "The \"data\" property must be an instance of Buffer, TypedArray, DataView, or ArrayBuffer. Received {s}", .{ty_str.slice()}).throw();
|
||||
|
||||
Reference in New Issue
Block a user