aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/__global.zig10
-rw-r--r--src/allocators.zig6
-rw-r--r--src/analytics/analytics_thread.zig8
-rw-r--r--src/ast/base.zig2
-rw-r--r--src/baby_list.zig2
-rw-r--r--src/bench/string-handling.zig2
-rw-r--r--src/bit_set.zig2
-rw-r--r--src/blob.zig2
-rw-r--r--src/boringssl.zig2
-rw-r--r--src/bun.js/api/JSBundler.zig2
-rw-r--r--src/bun.js/api/JSTranspiler.zig2
-rw-r--r--src/bun.js/api/bun.zig62
-rw-r--r--src/bun.js/api/bun/dns_resolver.zig12
-rw-r--r--src/bun.js/api/bun/socket.zig14
-rw-r--r--src/bun.js/api/bun/spawn.zig4
-rw-r--r--src/bun.js/api/bun/subprocess.zig12
-rw-r--r--src/bun.js/api/ffi.zig58
-rw-r--r--src/bun.js/api/filesystem_router.zig8
-rw-r--r--src/bun.js/api/html_rewriter.zig8
-rw-r--r--src/bun.js/api/server.zig66
-rw-r--r--src/bun.js/base.zig8
-rw-r--r--src/bun.js/bindings/bindings-generator.zig4
-rw-r--r--src/bun.js/bindings/bindings.zig8
-rw-r--r--src/bun.js/bindings/bun-simdutf.zig2
-rw-r--r--src/bun.js/bindings/exports.zig6
-rw-r--r--src/bun.js/bindings/generated_classes.zig5581
-rw-r--r--src/bun.js/bindings/generated_classes_list.zig2
-rw-r--r--src/bun.js/bindings/header-gen.zig2
-rw-r--r--src/bun.js/bindings/headers-replacements.zig2
-rw-r--r--src/bun.js/bindings/headers.zig2
-rw-r--r--src/bun.js/config.zig4
-rw-r--r--src/bun.js/event_loop.zig10
-rw-r--r--src/bun.js/javascript.zig58
-rw-r--r--src/bun.js/javascript_core_c_api.zig10
-rw-r--r--src/bun.js/module_loader.zig56
-rw-r--r--src/bun.js/node/buffer.zig2
-rw-r--r--src/bun.js/node/dir_iterator.zig4
-rw-r--r--src/bun.js/node/node_fs.zig6
-rw-r--r--src/bun.js/node/node_fs_binding.zig4
-rw-r--r--src/bun.js/node/node_fs_constant.zig2
-rw-r--r--src/bun.js/node/node_os.zig4
-rw-r--r--src/bun.js/node/os/constants.zig4
-rw-r--r--src/bun.js/node/syscall.zig14
-rw-r--r--src/bun.js/node/types.zig8
-rw-r--r--src/bun.js/rare_data.zig10
-rw-r--r--src/bun.js/script_execution_context.zig2
-rw-r--r--src/bun.js/scripts/generate-classes.ts2
-rw-r--r--src/bun.js/test/jest.zig20
-rw-r--r--src/bun.js/test/pretty_format.zig2
-rw-r--r--src/bun.js/uuid.zig2
-rw-r--r--src/bun.js/webcore.zig6
-rw-r--r--src/bun.js/webcore/blob.zig22
-rw-r--r--src/bun.js/webcore/body.zig22
-rw-r--r--src/bun.js/webcore/encoding.zig20
-rw-r--r--src/bun.js/webcore/request.zig22
-rw-r--r--src/bun.js/webcore/response.zig22
-rw-r--r--src/bun.js/webcore/streams.zig22
-rw-r--r--src/bun_js.zig8
-rw-r--r--src/bun_redirect.zig1
-rw-r--r--src/bundler.zig6
-rw-r--r--src/bundler/bundle_v2.zig2
-rw-r--r--src/bundler/entry_points.zig4
-rw-r--r--src/bundler/generate_node_modules_bundle.zig6
-rw-r--r--src/bunfig.zig4
-rw-r--r--src/c.zig2
-rw-r--r--src/cache.zig4
-rw-r--r--src/cli.zig6
-rw-r--r--src/cli/build_command.zig4
-rw-r--r--src/cli/bunx_command.zig2
-rw-r--r--src/cli/colon_list_type.zig2
-rw-r--r--src/cli/create_command.zig12
-rw-r--r--src/cli/dev_command.zig2
-rw-r--r--src/cli/discord_command.zig2
-rw-r--r--src/cli/init_command.zig4
-rw-r--r--src/cli/install_completions_command.zig8
-rw-r--r--src/cli/package_manager_command.zig2
-rw-r--r--src/cli/run_command.zig4
-rw-r--r--src/cli/shell_completions.zig2
-rw-r--r--src/cli/test_command.zig12
-rw-r--r--src/cli/upgrade_command.zig10
-rw-r--r--src/copy_file.zig4
-rw-r--r--src/crash_reporter.zig2
-rw-r--r--src/css_scanner.zig4
-rw-r--r--src/darwin_c.zig2
-rw-r--r--src/defines-table.zig2
-rw-r--r--src/defines.zig4
-rw-r--r--src/deps/boringssl.translated.zig4
-rw-r--r--src/deps/c_ares.zig2
-rw-r--r--src/deps/diffz/DiffMatchPatch.zig2
-rw-r--r--src/deps/lol-html.zig2
-rw-r--r--src/deps/picohttp.zig8
-rw-r--r--src/deps/uws.zig4
-rw-r--r--src/deps/zig-clap/clap/comptime.zig2
-rw-r--r--src/env_loader.zig4
-rw-r--r--src/feature_flags.zig4
-rw-r--r--src/fs.zig2
-rw-r--r--src/http.zig12
-rw-r--r--src/http/header_builder.zig2
-rw-r--r--src/http/method.zig2
-rw-r--r--src/http/mime_type.zig2
-rw-r--r--src/http/url_path.zig2
-rw-r--r--src/http/websocket.zig2
-rw-r--r--src/http/websocket_http_client.zig8
-rw-r--r--src/http/zlib.zig4
-rw-r--r--src/http_client_async.zig2
-rw-r--r--src/import_record.zig6
-rw-r--r--src/install/bin.zig6
-rw-r--r--src/install/dependency.zig2
-rw-r--r--src/install/extract_tarball.zig2
-rw-r--r--src/install/install.zig2
-rw-r--r--src/install/lockfile.zig2
-rw-r--r--src/install/npm.zig14
-rw-r--r--src/install/repository.zig2
-rw-r--r--src/install/resolvers/folder_resolver.zig6
-rw-r--r--src/install/semver.zig2
-rw-r--r--src/io/io_darwin.zig2
-rw-r--r--src/js_ast.zig10
-rw-r--r--src/js_lexer.zig4
-rw-r--r--src/js_lexer/identifier_cache.zig2
-rw-r--r--src/js_lexer_tables.zig4
-rw-r--r--src/js_parser.zig6
-rw-r--r--src/js_printer.zig4
-rw-r--r--src/json_parser.zig4
-rw-r--r--src/libarchive/libarchive.zig4
-rw-r--r--src/linear_fifo.zig2
-rw-r--r--src/linker.zig6
-rw-r--r--src/linux_c.zig2
-rw-r--r--src/logger.zig6
-rw-r--r--src/main_wasm.zig4
-rw-r--r--src/mdx/mdx_parser.zig4
-rw-r--r--src/mimalloc_arena.zig2
-rw-r--r--src/napi/napi.zig6
-rw-r--r--src/network_thread.zig14
-rw-r--r--src/node_fallbacks.zig2
-rw-r--r--src/node_module_bundle.zig2
-rw-r--r--src/open.zig2
-rw-r--r--src/options.zig6
-rw-r--r--src/output.zig22
-rw-r--r--src/panic_handler.zig4
-rw-r--r--src/renamer.zig4
-rw-r--r--src/report.zig10
-rw-r--r--src/resolver/data_url.zig2
-rw-r--r--src/resolver/dir_info.zig2
-rw-r--r--src/resolver/package_json.zig4
-rw-r--r--src/resolver/resolve_path.zig2
-rw-r--r--src/resolver/resolver.zig4
-rw-r--r--src/resolver/tsconfig_json.zig4
-rw-r--r--src/router.zig4
-rw-r--r--src/runtime.zig2
-rw-r--r--src/sha.zig2
-rw-r--r--src/sourcemap/sourcemap.zig4
-rw-r--r--src/string_builder.zig2
-rw-r--r--src/string_immutable.zig4
-rw-r--r--src/string_joiner.zig2
-rw-r--r--src/string_mutable.zig4
-rw-r--r--src/string_types.zig4
-rw-r--r--src/sync.zig2
-rw-r--r--src/tagged_pointer.zig2
-rw-r--r--src/thread_pool.zig4
-rw-r--r--src/toml/toml_lexer.zig4
-rw-r--r--src/toml/toml_parser.zig4
-rw-r--r--src/url.zig2
-rw-r--r--src/util.zig2
-rw-r--r--src/watcher.zig2
-rw-r--r--src/which.zig2
-rw-r--r--src/which_npm_client.zig2
-rw-r--r--src/work_pool.zig2
-rw-r--r--src/zlib.zig2
168 files changed, 2953 insertions, 3763 deletions
diff --git a/src/__global.zig b/src/__global.zig
index 73afe70c2..3dc4ab538 100644
--- a/src/__global.zig
+++ b/src/__global.zig
@@ -2,10 +2,10 @@ const std = @import("std");
const Environment = @import("./env.zig");
const Output = @import("output.zig");
-const use_mimalloc = @import("bun").use_mimalloc;
+const use_mimalloc = @import("root").bun.use_mimalloc;
const StringTypes = @import("./string_types.zig");
-const Mimalloc = @import("bun").Mimalloc;
-const bun = @import("bun");
+const Mimalloc = @import("root").bun.Mimalloc;
+const bun = @import("root").bun;
const BASE_VERSION = "0.6";
@@ -44,7 +44,7 @@ else
pub inline fn getStartTime() i128 {
if (Environment.isTest) return 0;
- return @import("bun").start_time;
+ return @import("root").bun.start_time;
}
pub const version: @import("./install/semver.zig").Version = .{
@@ -135,7 +135,7 @@ pub fn crash() noreturn {
}
const Global = @This();
-const string = @import("bun").string;
+const string = @import("root").bun.string;
pub const BunInfo = struct {
bun_version: string,
diff --git a/src/allocators.zig b/src/allocators.zig
index b004fa926..2827214af 100644
--- a/src/allocators.zig
+++ b/src/allocators.zig
@@ -4,8 +4,8 @@ const FeatureFlags = @import("./feature_flags.zig");
const Environment = @import("./env.zig");
const Wyhash = std.hash.Wyhash;
const FixedBufferAllocator = std.heap.FixedBufferAllocator;
-const constStrToU8 = @import("bun").constStrToU8;
-const bun = @import("bun");
+const constStrToU8 = @import("root").bun.constStrToU8;
+const bun = @import("root").bun;
pub fn isSliceInBuffer(slice: anytype, buffer: anytype) bool {
return (@ptrToInt(&buffer) <= @ptrToInt(slice.ptr) and (@ptrToInt(slice.ptr) + slice.len) <= (@ptrToInt(buffer) + buffer.len));
}
@@ -75,7 +75,7 @@ fn OverflowGroup(comptime Block: type) type {
// ...right?
const max = 4095;
const UsedSize = std.math.IntFittingRange(0, max + 1);
- const default_allocator = @import("bun").default_allocator;
+ const default_allocator = @import("root").bun.default_allocator;
used: UsedSize = 0,
allocated: UsedSize = 0,
ptrs: [max]*Block = undefined,
diff --git a/src/analytics/analytics_thread.zig b/src/analytics/analytics_thread.zig
index 804960ecc..b6039d3a7 100644
--- a/src/analytics/analytics_thread.zig
+++ b/src/analytics/analytics_thread.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -12,13 +12,13 @@ const C = bun.C;
const sync = @import("../sync.zig");
const std = @import("std");
-const HTTP = @import("bun").HTTP;
+const HTTP = @import("root").bun.HTTP;
const NetworkThread = HTTP.NetworkThread;
const URL = @import("../url.zig").URL;
const Fs = @import("../fs.zig");
const Analytics = @import("./analytics_schema.zig").analytics;
const Writer = @import("./analytics_schema.zig").Writer;
-const Headers = @import("bun").HTTP.Headers;
+const Headers = @import("root").bun.HTTP.Headers;
const Futex = @import("../futex.zig");
const Semver = @import("../install/semver.zig");
@@ -465,7 +465,7 @@ pub const EventList = struct {
var in_buffer = &this.in_buffer;
var buffer_writer = in_buffer.writer();
var analytics_writer = AnalyticsWriter.init(&buffer_writer);
- const Root = @import("bun");
+ const Root = @import("root").bun;
const start_time: i128 = if (@hasDecl(Root, "start_time"))
Root.start_time
else
diff --git a/src/ast/base.zig b/src/ast/base.zig
index d3b3af644..d3e510ae6 100644
--- a/src/ast/base.zig
+++ b/src/ast/base.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const unicode = std.unicode;
pub const JavascriptString = []u16;
diff --git a/src/baby_list.zig b/src/baby_list.zig
index 4edbf0b60..7d3ca44ed 100644
--- a/src/baby_list.zig
+++ b/src/baby_list.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const Environment = @import("./env.zig");
const strings = @import("./string_immutable.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
/// This is like ArrayList except it stores the length and capacity as u32
/// In practice, it is very unusual to have lengths above 4 GB
diff --git a/src/bench/string-handling.zig b/src/bench/string-handling.zig
index 061bc3449..f9bee87e7 100644
--- a/src/bench/string-handling.zig
+++ b/src/bench/string-handling.zig
@@ -1,4 +1,4 @@
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const std = @import("std");
pub fn main() anyerror!void {
diff --git a/src/bit_set.zig b/src/bit_set.zig
index 45ebb85ce..deee255bc 100644
--- a/src/bit_set.zig
+++ b/src/bit_set.zig
@@ -32,7 +32,7 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = bun.Environment;
/// Returns the optimal static bit set type for the specified number
diff --git a/src/blob.zig b/src/blob.zig
index 80ccfe20d..a4a187530 100644
--- a/src/blob.zig
+++ b/src/blob.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const Lock = @import("./lock.zig").Lock;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/boringssl.zig b/src/boringssl.zig
index de5277a98..b2ab55229 100644
--- a/src/boringssl.zig
+++ b/src/boringssl.zig
@@ -1,7 +1,7 @@
const boring = @import("./deps/boringssl.translated.zig");
pub usingnamespace boring;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const builtin = @import("builtin");
var loaded = false;
diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig
index a3adba45c..c16cc8897 100644
--- a/src/bun.js/api/JSBundler.zig
+++ b/src/bun.js/api/JSBundler.zig
@@ -4,7 +4,7 @@ const http = @import("../../http.zig");
const JavaScript = @import("../javascript.zig");
const QueryStringMap = @import("../../url.zig").QueryStringMap;
const CombinedScanner = @import("../../url.zig").CombinedScanner;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const JSC = bun.JSC;
const js = JSC.C;
diff --git a/src/bun.js/api/JSTranspiler.zig b/src/bun.js/api/JSTranspiler.zig
index 465ab0ad4..ea3ea6d56 100644
--- a/src/bun.js/api/JSTranspiler.zig
+++ b/src/bun.js/api/JSTranspiler.zig
@@ -4,7 +4,7 @@ const http = @import("../../http.zig");
const JavaScript = @import("../javascript.zig");
const QueryStringMap = @import("../../url.zig").QueryStringMap;
const CombinedScanner = @import("../../url.zig").CombinedScanner;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const JSC = bun.JSC;
const js = JSC.C;
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig
index 98ad5b314..c70ee6364 100644
--- a/src/bun.js/api/bun.zig
+++ b/src/bun.js/api/bun.zig
@@ -1,13 +1,13 @@
const Bun = @This();
-const default_allocator = @import("bun").default_allocator;
-const bun = @import("bun");
+const default_allocator = @import("root").bun.default_allocator;
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
@@ -16,7 +16,7 @@ const Resolver = @import("../../resolver/resolver.zig");
const ast = @import("../../import_record.zig");
const NodeModuleBundle = @import("../../node_module_bundle.zig").NodeModuleBundle;
const MacroEntryPoint = bun.bundler.MacroEntryPoint;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../../api/schema.zig").Api;
const options = @import("../../options.zig");
const Bundler = bun.Bundler;
@@ -28,7 +28,7 @@ const http = @import("../../http.zig");
const NodeFallbackModules = @import("../../node_fallbacks.zig");
const ImportKind = ast.ImportKind;
const Analytics = @import("../../analytics/analytics_thread.zig");
-const ZigString = @import("bun").JSC.ZigString;
+const ZigString = @import("root").bun.JSC.ZigString;
const Runtime = @import("../../runtime.zig");
const Router = @import("./filesystem_router.zig");
const ImportRecord = ast.ImportRecord;
@@ -36,39 +36,39 @@ const DotEnv = @import("../../env_loader.zig");
const ParseResult = bun.bundler.ParseResult;
const PackageJSON = @import("../../resolver/package_json.zig").PackageJSON;
const MacroRemap = @import("../../resolver/package_json.zig").MacroMap;
-const WebCore = @import("bun").JSC.WebCore;
+const WebCore = @import("root").bun.JSC.WebCore;
const Request = WebCore.Request;
const Response = WebCore.Response;
const Headers = WebCore.Headers;
const Fetch = WebCore.Fetch;
const FetchEvent = WebCore.FetchEvent;
-const js = @import("bun").JSC.C;
-const JSC = @import("bun").JSC;
+const js = @import("root").bun.JSC.C;
+const JSC = @import("root").bun.JSC;
const JSError = @import("../base.zig").JSError;
const d = @import("../base.zig").d;
const MarkedArrayBuffer = @import("../base.zig").MarkedArrayBuffer;
const getAllocator = @import("../base.zig").getAllocator;
-const JSValue = @import("bun").JSC.JSValue;
+const JSValue = @import("root").bun.JSC.JSValue;
const NewClass = @import("../base.zig").NewClass;
-const Microtask = @import("bun").JSC.Microtask;
-const JSGlobalObject = @import("bun").JSC.JSGlobalObject;
-const ExceptionValueRef = @import("bun").JSC.ExceptionValueRef;
-const JSPrivateDataPtr = @import("bun").JSC.JSPrivateDataPtr;
-const ZigConsoleClient = @import("bun").JSC.ZigConsoleClient;
-const Node = @import("bun").JSC.Node;
-const ZigException = @import("bun").JSC.ZigException;
-const ZigStackTrace = @import("bun").JSC.ZigStackTrace;
-const ErrorableResolvedSource = @import("bun").JSC.ErrorableResolvedSource;
-const ResolvedSource = @import("bun").JSC.ResolvedSource;
-const JSPromise = @import("bun").JSC.JSPromise;
-const JSInternalPromise = @import("bun").JSC.JSInternalPromise;
-const JSModuleLoader = @import("bun").JSC.JSModuleLoader;
-const JSPromiseRejectionOperation = @import("bun").JSC.JSPromiseRejectionOperation;
-const Exception = @import("bun").JSC.Exception;
-const ErrorableZigString = @import("bun").JSC.ErrorableZigString;
-const ZigGlobalObject = @import("bun").JSC.ZigGlobalObject;
-const VM = @import("bun").JSC.VM;
-const JSFunction = @import("bun").JSC.JSFunction;
+const Microtask = @import("root").bun.JSC.Microtask;
+const JSGlobalObject = @import("root").bun.JSC.JSGlobalObject;
+const ExceptionValueRef = @import("root").bun.JSC.ExceptionValueRef;
+const JSPrivateDataPtr = @import("root").bun.JSC.JSPrivateDataPtr;
+const ZigConsoleClient = @import("root").bun.JSC.ZigConsoleClient;
+const Node = @import("root").bun.JSC.Node;
+const ZigException = @import("root").bun.JSC.ZigException;
+const ZigStackTrace = @import("root").bun.JSC.ZigStackTrace;
+const ErrorableResolvedSource = @import("root").bun.JSC.ErrorableResolvedSource;
+const ResolvedSource = @import("root").bun.JSC.ResolvedSource;
+const JSPromise = @import("root").bun.JSC.JSPromise;
+const JSInternalPromise = @import("root").bun.JSC.JSInternalPromise;
+const JSModuleLoader = @import("root").bun.JSC.JSModuleLoader;
+const JSPromiseRejectionOperation = @import("root").bun.JSC.JSPromiseRejectionOperation;
+const Exception = @import("root").bun.JSC.Exception;
+const ErrorableZigString = @import("root").bun.JSC.ErrorableZigString;
+const ZigGlobalObject = @import("root").bun.JSC.ZigGlobalObject;
+const VM = @import("root").bun.JSC.VM;
+const JSFunction = @import("root").bun.JSC.JSFunction;
const Config = @import("../config.zig");
const URL = @import("../../url.zig").URL;
const Transpiler = bun.JSC.API.JSTranspiler;
@@ -2828,7 +2828,7 @@ pub const Timer = struct {
return VirtualMachine.get().timer.last_id;
}
- const uws = @import("bun").uws;
+ const uws = @import("root").bun.uws;
// TODO: reference count to avoid multiple Strong references to the same
// object in setInterval
diff --git a/src/bun.js/api/bun/dns_resolver.zig b/src/bun.js/api/bun/dns_resolver.zig
index 83b2e9e87..bec7e4d64 100644
--- a/src/bun.js/api/bun/dns_resolver.zig
+++ b/src/bun.js/api/bun/dns_resolver.zig
@@ -1,16 +1,16 @@
const Bun = @This();
-const default_allocator = @import("bun").default_allocator;
-const bun = @import("bun");
+const default_allocator = @import("root").bun.default_allocator;
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const JSValue = JSC.JSValue;
const JSGlobalObject = JSC.JSGlobalObject;
const c_ares = bun.c_ares;
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 8af1d895b..5980de6ec 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -1,19 +1,19 @@
-const default_allocator = @import("bun").default_allocator;
-const bun = @import("bun");
+const default_allocator = @import("root").bun.default_allocator;
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const JSValue = JSC.JSValue;
const JSGlobalObject = JSC.JSGlobalObject;
const Which = @import("../../../which.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const ZigString = JSC.ZigString;
// const Corker = struct {
// ptr: ?*[16384]u8 = null,
diff --git a/src/bun.js/api/bun/spawn.zig b/src/bun.js/api/bun/spawn.zig
index 8f52109f7..5de8c2265 100644
--- a/src/bun.js/api/bun/spawn.zig
+++ b/src/bun.js/api/bun/spawn.zig
@@ -1,5 +1,5 @@
-const JSC = @import("bun").JSC;
-const bun = @import("bun");
+const JSC = @import("root").bun.JSC;
+const bun = @import("root").bun;
const string = bun.string;
const std = @import("std");
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig
index 58ca8b5e5..e64a348ab 100644
--- a/src/bun.js/api/bun/subprocess.zig
+++ b/src/bun.js/api/bun/subprocess.zig
@@ -1,16 +1,16 @@
const Bun = @This();
-const default_allocator = @import("bun").default_allocator;
-const bun = @import("bun");
+const default_allocator = @import("root").bun.default_allocator;
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const JSValue = JSC.JSValue;
const JSGlobalObject = JSC.JSGlobalObject;
const Which = @import("../../../which.zig");
diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig
index 6e2ad4242..ae3e596f1 100644
--- a/src/bun.js/api/ffi.zig
+++ b/src/bun.js/api/ffi.zig
@@ -1,14 +1,14 @@
const Bun = @This();
const root = @import("root");
const default_allocator = bun.default_allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
@@ -17,7 +17,7 @@ const Resolver = @import("../../resolver/resolver.zig");
const ast = @import("../../import_record.zig");
const NodeModuleBundle = @import("../../node_module_bundle.zig").NodeModuleBundle;
const MacroEntryPoint = bun.bundler.MacroEntryPoint;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../../api/schema.zig").Api;
const options = @import("../../options.zig");
const Bundler = bun.Bundler;
@@ -29,46 +29,46 @@ const http = @import("../../http.zig");
const NodeFallbackModules = @import("../../node_fallbacks.zig");
const ImportKind = ast.ImportKind;
const Analytics = @import("../../analytics/analytics_thread.zig");
-const ZigString = @import("bun").JSC.ZigString;
+const ZigString = @import("root").bun.JSC.ZigString;
const Runtime = @import("../../runtime.zig");
const ImportRecord = ast.ImportRecord;
const DotEnv = @import("../../env_loader.zig");
const ParseResult = bun.bundler.ParseResult;
const PackageJSON = @import("../../resolver/package_json.zig").PackageJSON;
const MacroRemap = @import("../../resolver/package_json.zig").MacroMap;
-const WebCore = @import("bun").JSC.WebCore;
+const WebCore = @import("root").bun.JSC.WebCore;
const Request = WebCore.Request;
const Response = WebCore.Response;
const Headers = WebCore.Headers;
const Fetch = WebCore.Fetch;
const FetchEvent = WebCore.FetchEvent;
-const js = @import("bun").JSC.C;
-const JSC = @import("bun").JSC;
+const js = @import("root").bun.JSC.C;
+const JSC = @import("root").bun.JSC;
const JSError = @import("../base.zig").JSError;
const d = @import("../base.zig").d;
const MarkedArrayBuffer = @import("../base.zig").MarkedArrayBuffer;
const getAllocator = @import("../base.zig").getAllocator;
-const JSValue = @import("bun").JSC.JSValue;
+const JSValue = @import("root").bun.JSC.JSValue;
const NewClass = @import("../base.zig").NewClass;
-const Microtask = @import("bun").JSC.Microtask;
-const JSGlobalObject = @import("bun").JSC.JSGlobalObject;
-const ExceptionValueRef = @import("bun").JSC.ExceptionValueRef;
-const JSPrivateDataPtr = @import("bun").JSC.JSPrivateDataPtr;
-const ZigConsoleClient = @import("bun").JSC.ZigConsoleClient;
-const Node = @import("bun").JSC.Node;
-const ZigException = @import("bun").JSC.ZigException;
-const ZigStackTrace = @import("bun").JSC.ZigStackTrace;
-const ErrorableResolvedSource = @import("bun").JSC.ErrorableResolvedSource;
-const ResolvedSource = @import("bun").JSC.ResolvedSource;
-const JSPromise = @import("bun").JSC.JSPromise;
-const JSInternalPromise = @import("bun").JSC.JSInternalPromise;
-const JSModuleLoader = @import("bun").JSC.JSModuleLoader;
-const JSPromiseRejectionOperation = @import("bun").JSC.JSPromiseRejectionOperation;
-const Exception = @import("bun").JSC.Exception;
-const ErrorableZigString = @import("bun").JSC.ErrorableZigString;
-const ZigGlobalObject = @import("bun").JSC.ZigGlobalObject;
-const VM = @import("bun").JSC.VM;
-const JSFunction = @import("bun").JSC.JSFunction;
+const Microtask = @import("root").bun.JSC.Microtask;
+const JSGlobalObject = @import("root").bun.JSC.JSGlobalObject;
+const ExceptionValueRef = @import("root").bun.JSC.ExceptionValueRef;
+const JSPrivateDataPtr = @import("root").bun.JSC.JSPrivateDataPtr;
+const ZigConsoleClient = @import("root").bun.JSC.ZigConsoleClient;
+const Node = @import("root").bun.JSC.Node;
+const ZigException = @import("root").bun.JSC.ZigException;
+const ZigStackTrace = @import("root").bun.JSC.ZigStackTrace;
+const ErrorableResolvedSource = @import("root").bun.JSC.ErrorableResolvedSource;
+const ResolvedSource = @import("root").bun.JSC.ResolvedSource;
+const JSPromise = @import("root").bun.JSC.JSPromise;
+const JSInternalPromise = @import("root").bun.JSC.JSInternalPromise;
+const JSModuleLoader = @import("root").bun.JSC.JSModuleLoader;
+const JSPromiseRejectionOperation = @import("root").bun.JSC.JSPromiseRejectionOperation;
+const Exception = @import("root").bun.JSC.Exception;
+const ErrorableZigString = @import("root").bun.JSC.ErrorableZigString;
+const ZigGlobalObject = @import("root").bun.JSC.ZigGlobalObject;
+const VM = @import("root").bun.JSC.VM;
+const JSFunction = @import("root").bun.JSC.JSFunction;
const Config = @import("../config.zig");
const URL = @import("../../url.zig").URL;
const VirtualMachine = JSC.VirtualMachine;
diff --git a/src/bun.js/api/filesystem_router.zig b/src/bun.js/api/filesystem_router.zig
index 6e5465055..fff726552 100644
--- a/src/bun.js/api/filesystem_router.zig
+++ b/src/bun.js/api/filesystem_router.zig
@@ -4,9 +4,9 @@ const http = @import("../../http.zig");
const JavaScript = @import("../javascript.zig");
const QueryStringMap = @import("../../url.zig").QueryStringMap;
const CombinedScanner = @import("../../url.zig").CombinedScanner;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const WebCore = JSC.WebCore;
const Bundler = bun.bundler;
@@ -20,7 +20,7 @@ const JSObject = JSC.JSObject;
const JSError = Base.JSError;
const JSValue = JSC.JSValue;
const JSGlobalObject = JSC.JSGlobalObject;
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const NewClass = Base.NewClass;
const To = Base.To;
const Request = WebCore.Request;
@@ -28,7 +28,7 @@ const Request = WebCore.Request;
const FetchEvent = WebCore.FetchEvent;
const URLPath = @import("../../http/url_path.zig");
const URL = @import("../../url.zig").URL;
-const Log = @import("bun").logger;
+const Log = @import("root").bun.logger;
const Resolver = @import("../../resolver/resolver.zig").Resolver;
const Router = @import("../../router.zig");
diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig
index 881982d5e..bfbdb9a37 100644
--- a/src/bun.js/api/html_rewriter.zig
+++ b/src/bun.js/api/html_rewriter.zig
@@ -4,9 +4,9 @@ const http = @import("../../http.zig");
const JavaScript = @import("../javascript.zig");
const QueryStringMap = @import("../../url.zig").QueryStringMap;
const CombinedScanner = @import("../../url.zig").CombinedScanner;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const WebCore = @import("../webcore/response.zig");
const Router = @This();
@@ -21,14 +21,14 @@ const JSObject = JSC.JSObject;
const JSError = Base.JSError;
const JSValue = JSC.JSValue;
const JSGlobalObject = JSC.JSGlobalObject;
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const NewClass = Base.NewClass;
const To = Base.To;
const Request = WebCore.Request;
const FetchEvent = WebCore.FetchEvent;
const Response = WebCore.Response;
-const LOLHTML = @import("bun").LOLHTML;
+const LOLHTML = @import("root").bun.LOLHTML;
const SelectorMap = std.ArrayListUnmanaged(*LOLHTML.HTMLSelector);
pub const LOLHTMLContext = struct {
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 40a78f5c2..9b7cef701 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -1,13 +1,13 @@
const Bun = @This();
-const default_allocator = @import("bun").default_allocator;
-const bun = @import("bun");
+const default_allocator = @import("root").bun.default_allocator;
+const bun = @import("root").bun;
const Environment = bun.Environment;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
const Global = bun.Global;
const strings = bun.strings;
const string = bun.string;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
const std = @import("std");
const Allocator = std.mem.Allocator;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
@@ -16,7 +16,7 @@ const Resolver = @import("../../resolver/resolver.zig");
const ast = @import("../../import_record.zig");
const NodeModuleBundle = @import("../../node_module_bundle.zig").NodeModuleBundle;
const MacroEntryPoint = bun.bundler.MacroEntryPoint;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../../api/schema.zig").Api;
const options = @import("../../options.zig");
const Bundler = bun.Bundler;
@@ -28,56 +28,56 @@ const http = @import("../../http.zig");
const NodeFallbackModules = @import("../../node_fallbacks.zig");
const ImportKind = ast.ImportKind;
const Analytics = @import("../../analytics/analytics_thread.zig");
-const ZigString = @import("bun").JSC.ZigString;
+const ZigString = @import("root").bun.JSC.ZigString;
const Runtime = @import("../../runtime.zig");
const ImportRecord = ast.ImportRecord;
const DotEnv = @import("../../env_loader.zig");
const ParseResult = bun.bundler.ParseResult;
const PackageJSON = @import("../../resolver/package_json.zig").PackageJSON;
const MacroRemap = @import("../../resolver/package_json.zig").MacroMap;
-const WebCore = @import("bun").JSC.WebCore;
+const WebCore = @import("root").bun.JSC.WebCore;
const Request = WebCore.Request;
const Response = WebCore.Response;
const Headers = WebCore.Headers;
const Fetch = WebCore.Fetch;
-const HTTP = @import("bun").HTTP;
+const HTTP = @import("root").bun.HTTP;
const FetchEvent = WebCore.FetchEvent;
-const js = @import("bun").JSC.C;
-const JSC = @import("bun").JSC;
+const js = @import("root").bun.JSC.C;
+const JSC = @import("root").bun.JSC;
const JSError = @import("../base.zig").JSError;
const MarkedArrayBuffer = @import("../base.zig").MarkedArrayBuffer;
const getAllocator = @import("../base.zig").getAllocator;
-const JSValue = @import("bun").JSC.JSValue;
+const JSValue = @import("root").bun.JSC.JSValue;
const NewClass = @import("../base.zig").NewClass;
-const Microtask = @import("bun").JSC.Microtask;
-const JSGlobalObject = @import("bun").JSC.JSGlobalObject;
-const ExceptionValueRef = @import("bun").JSC.ExceptionValueRef;
-const JSPrivateDataPtr = @import("bun").JSC.JSPrivateDataPtr;
-const ZigConsoleClient = @import("bun").JSC.ZigConsoleClient;
-const Node = @import("bun").JSC.Node;
-const ZigException = @import("bun").JSC.ZigException;
-const ZigStackTrace = @import("bun").JSC.ZigStackTrace;
-const ErrorableResolvedSource = @import("bun").JSC.ErrorableResolvedSource;
-const ResolvedSource = @import("bun").JSC.ResolvedSource;
-const JSPromise = @import("bun").JSC.JSPromise;
-const JSInternalPromise = @import("bun").JSC.JSInternalPromise;
-const JSModuleLoader = @import("bun").JSC.JSModuleLoader;
-const JSPromiseRejectionOperation = @import("bun").JSC.JSPromiseRejectionOperation;
-const Exception = @import("bun").JSC.Exception;
-const ErrorableZigString = @import("bun").JSC.ErrorableZigString;
-const ZigGlobalObject = @import("bun").JSC.ZigGlobalObject;
-const VM = @import("bun").JSC.VM;
-const JSFunction = @import("bun").JSC.JSFunction;
+const Microtask = @import("root").bun.JSC.Microtask;
+const JSGlobalObject = @import("root").bun.JSC.JSGlobalObject;
+const ExceptionValueRef = @import("root").bun.JSC.ExceptionValueRef;
+const JSPrivateDataPtr = @import("root").bun.JSC.JSPrivateDataPtr;
+const ZigConsoleClient = @import("root").bun.JSC.ZigConsoleClient;
+const Node = @import("root").bun.JSC.Node;
+const ZigException = @import("root").bun.JSC.ZigException;
+const ZigStackTrace = @import("root").bun.JSC.ZigStackTrace;
+const ErrorableResolvedSource = @import("root").bun.JSC.ErrorableResolvedSource;
+const ResolvedSource = @import("root").bun.JSC.ResolvedSource;
+const JSPromise = @import("root").bun.JSC.JSPromise;
+const JSInternalPromise = @import("root").bun.JSC.JSInternalPromise;
+const JSModuleLoader = @import("root").bun.JSC.JSModuleLoader;
+const JSPromiseRejectionOperation = @import("root").bun.JSC.JSPromiseRejectionOperation;
+const Exception = @import("root").bun.JSC.Exception;
+const ErrorableZigString = @import("root").bun.JSC.ErrorableZigString;
+const ZigGlobalObject = @import("root").bun.JSC.ZigGlobalObject;
+const VM = @import("root").bun.JSC.VM;
+const JSFunction = @import("root").bun.JSC.JSFunction;
const Config = @import("../config.zig");
const URL = @import("../../url.zig").URL;
const VirtualMachine = JSC.VirtualMachine;
const IOTask = JSC.IOTask;
const is_bindgen = JSC.is_bindgen;
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const Fallback = Runtime.Fallback;
const MimeType = HTTP.MimeType;
const Blob = JSC.WebCore.Blob;
-const BoringSSL = @import("bun").BoringSSL;
+const BoringSSL = @import("root").bun.BoringSSL;
const Arena = @import("../../mimalloc_arena.zig").Arena;
const SendfileContext = struct {
fd: i32,
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig
index e33205f37..cbd80db87 100644
--- a/src/bun.js/base.zig
+++ b/src/bun.js/base.zig
@@ -1,6 +1,6 @@
-pub const js = @import("bun").JSC.C;
+pub const js = @import("root").bun.JSC.C;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,7 +13,7 @@ const C = bun.C;
const JavaScript = @import("./javascript.zig");
const ResolveError = JavaScript.ResolveError;
const BuildError = JavaScript.BuildError;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const WebCore = @import("./webcore.zig");
const Test = @import("./test/jest.zig");
const Fetch = WebCore.Fetch;
@@ -22,7 +22,7 @@ const Request = WebCore.Request;
const Router = @import("./api/filesystem_router.zig");
const FetchEvent = WebCore.FetchEvent;
const IdentityContext = @import("../identity_context.zig").IdentityContext;
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const Body = WebCore.Body;
const TaggedPointerTypes = @import("../tagged_pointer.zig");
const TaggedPointerUnion = TaggedPointerTypes.TaggedPointerUnion;
diff --git a/src/bun.js/bindings/bindings-generator.zig b/src/bun.js/bindings/bindings-generator.zig
index 7168585de..f2c084ba5 100644
--- a/src/bun.js/bindings/bindings-generator.zig
+++ b/src/bun.js/bindings/bindings-generator.zig
@@ -15,14 +15,14 @@ const Allocator = std.mem.Allocator;
pub const bindgen = true;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Classes = JSC.GlobalClasses;
pub fn main() anyerror!void {
var allocator = std.heap.c_allocator;
const src: std.builtin.SourceLocation = @src();
- const src_path = comptime @import("bun").Environment.base_path ++ std.fs.path.dirname(src.file).?;
+ const src_path = comptime @import("root").bun.Environment.base_path ++ std.fs.path.dirname(src.file).?;
{
const paths = [_][]const u8{ src_path, "headers.h" };
const paths2 = [_][]const u8{ src_path, "headers-cpp.h" };
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig
index 4ccacad7b..12cc81118 100644
--- a/src/bun.js/bindings/bindings.zig
+++ b/src/bun.js/bindings/bindings.zig
@@ -1,9 +1,9 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const hasRef = std.meta.trait.hasField("ref");
-const C_API = @import("bun").JSC.C;
+const C_API = @import("root").bun.JSC.C;
const StringPointer = @import("../../api/schema.zig").Api.StringPointer;
const Exports = @import("./exports.zig");
const strings = bun.strings;
@@ -13,7 +13,7 @@ const ZigException = Exports.ZigException;
const ZigStackTrace = Exports.ZigStackTrace;
const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Shimmer = JSC.Shimmer;
const FFI = @import("./FFI.zig");
const NullableAllocator = @import("../../nullable_allocator.zig").NullableAllocator;
@@ -746,7 +746,7 @@ pub const ZigString = extern struct {
}
pub fn toJSStringRef(this: *const ZigString) C_API.JSStringRef {
- if (comptime @hasDecl(@import("bun"), "bindgen")) {
+ if (comptime @hasDecl(@import("root").bun, "bindgen")) {
return undefined;
}
diff --git a/src/bun.js/bindings/bun-simdutf.zig b/src/bun.js/bindings/bun-simdutf.zig
index 46851f5ee..9c07c1097 100644
--- a/src/bun.js/bindings/bun-simdutf.zig
+++ b/src/bun.js/bindings/bun-simdutf.zig
@@ -1,4 +1,4 @@
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub const SIMDUTFResult = extern struct {
status: Status,
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig
index 8641dda3a..59953fd17 100644
--- a/src/bun.js/bindings/exports.zig
+++ b/src/bun.js/bindings/exports.zig
@@ -1,14 +1,14 @@
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Fs = @import("../../fs.zig");
const CAPI = JSC.C;
const JS = @import("../javascript.zig");
const JSBase = @import("../base.zig");
const ZigURL = @import("../../url.zig").URL;
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const std = @import("std");
const Shimmer = @import("./shimmer.zig").Shimmer;
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const default_allocator = bun.default_allocator;
const NewGlobalObject = JSC.NewGlobalObject;
const JSGlobalObject = JSC.JSGlobalObject;
diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig
index 191f6c0d4..7adb137be 100644
--- a/src/bun.js/bindings/generated_classes.zig
+++ b/src/bun.js/bindings/generated_classes.zig
@@ -1,4 +1,3 @@
-
/// Generated code! To regenerate, run:
///
/// make codegen
@@ -13,25 +12,23 @@
/// - Add it to generated_classes_list.zig
/// - pub usingnamespace JSC.Codegen.JSMyClassName;
/// 5. make clean-bindings && make bindings -j10
-///
-const JSC = @import("bun").JSC;
+///
+const JSC = @import("root").bun.JSC;
const Classes = @import("./generated_classes_list.zig").Classes;
const Environment = @import("../../env.zig");
const std = @import("std");
-pub const StaticGetterType = fn(*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue) callconv(.C) JSC.JSValue;
-pub const StaticSetterType = fn(*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue, JSC.JSValue) callconv(.C) bool;
-pub const StaticCallbackType = fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
-
-
+pub const StaticGetterType = fn (*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue) callconv(.C) JSC.JSValue;
+pub const StaticSetterType = fn (*JSC.JSGlobalObject, JSC.JSValue, JSC.JSValue, JSC.JSValue) callconv(.C) bool;
+pub const StaticCallbackType = fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
pub const JSBlob = struct {
const Blob = Classes.Blob;
- const GetterType = fn(*Blob, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Blob, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Blob, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Blob, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Blob, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Blob, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Blob, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Blob, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Blob, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Blob, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -40,16 +37,13 @@ pub const JSBlob = struct {
return Blob__fromJS(value);
}
-
-
-
/// Get the Blob constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Blob__getConstructor(globalObject);
}
-
+
/// Create a new instance of Blob
pub fn toJS(this: *Blob, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -64,14 +58,14 @@ pub const JSBlob = struct {
/// Modify the internal ptr to point to a new instance of Blob.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Blob) bool {
- JSC.markBinding(@src());
- return Blob__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Blob__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Blob, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Blob__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Blob__dangerouslySetPtr(value, null));
}
extern fn Blob__fromJS(JSC.JSValue) ?*Blob;
@@ -82,81 +76,60 @@ pub const JSBlob = struct {
extern fn Blob__dangerouslySetPtr(JSC.JSValue, ?*Blob) bool;
comptime {
-
- if (@TypeOf(Blob.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Blob)) {
- @compileLog("Blob.constructor is not a constructor");
+ if (@TypeOf(Blob.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Blob)) {
+ @compileLog("Blob.constructor is not a constructor");
}
-
- if (@TypeOf(Blob.finalize) != (fn(*Blob) callconv(.C) void)) {
- @compileLog("Blob.finalize is not a finalizer");
+
+ if (@TypeOf(Blob.finalize) != (fn (*Blob) callconv(.C) void)) {
+ @compileLog("Blob.finalize is not a finalizer");
}
-
- if (@TypeOf(Blob.getArrayBuffer) != CallbackType)
- @compileLog(
- "Expected Blob.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Blob.getArrayBuffer))
- );
- if (@TypeOf(Blob.getFormData) != CallbackType)
- @compileLog(
- "Expected Blob.getFormData to be a callback but received " ++ @typeName(@TypeOf(Blob.getFormData))
- );
- if (@TypeOf(Blob.getJSON) != CallbackType)
- @compileLog(
- "Expected Blob.getJSON to be a callback but received " ++ @typeName(@TypeOf(Blob.getJSON))
- );
- if (@TypeOf(Blob.getLastModified) != GetterType)
- @compileLog(
- "Expected Blob.getLastModified to be a getter"
- );
-
- if (@TypeOf(Blob.getSize) != GetterType)
- @compileLog(
- "Expected Blob.getSize to be a getter"
- );
-
- if (@TypeOf(Blob.getSlice) != CallbackType)
- @compileLog(
- "Expected Blob.getSlice to be a callback but received " ++ @typeName(@TypeOf(Blob.getSlice))
- );
- if (@TypeOf(Blob.getStream) != CallbackType)
- @compileLog(
- "Expected Blob.getStream to be a callback but received " ++ @typeName(@TypeOf(Blob.getStream))
- );
- if (@TypeOf(Blob.getText) != CallbackType)
- @compileLog(
- "Expected Blob.getText to be a callback but received " ++ @typeName(@TypeOf(Blob.getText))
- );
- if (@TypeOf(Blob.getType) != GetterType)
- @compileLog(
- "Expected Blob.getType to be a getter"
- );
-
- if (@TypeOf(Blob.getWriter) != CallbackType)
- @compileLog(
- "Expected Blob.getWriter to be a callback but received " ++ @typeName(@TypeOf(Blob.getWriter))
- );
+
+ if (@TypeOf(Blob.getArrayBuffer) != CallbackType)
+ @compileLog("Expected Blob.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Blob.getArrayBuffer)));
+ if (@TypeOf(Blob.getFormData) != CallbackType)
+ @compileLog("Expected Blob.getFormData to be a callback but received " ++ @typeName(@TypeOf(Blob.getFormData)));
+ if (@TypeOf(Blob.getJSON) != CallbackType)
+ @compileLog("Expected Blob.getJSON to be a callback but received " ++ @typeName(@TypeOf(Blob.getJSON)));
+ if (@TypeOf(Blob.getLastModified) != GetterType)
+ @compileLog("Expected Blob.getLastModified to be a getter");
+
+ if (@TypeOf(Blob.getSize) != GetterType)
+ @compileLog("Expected Blob.getSize to be a getter");
+
+ if (@TypeOf(Blob.getSlice) != CallbackType)
+ @compileLog("Expected Blob.getSlice to be a callback but received " ++ @typeName(@TypeOf(Blob.getSlice)));
+ if (@TypeOf(Blob.getStream) != CallbackType)
+ @compileLog("Expected Blob.getStream to be a callback but received " ++ @typeName(@TypeOf(Blob.getStream)));
+ if (@TypeOf(Blob.getText) != CallbackType)
+ @compileLog("Expected Blob.getText to be a callback but received " ++ @typeName(@TypeOf(Blob.getText)));
+ if (@TypeOf(Blob.getType) != GetterType)
+ @compileLog("Expected Blob.getType to be a getter");
+
+ if (@TypeOf(Blob.getWriter) != CallbackType)
+ @compileLog("Expected Blob.getWriter to be a callback but received " ++ @typeName(@TypeOf(Blob.getWriter)));
if (!JSC.is_bindgen) {
-@export(Blob.constructor, .{.name = "BlobClass__construct"});
- @export(Blob.finalize, .{.name = "BlobClass__finalize"});
- @export(Blob.getArrayBuffer, .{.name = "BlobPrototype__getArrayBuffer"});
- @export(Blob.getFormData, .{.name = "BlobPrototype__getFormData"});
- @export(Blob.getJSON, .{.name = "BlobPrototype__getJSON"});
- @export(Blob.getLastModified, .{.name = "BlobPrototype__getLastModified"});
- @export(Blob.getSize, .{.name = "BlobPrototype__getSize"});
- @export(Blob.getSlice, .{.name = "BlobPrototype__getSlice"});
- @export(Blob.getStream, .{.name = "BlobPrototype__getStream"});
- @export(Blob.getText, .{.name = "BlobPrototype__getText"});
- @export(Blob.getType, .{.name = "BlobPrototype__getType"});
- @export(Blob.getWriter, .{.name = "BlobPrototype__getWriter"});
+ @export(Blob.constructor, .{ .name = "BlobClass__construct" });
+ @export(Blob.finalize, .{ .name = "BlobClass__finalize" });
+ @export(Blob.getArrayBuffer, .{ .name = "BlobPrototype__getArrayBuffer" });
+ @export(Blob.getFormData, .{ .name = "BlobPrototype__getFormData" });
+ @export(Blob.getJSON, .{ .name = "BlobPrototype__getJSON" });
+ @export(Blob.getLastModified, .{ .name = "BlobPrototype__getLastModified" });
+ @export(Blob.getSize, .{ .name = "BlobPrototype__getSize" });
+ @export(Blob.getSlice, .{ .name = "BlobPrototype__getSlice" });
+ @export(Blob.getStream, .{ .name = "BlobPrototype__getStream" });
+ @export(Blob.getText, .{ .name = "BlobPrototype__getText" });
+ @export(Blob.getType, .{ .name = "BlobPrototype__getType" });
+ @export(Blob.getWriter, .{ .name = "BlobPrototype__getWriter" });
}
}
};
pub const JSCryptoHasher = struct {
const CryptoHasher = Classes.CryptoHasher;
- const GetterType = fn(*CryptoHasher, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*CryptoHasher, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*CryptoHasher, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*CryptoHasher, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*CryptoHasher, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*CryptoHasher, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*CryptoHasher, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -167,35 +140,33 @@ pub const JSCryptoHasher = struct {
extern fn CryptoHasherPrototype__algorithmSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn CryptoHasherPrototype__algorithmGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `CryptoHasher.algorithm` setter
- /// This value will be visited by the garbage collector.
- pub fn algorithmSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- CryptoHasherPrototype__algorithmSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn CryptoHasherPrototype__algorithmGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `CryptoHasher.algorithm` getter
- /// This value will be visited by the garbage collector.
- pub fn algorithmGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = CryptoHasherPrototype__algorithmGetCachedValue(thisValue);
- if (result == .zero)
+ /// `CryptoHasher.algorithm` setter
+ /// This value will be visited by the garbage collector.
+ pub fn algorithmSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ CryptoHasherPrototype__algorithmSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `CryptoHasher.algorithm` getter
+ /// This value will be visited by the garbage collector.
+ pub fn algorithmGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = CryptoHasherPrototype__algorithmGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the CryptoHasher constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return CryptoHasher__getConstructor(globalObject);
}
-
+
/// Create a new instance of CryptoHasher
pub fn toJS(this: *CryptoHasher, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -210,14 +181,14 @@ pub const JSCryptoHasher = struct {
/// Modify the internal ptr to point to a new instance of CryptoHasher.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*CryptoHasher) bool {
- JSC.markBinding(@src());
- return CryptoHasher__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return CryptoHasher__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *CryptoHasher, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(CryptoHasher__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(CryptoHasher__dangerouslySetPtr(value, null));
}
extern fn CryptoHasher__fromJS(JSC.JSValue) ?*CryptoHasher;
@@ -228,61 +199,48 @@ pub const JSCryptoHasher = struct {
extern fn CryptoHasher__dangerouslySetPtr(JSC.JSValue, ?*CryptoHasher) bool;
comptime {
-
- if (@TypeOf(CryptoHasher.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*CryptoHasher)) {
- @compileLog("CryptoHasher.constructor is not a constructor");
+ if (@TypeOf(CryptoHasher.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*CryptoHasher)) {
+ @compileLog("CryptoHasher.constructor is not a constructor");
}
-
- if (@TypeOf(CryptoHasher.finalize) != (fn(*CryptoHasher) callconv(.C) void)) {
- @compileLog("CryptoHasher.finalize is not a finalizer");
+
+ if (@TypeOf(CryptoHasher.finalize) != (fn (*CryptoHasher) callconv(.C) void)) {
+ @compileLog("CryptoHasher.finalize is not a finalizer");
}
-
- if (@TypeOf(CryptoHasher.getAlgorithm) != GetterType)
- @compileLog(
- "Expected CryptoHasher.getAlgorithm to be a getter"
- );
-
- if (@TypeOf(CryptoHasher.getByteLength) != GetterType)
- @compileLog(
- "Expected CryptoHasher.getByteLength to be a getter"
- );
-
- if (@TypeOf(CryptoHasher.digest) != CallbackType)
- @compileLog(
- "Expected CryptoHasher.digest to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.digest))
- );
- if (@TypeOf(CryptoHasher.update) != CallbackType)
- @compileLog(
- "Expected CryptoHasher.update to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.update))
- );
- if (@TypeOf(CryptoHasher.getAlgorithms) != StaticGetterType)
- @compileLog(
- "Expected CryptoHasher.getAlgorithms to be a static getter"
- );
-
- if (@TypeOf(CryptoHasher.hash) != StaticCallbackType)
- @compileLog(
- "Expected CryptoHasher.hash to be a static callback"
- );
+
+ if (@TypeOf(CryptoHasher.getAlgorithm) != GetterType)
+ @compileLog("Expected CryptoHasher.getAlgorithm to be a getter");
+
+ if (@TypeOf(CryptoHasher.getByteLength) != GetterType)
+ @compileLog("Expected CryptoHasher.getByteLength to be a getter");
+
+ if (@TypeOf(CryptoHasher.digest) != CallbackType)
+ @compileLog("Expected CryptoHasher.digest to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.digest)));
+ if (@TypeOf(CryptoHasher.update) != CallbackType)
+ @compileLog("Expected CryptoHasher.update to be a callback but received " ++ @typeName(@TypeOf(CryptoHasher.update)));
+ if (@TypeOf(CryptoHasher.getAlgorithms) != StaticGetterType)
+ @compileLog("Expected CryptoHasher.getAlgorithms to be a static getter");
+
+ if (@TypeOf(CryptoHasher.hash) != StaticCallbackType)
+ @compileLog("Expected CryptoHasher.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(CryptoHasher.constructor, .{.name = "CryptoHasherClass__construct"});
- @export(CryptoHasher.digest, .{.name = "CryptoHasherPrototype__digest"});
- @export(CryptoHasher.finalize, .{.name = "CryptoHasherClass__finalize"});
- @export(CryptoHasher.getAlgorithm, .{.name = "CryptoHasherPrototype__getAlgorithm"});
- @export(CryptoHasher.getAlgorithms, .{.name = "CryptoHasherClass__getAlgorithms"});
- @export(CryptoHasher.getByteLength, .{.name = "CryptoHasherPrototype__getByteLength"});
- @export(CryptoHasher.hash, .{.name = "CryptoHasherClass__hash"});
- @export(CryptoHasher.update, .{.name = "CryptoHasherPrototype__update"});
+ @export(CryptoHasher.constructor, .{ .name = "CryptoHasherClass__construct" });
+ @export(CryptoHasher.digest, .{ .name = "CryptoHasherPrototype__digest" });
+ @export(CryptoHasher.finalize, .{ .name = "CryptoHasherClass__finalize" });
+ @export(CryptoHasher.getAlgorithm, .{ .name = "CryptoHasherPrototype__getAlgorithm" });
+ @export(CryptoHasher.getAlgorithms, .{ .name = "CryptoHasherClass__getAlgorithms" });
+ @export(CryptoHasher.getByteLength, .{ .name = "CryptoHasherPrototype__getByteLength" });
+ @export(CryptoHasher.hash, .{ .name = "CryptoHasherClass__hash" });
+ @export(CryptoHasher.update, .{ .name = "CryptoHasherPrototype__update" });
}
}
};
pub const JSDirent = struct {
const Dirent = Classes.Dirent;
- const GetterType = fn(*Dirent, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Dirent, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Dirent, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Dirent, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Dirent, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Dirent, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Dirent, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Dirent, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -293,35 +251,33 @@ pub const JSDirent = struct {
extern fn DirentPrototype__nameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn DirentPrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Dirent.name` setter
- /// This value will be visited by the garbage collector.
- pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- DirentPrototype__nameSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn DirentPrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Dirent.name` setter
+ /// This value will be visited by the garbage collector.
+ pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ DirentPrototype__nameSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Dirent.name` getter
- /// This value will be visited by the garbage collector.
- pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = DirentPrototype__nameGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Dirent.name` getter
+ /// This value will be visited by the garbage collector.
+ pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = DirentPrototype__nameGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the Dirent constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Dirent__getConstructor(globalObject);
}
-
+
/// Create a new instance of Dirent
pub fn toJS(this: *Dirent, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -336,14 +292,14 @@ pub const JSDirent = struct {
/// Modify the internal ptr to point to a new instance of Dirent.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Dirent) bool {
- JSC.markBinding(@src());
- return Dirent__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Dirent__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Dirent, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Dirent__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Dirent__dangerouslySetPtr(value, null));
}
extern fn Dirent__fromJS(JSC.JSValue) ?*Dirent;
@@ -354,69 +310,52 @@ pub const JSDirent = struct {
extern fn Dirent__dangerouslySetPtr(JSC.JSValue, ?*Dirent) bool;
comptime {
-
- if (@TypeOf(Dirent.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Dirent)) {
- @compileLog("Dirent.constructor is not a constructor");
- }
-
- if (@TypeOf(Dirent.finalize) != (fn(*Dirent) callconv(.C) void)) {
- @compileLog("Dirent.finalize is not a finalizer");
- }
-
- if (@TypeOf(Dirent.isBlockDevice) != CallbackType)
- @compileLog(
- "Expected Dirent.isBlockDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isBlockDevice))
- );
- if (@TypeOf(Dirent.isCharacterDevice) != CallbackType)
- @compileLog(
- "Expected Dirent.isCharacterDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isCharacterDevice))
- );
- if (@TypeOf(Dirent.isDirectory) != CallbackType)
- @compileLog(
- "Expected Dirent.isDirectory to be a callback but received " ++ @typeName(@TypeOf(Dirent.isDirectory))
- );
- if (@TypeOf(Dirent.isFIFO) != CallbackType)
- @compileLog(
- "Expected Dirent.isFIFO to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFIFO))
- );
- if (@TypeOf(Dirent.isFile) != CallbackType)
- @compileLog(
- "Expected Dirent.isFile to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFile))
- );
- if (@TypeOf(Dirent.isSocket) != CallbackType)
- @compileLog(
- "Expected Dirent.isSocket to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSocket))
- );
- if (@TypeOf(Dirent.isSymbolicLink) != CallbackType)
- @compileLog(
- "Expected Dirent.isSymbolicLink to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSymbolicLink))
- );
- if (@TypeOf(Dirent.getName) != GetterType)
- @compileLog(
- "Expected Dirent.getName to be a getter"
- );
+ if (@TypeOf(Dirent.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Dirent)) {
+ @compileLog("Dirent.constructor is not a constructor");
+ }
+
+ if (@TypeOf(Dirent.finalize) != (fn (*Dirent) callconv(.C) void)) {
+ @compileLog("Dirent.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(Dirent.isBlockDevice) != CallbackType)
+ @compileLog("Expected Dirent.isBlockDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isBlockDevice)));
+ if (@TypeOf(Dirent.isCharacterDevice) != CallbackType)
+ @compileLog("Expected Dirent.isCharacterDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isCharacterDevice)));
+ if (@TypeOf(Dirent.isDirectory) != CallbackType)
+ @compileLog("Expected Dirent.isDirectory to be a callback but received " ++ @typeName(@TypeOf(Dirent.isDirectory)));
+ if (@TypeOf(Dirent.isFIFO) != CallbackType)
+ @compileLog("Expected Dirent.isFIFO to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFIFO)));
+ if (@TypeOf(Dirent.isFile) != CallbackType)
+ @compileLog("Expected Dirent.isFile to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFile)));
+ if (@TypeOf(Dirent.isSocket) != CallbackType)
+ @compileLog("Expected Dirent.isSocket to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSocket)));
+ if (@TypeOf(Dirent.isSymbolicLink) != CallbackType)
+ @compileLog("Expected Dirent.isSymbolicLink to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSymbolicLink)));
+ if (@TypeOf(Dirent.getName) != GetterType)
+ @compileLog("Expected Dirent.getName to be a getter");
if (!JSC.is_bindgen) {
-@export(Dirent.constructor, .{.name = "DirentClass__construct"});
- @export(Dirent.finalize, .{.name = "DirentClass__finalize"});
- @export(Dirent.getName, .{.name = "DirentPrototype__getName"});
- @export(Dirent.isBlockDevice, .{.name = "DirentPrototype__isBlockDevice"});
- @export(Dirent.isCharacterDevice, .{.name = "DirentPrototype__isCharacterDevice"});
- @export(Dirent.isDirectory, .{.name = "DirentPrototype__isDirectory"});
- @export(Dirent.isFIFO, .{.name = "DirentPrototype__isFIFO"});
- @export(Dirent.isFile, .{.name = "DirentPrototype__isFile"});
- @export(Dirent.isSocket, .{.name = "DirentPrototype__isSocket"});
- @export(Dirent.isSymbolicLink, .{.name = "DirentPrototype__isSymbolicLink"});
+ @export(Dirent.constructor, .{ .name = "DirentClass__construct" });
+ @export(Dirent.finalize, .{ .name = "DirentClass__finalize" });
+ @export(Dirent.getName, .{ .name = "DirentPrototype__getName" });
+ @export(Dirent.isBlockDevice, .{ .name = "DirentPrototype__isBlockDevice" });
+ @export(Dirent.isCharacterDevice, .{ .name = "DirentPrototype__isCharacterDevice" });
+ @export(Dirent.isDirectory, .{ .name = "DirentPrototype__isDirectory" });
+ @export(Dirent.isFIFO, .{ .name = "DirentPrototype__isFIFO" });
+ @export(Dirent.isFile, .{ .name = "DirentPrototype__isFile" });
+ @export(Dirent.isSocket, .{ .name = "DirentPrototype__isSocket" });
+ @export(Dirent.isSymbolicLink, .{ .name = "DirentPrototype__isSymbolicLink" });
}
}
};
pub const JSExpect = struct {
const Expect = Classes.Expect;
- const GetterType = fn(*Expect, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Expect, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Expect, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Expect, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Expect, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Expect, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Expect, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Expect, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Expect, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Expect, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -427,57 +366,55 @@ pub const JSExpect = struct {
extern fn ExpectPrototype__capturedValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ExpectPrototype__capturedValueGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Expect.capturedValue` setter
- /// This value will be visited by the garbage collector.
- pub fn capturedValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ExpectPrototype__capturedValueSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ExpectPrototype__capturedValueGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Expect.capturedValue` setter
+ /// This value will be visited by the garbage collector.
+ pub fn capturedValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ExpectPrototype__capturedValueSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Expect.capturedValue` getter
- /// This value will be visited by the garbage collector.
- pub fn capturedValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ExpectPrototype__capturedValueGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Expect.capturedValue` getter
+ /// This value will be visited by the garbage collector.
+ pub fn capturedValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ExpectPrototype__capturedValueGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ExpectPrototype__resultValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn ExpectPrototype__resultValueGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Expect.resultValue` setter
- /// This value will be visited by the garbage collector.
- pub fn resultValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ExpectPrototype__resultValueSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ExpectPrototype__resultValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn ExpectPrototype__resultValueGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Expect.resultValue` setter
+ /// This value will be visited by the garbage collector.
+ pub fn resultValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ExpectPrototype__resultValueSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Expect.resultValue` getter
- /// This value will be visited by the garbage collector.
- pub fn resultValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ExpectPrototype__resultValueGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Expect.resultValue` getter
+ /// This value will be visited by the garbage collector.
+ pub fn resultValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ExpectPrototype__resultValueGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the Expect constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Expect__getConstructor(globalObject);
}
-
+
/// Create a new instance of Expect
pub fn toJS(this: *Expect, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -492,14 +429,14 @@ extern fn ExpectPrototype__resultValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalO
/// Modify the internal ptr to point to a new instance of Expect.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Expect) bool {
- JSC.markBinding(@src());
- return Expect__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Expect__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Expect, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Expect__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Expect__dangerouslySetPtr(value, null));
}
extern fn Expect__fromJS(JSC.JSValue) ?*Expect;
@@ -510,280 +447,183 @@ extern fn ExpectPrototype__resultValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalO
extern fn Expect__dangerouslySetPtr(JSC.JSValue, ?*Expect) bool;
comptime {
-
- if (@TypeOf(Expect.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Expect)) {
- @compileLog("Expect.constructor is not a constructor");
- }
-
- if (@TypeOf(Expect.finalize) != (fn(*Expect) callconv(.C) void)) {
- @compileLog("Expect.finalize is not a finalizer");
- }
-
- if (@TypeOf(Expect.getNot) != GetterTypeWithThisValue)
- @compileLog("Expected Expect.getNot to be a getter with thisValue");
- if (@TypeOf(Expect.getRejects) != GetterTypeWithThisValue)
- @compileLog("Expected Expect.getRejects to be a getter with thisValue");
- if (@TypeOf(Expect.getResolves) != GetterTypeWithThisValue)
- @compileLog("Expected Expect.getResolves to be a getter with thisValue");
- if (@TypeOf(Expect.toBe) != CallbackType)
- @compileLog(
- "Expected Expect.toBe to be a callback but received " ++ @typeName(@TypeOf(Expect.toBe))
- );
- if (@TypeOf(Expect.toBeCloseTo) != CallbackType)
- @compileLog(
- "Expected Expect.toBeCloseTo to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeCloseTo))
- );
- if (@TypeOf(Expect.toBeDefined) != CallbackType)
- @compileLog(
- "Expected Expect.toBeDefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeDefined))
- );
- if (@TypeOf(Expect.toBeFalsy) != CallbackType)
- @compileLog(
- "Expected Expect.toBeFalsy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeFalsy))
- );
- if (@TypeOf(Expect.toBeGreaterThan) != CallbackType)
- @compileLog(
- "Expected Expect.toBeGreaterThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThan))
- );
- if (@TypeOf(Expect.toBeGreaterThanOrEqual) != CallbackType)
- @compileLog(
- "Expected Expect.toBeGreaterThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThanOrEqual))
- );
- if (@TypeOf(Expect.toBeInstanceOf) != CallbackType)
- @compileLog(
- "Expected Expect.toBeInstanceOf to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeInstanceOf))
- );
- if (@TypeOf(Expect.toBeLessThan) != CallbackType)
- @compileLog(
- "Expected Expect.toBeLessThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThan))
- );
- if (@TypeOf(Expect.toBeLessThanOrEqual) != CallbackType)
- @compileLog(
- "Expected Expect.toBeLessThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThanOrEqual))
- );
- if (@TypeOf(Expect.toBeNaN) != CallbackType)
- @compileLog(
- "Expected Expect.toBeNaN to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNaN))
- );
- if (@TypeOf(Expect.toBeNull) != CallbackType)
- @compileLog(
- "Expected Expect.toBeNull to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNull))
- );
- if (@TypeOf(Expect.toBeTruthy) != CallbackType)
- @compileLog(
- "Expected Expect.toBeTruthy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeTruthy))
- );
- if (@TypeOf(Expect.toBeUndefined) != CallbackType)
- @compileLog(
- "Expected Expect.toBeUndefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeUndefined))
- );
- if (@TypeOf(Expect.toContain) != CallbackType)
- @compileLog(
- "Expected Expect.toContain to be a callback but received " ++ @typeName(@TypeOf(Expect.toContain))
- );
- if (@TypeOf(Expect.toContainEqual) != CallbackType)
- @compileLog(
- "Expected Expect.toContainEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toContainEqual))
- );
- if (@TypeOf(Expect.toEqual) != CallbackType)
- @compileLog(
- "Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual))
- );
- if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveBeenCalledTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledTimes))
- );
- if (@TypeOf(Expect.toHaveBeenCalledWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveBeenCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledWith))
- );
- if (@TypeOf(Expect.toHaveBeenLastCalledWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveBeenLastCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenLastCalledWith))
- );
- if (@TypeOf(Expect.toHaveBeenNthCalledWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveBeenNthCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenNthCalledWith))
- );
- if (@TypeOf(Expect.toHaveLastReturnedWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveLastReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLastReturnedWith))
- );
- if (@TypeOf(Expect.toHaveLength) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveLength to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLength))
- );
- if (@TypeOf(Expect.toHaveNthReturnedWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveNthReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveNthReturnedWith))
- );
- if (@TypeOf(Expect.toHaveProperty) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveProperty to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveProperty))
- );
- if (@TypeOf(Expect.toHaveReturnedTimes) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveReturnedTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedTimes))
- );
- if (@TypeOf(Expect.toHaveReturnedWith) != CallbackType)
- @compileLog(
- "Expected Expect.toHaveReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedWith))
- );
- if (@TypeOf(Expect.toMatch) != CallbackType)
- @compileLog(
- "Expected Expect.toMatch to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatch))
- );
- if (@TypeOf(Expect.toMatchInlineSnapshot) != CallbackType)
- @compileLog(
- "Expected Expect.toMatchInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchInlineSnapshot))
- );
- if (@TypeOf(Expect.toMatchObject) != CallbackType)
- @compileLog(
- "Expected Expect.toMatchObject to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchObject))
- );
- if (@TypeOf(Expect.toMatchSnapshot) != CallbackType)
- @compileLog(
- "Expected Expect.toMatchSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchSnapshot))
- );
- if (@TypeOf(Expect.toStrictEqual) != CallbackType)
- @compileLog(
- "Expected Expect.toStrictEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toStrictEqual))
- );
- if (@TypeOf(Expect.toThrow) != CallbackType)
- @compileLog(
- "Expected Expect.toThrow to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrow))
- );
- if (@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot) != CallbackType)
- @compileLog(
- "Expected Expect.toThrowErrorMatchingInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot))
- );
- if (@TypeOf(Expect.toThrowErrorMatchingSnapshot) != CallbackType)
- @compileLog(
- "Expected Expect.toThrowErrorMatchingSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingSnapshot))
- );
- if (@TypeOf(Expect.addSnapshotSerializer) != StaticCallbackType)
- @compileLog(
- "Expected Expect.addSnapshotSerializer to be a static callback"
- );
- if (@TypeOf(Expect.any) != StaticCallbackType)
- @compileLog(
- "Expected Expect.any to be a static callback"
- );
- if (@TypeOf(Expect.anything) != StaticCallbackType)
- @compileLog(
- "Expected Expect.anything to be a static callback"
- );
- if (@TypeOf(Expect.arrayContaining) != StaticCallbackType)
- @compileLog(
- "Expected Expect.arrayContaining to be a static callback"
- );
- if (@TypeOf(Expect.assertions) != StaticCallbackType)
- @compileLog(
- "Expected Expect.assertions to be a static callback"
- );
- if (@TypeOf(Expect.extend) != StaticCallbackType)
- @compileLog(
- "Expected Expect.extend to be a static callback"
- );
- if (@TypeOf(Expect.hasAssertions) != StaticCallbackType)
- @compileLog(
- "Expected Expect.hasAssertions to be a static callback"
- );
- if (@TypeOf(Expect.getStaticNot) != StaticGetterType)
- @compileLog(
- "Expected Expect.getStaticNot to be a static getter"
- );
-
- if (@TypeOf(Expect.objectContaining) != StaticCallbackType)
- @compileLog(
- "Expected Expect.objectContaining to be a static callback"
- );
- if (@TypeOf(Expect.getStaticRejects) != StaticGetterType)
- @compileLog(
- "Expected Expect.getStaticRejects to be a static getter"
- );
-
- if (@TypeOf(Expect.getStaticResolves) != StaticGetterType)
- @compileLog(
- "Expected Expect.getStaticResolves to be a static getter"
- );
-
- if (@TypeOf(Expect.stringContaining) != StaticCallbackType)
- @compileLog(
- "Expected Expect.stringContaining to be a static callback"
- );
- if (@TypeOf(Expect.stringMatching) != StaticCallbackType)
- @compileLog(
- "Expected Expect.stringMatching to be a static callback"
- );
- if (@TypeOf(Expect.call) != StaticCallbackType)
- @compileLog(
- "Expected Expect.call to be a static callback"
- );
+ if (@TypeOf(Expect.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Expect)) {
+ @compileLog("Expect.constructor is not a constructor");
+ }
+
+ if (@TypeOf(Expect.finalize) != (fn (*Expect) callconv(.C) void)) {
+ @compileLog("Expect.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(Expect.getNot) != GetterTypeWithThisValue)
+ @compileLog("Expected Expect.getNot to be a getter with thisValue");
+ if (@TypeOf(Expect.getRejects) != GetterTypeWithThisValue)
+ @compileLog("Expected Expect.getRejects to be a getter with thisValue");
+ if (@TypeOf(Expect.getResolves) != GetterTypeWithThisValue)
+ @compileLog("Expected Expect.getResolves to be a getter with thisValue");
+ if (@TypeOf(Expect.toBe) != CallbackType)
+ @compileLog("Expected Expect.toBe to be a callback but received " ++ @typeName(@TypeOf(Expect.toBe)));
+ if (@TypeOf(Expect.toBeCloseTo) != CallbackType)
+ @compileLog("Expected Expect.toBeCloseTo to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeCloseTo)));
+ if (@TypeOf(Expect.toBeDefined) != CallbackType)
+ @compileLog("Expected Expect.toBeDefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeDefined)));
+ if (@TypeOf(Expect.toBeFalsy) != CallbackType)
+ @compileLog("Expected Expect.toBeFalsy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeFalsy)));
+ if (@TypeOf(Expect.toBeGreaterThan) != CallbackType)
+ @compileLog("Expected Expect.toBeGreaterThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThan)));
+ if (@TypeOf(Expect.toBeGreaterThanOrEqual) != CallbackType)
+ @compileLog("Expected Expect.toBeGreaterThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThanOrEqual)));
+ if (@TypeOf(Expect.toBeInstanceOf) != CallbackType)
+ @compileLog("Expected Expect.toBeInstanceOf to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeInstanceOf)));
+ if (@TypeOf(Expect.toBeLessThan) != CallbackType)
+ @compileLog("Expected Expect.toBeLessThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThan)));
+ if (@TypeOf(Expect.toBeLessThanOrEqual) != CallbackType)
+ @compileLog("Expected Expect.toBeLessThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThanOrEqual)));
+ if (@TypeOf(Expect.toBeNaN) != CallbackType)
+ @compileLog("Expected Expect.toBeNaN to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNaN)));
+ if (@TypeOf(Expect.toBeNull) != CallbackType)
+ @compileLog("Expected Expect.toBeNull to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNull)));
+ if (@TypeOf(Expect.toBeTruthy) != CallbackType)
+ @compileLog("Expected Expect.toBeTruthy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeTruthy)));
+ if (@TypeOf(Expect.toBeUndefined) != CallbackType)
+ @compileLog("Expected Expect.toBeUndefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeUndefined)));
+ if (@TypeOf(Expect.toContain) != CallbackType)
+ @compileLog("Expected Expect.toContain to be a callback but received " ++ @typeName(@TypeOf(Expect.toContain)));
+ if (@TypeOf(Expect.toContainEqual) != CallbackType)
+ @compileLog("Expected Expect.toContainEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toContainEqual)));
+ if (@TypeOf(Expect.toEqual) != CallbackType)
+ @compileLog("Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual)));
+ if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType)
+ @compileLog("Expected Expect.toHaveBeenCalledTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledTimes)));
+ if (@TypeOf(Expect.toHaveBeenCalledWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveBeenCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledWith)));
+ if (@TypeOf(Expect.toHaveBeenLastCalledWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveBeenLastCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenLastCalledWith)));
+ if (@TypeOf(Expect.toHaveBeenNthCalledWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveBeenNthCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenNthCalledWith)));
+ if (@TypeOf(Expect.toHaveLastReturnedWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveLastReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLastReturnedWith)));
+ if (@TypeOf(Expect.toHaveLength) != CallbackType)
+ @compileLog("Expected Expect.toHaveLength to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLength)));
+ if (@TypeOf(Expect.toHaveNthReturnedWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveNthReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveNthReturnedWith)));
+ if (@TypeOf(Expect.toHaveProperty) != CallbackType)
+ @compileLog("Expected Expect.toHaveProperty to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveProperty)));
+ if (@TypeOf(Expect.toHaveReturnedTimes) != CallbackType)
+ @compileLog("Expected Expect.toHaveReturnedTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedTimes)));
+ if (@TypeOf(Expect.toHaveReturnedWith) != CallbackType)
+ @compileLog("Expected Expect.toHaveReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedWith)));
+ if (@TypeOf(Expect.toMatch) != CallbackType)
+ @compileLog("Expected Expect.toMatch to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatch)));
+ if (@TypeOf(Expect.toMatchInlineSnapshot) != CallbackType)
+ @compileLog("Expected Expect.toMatchInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchInlineSnapshot)));
+ if (@TypeOf(Expect.toMatchObject) != CallbackType)
+ @compileLog("Expected Expect.toMatchObject to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchObject)));
+ if (@TypeOf(Expect.toMatchSnapshot) != CallbackType)
+ @compileLog("Expected Expect.toMatchSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchSnapshot)));
+ if (@TypeOf(Expect.toStrictEqual) != CallbackType)
+ @compileLog("Expected Expect.toStrictEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toStrictEqual)));
+ if (@TypeOf(Expect.toThrow) != CallbackType)
+ @compileLog("Expected Expect.toThrow to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrow)));
+ if (@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot) != CallbackType)
+ @compileLog("Expected Expect.toThrowErrorMatchingInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot)));
+ if (@TypeOf(Expect.toThrowErrorMatchingSnapshot) != CallbackType)
+ @compileLog("Expected Expect.toThrowErrorMatchingSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingSnapshot)));
+ if (@TypeOf(Expect.addSnapshotSerializer) != StaticCallbackType)
+ @compileLog("Expected Expect.addSnapshotSerializer to be a static callback");
+ if (@TypeOf(Expect.any) != StaticCallbackType)
+ @compileLog("Expected Expect.any to be a static callback");
+ if (@TypeOf(Expect.anything) != StaticCallbackType)
+ @compileLog("Expected Expect.anything to be a static callback");
+ if (@TypeOf(Expect.arrayContaining) != StaticCallbackType)
+ @compileLog("Expected Expect.arrayContaining to be a static callback");
+ if (@TypeOf(Expect.assertions) != StaticCallbackType)
+ @compileLog("Expected Expect.assertions to be a static callback");
+ if (@TypeOf(Expect.extend) != StaticCallbackType)
+ @compileLog("Expected Expect.extend to be a static callback");
+ if (@TypeOf(Expect.hasAssertions) != StaticCallbackType)
+ @compileLog("Expected Expect.hasAssertions to be a static callback");
+ if (@TypeOf(Expect.getStaticNot) != StaticGetterType)
+ @compileLog("Expected Expect.getStaticNot to be a static getter");
+
+ if (@TypeOf(Expect.objectContaining) != StaticCallbackType)
+ @compileLog("Expected Expect.objectContaining to be a static callback");
+ if (@TypeOf(Expect.getStaticRejects) != StaticGetterType)
+ @compileLog("Expected Expect.getStaticRejects to be a static getter");
+
+ if (@TypeOf(Expect.getStaticResolves) != StaticGetterType)
+ @compileLog("Expected Expect.getStaticResolves to be a static getter");
+
+ if (@TypeOf(Expect.stringContaining) != StaticCallbackType)
+ @compileLog("Expected Expect.stringContaining to be a static callback");
+ if (@TypeOf(Expect.stringMatching) != StaticCallbackType)
+ @compileLog("Expected Expect.stringMatching to be a static callback");
+ if (@TypeOf(Expect.call) != StaticCallbackType)
+ @compileLog("Expected Expect.call to be a static callback");
if (!JSC.is_bindgen) {
-@export(Expect.addSnapshotSerializer, .{.name = "ExpectClass__addSnapshotSerializer"});
- @export(Expect.any, .{.name = "ExpectClass__any"});
- @export(Expect.anything, .{.name = "ExpectClass__anything"});
- @export(Expect.arrayContaining, .{.name = "ExpectClass__arrayContaining"});
- @export(Expect.assertions, .{.name = "ExpectClass__assertions"});
- @export(Expect.call, .{.name = "ExpectClass__call"});
- @export(Expect.constructor, .{.name = "ExpectClass__construct"});
- @export(Expect.extend, .{.name = "ExpectClass__extend"});
- @export(Expect.finalize, .{.name = "ExpectClass__finalize"});
- @export(Expect.getNot, .{.name = "ExpectPrototype__getNot"});
- @export(Expect.getRejects, .{.name = "ExpectPrototype__getRejects"});
- @export(Expect.getResolves, .{.name = "ExpectPrototype__getResolves"});
- @export(Expect.getStaticNot, .{.name = "ExpectClass__getStaticNot"});
- @export(Expect.getStaticRejects, .{.name = "ExpectClass__getStaticRejects"});
- @export(Expect.getStaticResolves, .{.name = "ExpectClass__getStaticResolves"});
- @export(Expect.hasAssertions, .{.name = "ExpectClass__hasAssertions"});
- @export(Expect.objectContaining, .{.name = "ExpectClass__objectContaining"});
- @export(Expect.stringContaining, .{.name = "ExpectClass__stringContaining"});
- @export(Expect.stringMatching, .{.name = "ExpectClass__stringMatching"});
- @export(Expect.toBe, .{.name = "ExpectPrototype__toBe"});
- @export(Expect.toBeCloseTo, .{.name = "ExpectPrototype__toBeCloseTo"});
- @export(Expect.toBeDefined, .{.name = "ExpectPrototype__toBeDefined"});
- @export(Expect.toBeFalsy, .{.name = "ExpectPrototype__toBeFalsy"});
- @export(Expect.toBeGreaterThan, .{.name = "ExpectPrototype__toBeGreaterThan"});
- @export(Expect.toBeGreaterThanOrEqual, .{.name = "ExpectPrototype__toBeGreaterThanOrEqual"});
- @export(Expect.toBeInstanceOf, .{.name = "ExpectPrototype__toBeInstanceOf"});
- @export(Expect.toBeLessThan, .{.name = "ExpectPrototype__toBeLessThan"});
- @export(Expect.toBeLessThanOrEqual, .{.name = "ExpectPrototype__toBeLessThanOrEqual"});
- @export(Expect.toBeNaN, .{.name = "ExpectPrototype__toBeNaN"});
- @export(Expect.toBeNull, .{.name = "ExpectPrototype__toBeNull"});
- @export(Expect.toBeTruthy, .{.name = "ExpectPrototype__toBeTruthy"});
- @export(Expect.toBeUndefined, .{.name = "ExpectPrototype__toBeUndefined"});
- @export(Expect.toContain, .{.name = "ExpectPrototype__toContain"});
- @export(Expect.toContainEqual, .{.name = "ExpectPrototype__toContainEqual"});
- @export(Expect.toEqual, .{.name = "ExpectPrototype__toEqual"});
- @export(Expect.toHaveBeenCalledTimes, .{.name = "ExpectPrototype__toHaveBeenCalledTimes"});
- @export(Expect.toHaveBeenCalledWith, .{.name = "ExpectPrototype__toHaveBeenCalledWith"});
- @export(Expect.toHaveBeenLastCalledWith, .{.name = "ExpectPrototype__toHaveBeenLastCalledWith"});
- @export(Expect.toHaveBeenNthCalledWith, .{.name = "ExpectPrototype__toHaveBeenNthCalledWith"});
- @export(Expect.toHaveLastReturnedWith, .{.name = "ExpectPrototype__toHaveLastReturnedWith"});
- @export(Expect.toHaveLength, .{.name = "ExpectPrototype__toHaveLength"});
- @export(Expect.toHaveNthReturnedWith, .{.name = "ExpectPrototype__toHaveNthReturnedWith"});
- @export(Expect.toHaveProperty, .{.name = "ExpectPrototype__toHaveProperty"});
- @export(Expect.toHaveReturnedTimes, .{.name = "ExpectPrototype__toHaveReturnedTimes"});
- @export(Expect.toHaveReturnedWith, .{.name = "ExpectPrototype__toHaveReturnedWith"});
- @export(Expect.toMatch, .{.name = "ExpectPrototype__toMatch"});
- @export(Expect.toMatchInlineSnapshot, .{.name = "ExpectPrototype__toMatchInlineSnapshot"});
- @export(Expect.toMatchObject, .{.name = "ExpectPrototype__toMatchObject"});
- @export(Expect.toMatchSnapshot, .{.name = "ExpectPrototype__toMatchSnapshot"});
- @export(Expect.toStrictEqual, .{.name = "ExpectPrototype__toStrictEqual"});
- @export(Expect.toThrow, .{.name = "ExpectPrototype__toThrow"});
- @export(Expect.toThrowErrorMatchingInlineSnapshot, .{.name = "ExpectPrototype__toThrowErrorMatchingInlineSnapshot"});
- @export(Expect.toThrowErrorMatchingSnapshot, .{.name = "ExpectPrototype__toThrowErrorMatchingSnapshot"});
+ @export(Expect.addSnapshotSerializer, .{ .name = "ExpectClass__addSnapshotSerializer" });
+ @export(Expect.any, .{ .name = "ExpectClass__any" });
+ @export(Expect.anything, .{ .name = "ExpectClass__anything" });
+ @export(Expect.arrayContaining, .{ .name = "ExpectClass__arrayContaining" });
+ @export(Expect.assertions, .{ .name = "ExpectClass__assertions" });
+ @export(Expect.call, .{ .name = "ExpectClass__call" });
+ @export(Expect.constructor, .{ .name = "ExpectClass__construct" });
+ @export(Expect.extend, .{ .name = "ExpectClass__extend" });
+ @export(Expect.finalize, .{ .name = "ExpectClass__finalize" });
+ @export(Expect.getNot, .{ .name = "ExpectPrototype__getNot" });
+ @export(Expect.getRejects, .{ .name = "ExpectPrototype__getRejects" });
+ @export(Expect.getResolves, .{ .name = "ExpectPrototype__getResolves" });
+ @export(Expect.getStaticNot, .{ .name = "ExpectClass__getStaticNot" });
+ @export(Expect.getStaticRejects, .{ .name = "ExpectClass__getStaticRejects" });
+ @export(Expect.getStaticResolves, .{ .name = "ExpectClass__getStaticResolves" });
+ @export(Expect.hasAssertions, .{ .name = "ExpectClass__hasAssertions" });
+ @export(Expect.objectContaining, .{ .name = "ExpectClass__objectContaining" });
+ @export(Expect.stringContaining, .{ .name = "ExpectClass__stringContaining" });
+ @export(Expect.stringMatching, .{ .name = "ExpectClass__stringMatching" });
+ @export(Expect.toBe, .{ .name = "ExpectPrototype__toBe" });
+ @export(Expect.toBeCloseTo, .{ .name = "ExpectPrototype__toBeCloseTo" });
+ @export(Expect.toBeDefined, .{ .name = "ExpectPrototype__toBeDefined" });
+ @export(Expect.toBeFalsy, .{ .name = "ExpectPrototype__toBeFalsy" });
+ @export(Expect.toBeGreaterThan, .{ .name = "ExpectPrototype__toBeGreaterThan" });
+ @export(Expect.toBeGreaterThanOrEqual, .{ .name = "ExpectPrototype__toBeGreaterThanOrEqual" });
+ @export(Expect.toBeInstanceOf, .{ .name = "ExpectPrototype__toBeInstanceOf" });
+ @export(Expect.toBeLessThan, .{ .name = "ExpectPrototype__toBeLessThan" });
+ @export(Expect.toBeLessThanOrEqual, .{ .name = "ExpectPrototype__toBeLessThanOrEqual" });
+ @export(Expect.toBeNaN, .{ .name = "ExpectPrototype__toBeNaN" });
+ @export(Expect.toBeNull, .{ .name = "ExpectPrototype__toBeNull" });
+ @export(Expect.toBeTruthy, .{ .name = "ExpectPrototype__toBeTruthy" });
+ @export(Expect.toBeUndefined, .{ .name = "ExpectPrototype__toBeUndefined" });
+ @export(Expect.toContain, .{ .name = "ExpectPrototype__toContain" });
+ @export(Expect.toContainEqual, .{ .name = "ExpectPrototype__toContainEqual" });
+ @export(Expect.toEqual, .{ .name = "ExpectPrototype__toEqual" });
+ @export(Expect.toHaveBeenCalledTimes, .{ .name = "ExpectPrototype__toHaveBeenCalledTimes" });
+ @export(Expect.toHaveBeenCalledWith, .{ .name = "ExpectPrototype__toHaveBeenCalledWith" });
+ @export(Expect.toHaveBeenLastCalledWith, .{ .name = "ExpectPrototype__toHaveBeenLastCalledWith" });
+ @export(Expect.toHaveBeenNthCalledWith, .{ .name = "ExpectPrototype__toHaveBeenNthCalledWith" });
+ @export(Expect.toHaveLastReturnedWith, .{ .name = "ExpectPrototype__toHaveLastReturnedWith" });
+ @export(Expect.toHaveLength, .{ .name = "ExpectPrototype__toHaveLength" });
+ @export(Expect.toHaveNthReturnedWith, .{ .name = "ExpectPrototype__toHaveNthReturnedWith" });
+ @export(Expect.toHaveProperty, .{ .name = "ExpectPrototype__toHaveProperty" });
+ @export(Expect.toHaveReturnedTimes, .{ .name = "ExpectPrototype__toHaveReturnedTimes" });
+ @export(Expect.toHaveReturnedWith, .{ .name = "ExpectPrototype__toHaveReturnedWith" });
+ @export(Expect.toMatch, .{ .name = "ExpectPrototype__toMatch" });
+ @export(Expect.toMatchInlineSnapshot, .{ .name = "ExpectPrototype__toMatchInlineSnapshot" });
+ @export(Expect.toMatchObject, .{ .name = "ExpectPrototype__toMatchObject" });
+ @export(Expect.toMatchSnapshot, .{ .name = "ExpectPrototype__toMatchSnapshot" });
+ @export(Expect.toStrictEqual, .{ .name = "ExpectPrototype__toStrictEqual" });
+ @export(Expect.toThrow, .{ .name = "ExpectPrototype__toThrow" });
+ @export(Expect.toThrowErrorMatchingInlineSnapshot, .{ .name = "ExpectPrototype__toThrowErrorMatchingInlineSnapshot" });
+ @export(Expect.toThrowErrorMatchingSnapshot, .{ .name = "ExpectPrototype__toThrowErrorMatchingSnapshot" });
}
}
};
pub const JSExpectAny = struct {
const ExpectAny = Classes.ExpectAny;
- const GetterType = fn(*ExpectAny, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*ExpectAny, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*ExpectAny, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*ExpectAny, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*ExpectAny, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*ExpectAny, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*ExpectAny, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*ExpectAny, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*ExpectAny, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*ExpectAny, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -794,28 +634,26 @@ pub const JSExpectAny = struct {
extern fn ExpectAnyPrototype__constructorValueSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ExpectAnyPrototype__constructorValueGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `ExpectAny.constructorValue` setter
- /// This value will be visited by the garbage collector.
- pub fn constructorValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ExpectAnyPrototype__constructorValueSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ExpectAnyPrototype__constructorValueGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `ExpectAny.constructorValue` setter
+ /// This value will be visited by the garbage collector.
+ pub fn constructorValueSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ExpectAnyPrototype__constructorValueSetCachedValue(thisValue, globalObject, value);
+ }
- /// `ExpectAny.constructorValue` getter
- /// This value will be visited by the garbage collector.
- pub fn constructorValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ExpectAnyPrototype__constructorValueGetCachedValue(thisValue);
- if (result == .zero)
+ /// `ExpectAny.constructorValue` getter
+ /// This value will be visited by the garbage collector.
+ pub fn constructorValueGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ExpectAnyPrototype__constructorValueGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of ExpectAny
pub fn toJS(this: *ExpectAny, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -830,14 +668,14 @@ pub const JSExpectAny = struct {
/// Modify the internal ptr to point to a new instance of ExpectAny.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*ExpectAny) bool {
- JSC.markBinding(@src());
- return ExpectAny__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return ExpectAny__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *ExpectAny, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(ExpectAny__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(ExpectAny__dangerouslySetPtr(value, null));
}
extern fn ExpectAny__fromJS(JSC.JSValue) ?*ExpectAny;
@@ -848,28 +686,25 @@ pub const JSExpectAny = struct {
extern fn ExpectAny__dangerouslySetPtr(JSC.JSValue, ?*ExpectAny) bool;
comptime {
-
- if (@TypeOf(ExpectAny.finalize) != (fn(*ExpectAny) callconv(.C) void)) {
- @compileLog("ExpectAny.finalize is not a finalizer");
+ if (@TypeOf(ExpectAny.finalize) != (fn (*ExpectAny) callconv(.C) void)) {
+ @compileLog("ExpectAny.finalize is not a finalizer");
}
-
- if (@TypeOf(ExpectAny.call) != StaticCallbackType)
- @compileLog(
- "Expected ExpectAny.call to be a static callback"
- );
+
+ if (@TypeOf(ExpectAny.call) != StaticCallbackType)
+ @compileLog("Expected ExpectAny.call to be a static callback");
if (!JSC.is_bindgen) {
-@export(ExpectAny.call, .{.name = "ExpectAnyClass__call"});
- @export(ExpectAny.finalize, .{.name = "ExpectAnyClass__finalize"});
+ @export(ExpectAny.call, .{ .name = "ExpectAnyClass__call" });
+ @export(ExpectAny.finalize, .{ .name = "ExpectAnyClass__finalize" });
}
}
};
pub const JSFileSystemRouter = struct {
const FileSystemRouter = Classes.FileSystemRouter;
- const GetterType = fn(*FileSystemRouter, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*FileSystemRouter, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*FileSystemRouter, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*FileSystemRouter, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*FileSystemRouter, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*FileSystemRouter, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*FileSystemRouter, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -880,79 +715,77 @@ pub const JSFileSystemRouter = struct {
extern fn FileSystemRouterPrototype__originSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn FileSystemRouterPrototype__originGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `FileSystemRouter.origin` setter
- /// This value will be visited by the garbage collector.
- pub fn originSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- FileSystemRouterPrototype__originSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn FileSystemRouterPrototype__originGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `FileSystemRouter.origin` setter
+ /// This value will be visited by the garbage collector.
+ pub fn originSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ FileSystemRouterPrototype__originSetCachedValue(thisValue, globalObject, value);
+ }
- /// `FileSystemRouter.origin` getter
- /// This value will be visited by the garbage collector.
- pub fn originGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = FileSystemRouterPrototype__originGetCachedValue(thisValue);
- if (result == .zero)
+ /// `FileSystemRouter.origin` getter
+ /// This value will be visited by the garbage collector.
+ pub fn originGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = FileSystemRouterPrototype__originGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn FileSystemRouterPrototype__routesSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn FileSystemRouterPrototype__routesGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `FileSystemRouter.routes` setter
- /// This value will be visited by the garbage collector.
- pub fn routesSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- FileSystemRouterPrototype__routesSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn FileSystemRouterPrototype__routesSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `FileSystemRouter.routes` getter
- /// This value will be visited by the garbage collector.
- pub fn routesGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = FileSystemRouterPrototype__routesGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn FileSystemRouterPrototype__routesGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `FileSystemRouter.routes` setter
+ /// This value will be visited by the garbage collector.
+ pub fn routesSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ FileSystemRouterPrototype__routesSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `FileSystemRouter.routes` getter
+ /// This value will be visited by the garbage collector.
+ pub fn routesGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = FileSystemRouterPrototype__routesGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn FileSystemRouterPrototype__styleSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn FileSystemRouterPrototype__styleGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `FileSystemRouter.style` setter
- /// This value will be visited by the garbage collector.
- pub fn styleSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- FileSystemRouterPrototype__styleSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn FileSystemRouterPrototype__styleSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `FileSystemRouter.style` getter
- /// This value will be visited by the garbage collector.
- pub fn styleGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = FileSystemRouterPrototype__styleGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn FileSystemRouterPrototype__styleGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `FileSystemRouter.style` setter
+ /// This value will be visited by the garbage collector.
+ pub fn styleSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ FileSystemRouterPrototype__styleSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `FileSystemRouter.style` getter
+ /// This value will be visited by the garbage collector.
+ pub fn styleGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = FileSystemRouterPrototype__styleGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the FileSystemRouter constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return FileSystemRouter__getConstructor(globalObject);
}
-
+
/// Create a new instance of FileSystemRouter
pub fn toJS(this: *FileSystemRouter, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -967,14 +800,14 @@ extern fn FileSystemRouterPrototype__styleSetCachedValue(JSC.JSValue, *JSC.JSGlo
/// Modify the internal ptr to point to a new instance of FileSystemRouter.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*FileSystemRouter) bool {
- JSC.markBinding(@src());
- return FileSystemRouter__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return FileSystemRouter__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *FileSystemRouter, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(FileSystemRouter__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(FileSystemRouter__dangerouslySetPtr(value, null));
}
extern fn FileSystemRouter__fromJS(JSC.JSValue) ?*FileSystemRouter;
@@ -985,56 +818,45 @@ extern fn FileSystemRouterPrototype__styleSetCachedValue(JSC.JSValue, *JSC.JSGlo
extern fn FileSystemRouter__dangerouslySetPtr(JSC.JSValue, ?*FileSystemRouter) bool;
comptime {
-
- if (@TypeOf(FileSystemRouter.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*FileSystemRouter)) {
- @compileLog("FileSystemRouter.constructor is not a constructor");
+ if (@TypeOf(FileSystemRouter.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*FileSystemRouter)) {
+ @compileLog("FileSystemRouter.constructor is not a constructor");
}
-
- if (@TypeOf(FileSystemRouter.finalize) != (fn(*FileSystemRouter) callconv(.C) void)) {
- @compileLog("FileSystemRouter.finalize is not a finalizer");
+
+ if (@TypeOf(FileSystemRouter.finalize) != (fn (*FileSystemRouter) callconv(.C) void)) {
+ @compileLog("FileSystemRouter.finalize is not a finalizer");
}
-
- if (@TypeOf(FileSystemRouter.match) != CallbackType)
- @compileLog(
- "Expected FileSystemRouter.match to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.match))
- );
- if (@TypeOf(FileSystemRouter.getOrigin) != GetterType)
- @compileLog(
- "Expected FileSystemRouter.getOrigin to be a getter"
- );
-
- if (@TypeOf(FileSystemRouter.reload) != CallbackType)
- @compileLog(
- "Expected FileSystemRouter.reload to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.reload))
- );
- if (@TypeOf(FileSystemRouter.getRoutes) != GetterType)
- @compileLog(
- "Expected FileSystemRouter.getRoutes to be a getter"
- );
-
- if (@TypeOf(FileSystemRouter.getStyle) != GetterType)
- @compileLog(
- "Expected FileSystemRouter.getStyle to be a getter"
- );
+
+ if (@TypeOf(FileSystemRouter.match) != CallbackType)
+ @compileLog("Expected FileSystemRouter.match to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.match)));
+ if (@TypeOf(FileSystemRouter.getOrigin) != GetterType)
+ @compileLog("Expected FileSystemRouter.getOrigin to be a getter");
+
+ if (@TypeOf(FileSystemRouter.reload) != CallbackType)
+ @compileLog("Expected FileSystemRouter.reload to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.reload)));
+ if (@TypeOf(FileSystemRouter.getRoutes) != GetterType)
+ @compileLog("Expected FileSystemRouter.getRoutes to be a getter");
+
+ if (@TypeOf(FileSystemRouter.getStyle) != GetterType)
+ @compileLog("Expected FileSystemRouter.getStyle to be a getter");
if (!JSC.is_bindgen) {
-@export(FileSystemRouter.constructor, .{.name = "FileSystemRouterClass__construct"});
- @export(FileSystemRouter.finalize, .{.name = "FileSystemRouterClass__finalize"});
- @export(FileSystemRouter.getOrigin, .{.name = "FileSystemRouterPrototype__getOrigin"});
- @export(FileSystemRouter.getRoutes, .{.name = "FileSystemRouterPrototype__getRoutes"});
- @export(FileSystemRouter.getStyle, .{.name = "FileSystemRouterPrototype__getStyle"});
- @export(FileSystemRouter.match, .{.name = "FileSystemRouterPrototype__match"});
- @export(FileSystemRouter.reload, .{.name = "FileSystemRouterPrototype__reload"});
+ @export(FileSystemRouter.constructor, .{ .name = "FileSystemRouterClass__construct" });
+ @export(FileSystemRouter.finalize, .{ .name = "FileSystemRouterClass__finalize" });
+ @export(FileSystemRouter.getOrigin, .{ .name = "FileSystemRouterPrototype__getOrigin" });
+ @export(FileSystemRouter.getRoutes, .{ .name = "FileSystemRouterPrototype__getRoutes" });
+ @export(FileSystemRouter.getStyle, .{ .name = "FileSystemRouterPrototype__getStyle" });
+ @export(FileSystemRouter.match, .{ .name = "FileSystemRouterPrototype__match" });
+ @export(FileSystemRouter.reload, .{ .name = "FileSystemRouterPrototype__reload" });
}
}
};
pub const JSListener = struct {
const Listener = Classes.Listener;
- const GetterType = fn(*Listener, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Listener, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Listener, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Listener, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Listener, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Listener, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Listener, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Listener, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Listener, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Listener, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -1045,50 +867,48 @@ pub const JSListener = struct {
extern fn ListenerPrototype__hostnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ListenerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Listener.hostname` setter
- /// This value will be visited by the garbage collector.
- pub fn hostnameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ListenerPrototype__hostnameSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ListenerPrototype__hostnameGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Listener.hostname` getter
- /// This value will be visited by the garbage collector.
- pub fn hostnameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ListenerPrototype__hostnameGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Listener.hostname` setter
+ /// This value will be visited by the garbage collector.
+ pub fn hostnameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ListenerPrototype__hostnameSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Listener.hostname` getter
+ /// This value will be visited by the garbage collector.
+ pub fn hostnameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ListenerPrototype__hostnameGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ListenerPrototype__unixSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn ListenerPrototype__unixSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ListenerPrototype__unixGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Listener.unix` setter
- /// This value will be visited by the garbage collector.
- pub fn unixSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ListenerPrototype__unixSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ListenerPrototype__unixGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Listener.unix` getter
- /// This value will be visited by the garbage collector.
- pub fn unixGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ListenerPrototype__unixGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Listener.unix` setter
+ /// This value will be visited by the garbage collector.
+ pub fn unixSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ListenerPrototype__unixSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Listener.unix` getter
+ /// This value will be visited by the garbage collector.
+ pub fn unixGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ListenerPrototype__unixGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of Listener
pub fn toJS(this: *Listener, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -1103,14 +923,14 @@ extern fn ListenerPrototype__unixSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject
/// Modify the internal ptr to point to a new instance of Listener.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Listener) bool {
- JSC.markBinding(@src());
- return Listener__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Listener__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Listener, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Listener__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Listener__dangerouslySetPtr(value, null));
}
extern fn Listener__fromJS(JSC.JSValue) ?*Listener;
@@ -1121,72 +941,53 @@ extern fn ListenerPrototype__unixSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject
extern fn Listener__dangerouslySetPtr(JSC.JSValue, ?*Listener) bool;
comptime {
-
- if (@TypeOf(Listener.finalize) != (fn(*Listener) callconv(.C) void)) {
- @compileLog("Listener.finalize is not a finalizer");
+ if (@TypeOf(Listener.finalize) != (fn (*Listener) callconv(.C) void)) {
+ @compileLog("Listener.finalize is not a finalizer");
}
-
- if (@TypeOf(Listener.getData) != GetterType)
- @compileLog(
- "Expected Listener.getData to be a getter"
- );
-
- if (@TypeOf(Listener.setData) != SetterType)
- @compileLog(
- "Expected Listener.setData to be a setter"
- );
- if (@TypeOf(Listener.getHostname) != GetterType)
- @compileLog(
- "Expected Listener.getHostname to be a getter"
- );
-
- if (@TypeOf(Listener.getPort) != GetterType)
- @compileLog(
- "Expected Listener.getPort to be a getter"
- );
-
- if (@TypeOf(Listener.ref) != CallbackType)
- @compileLog(
- "Expected Listener.ref to be a callback but received " ++ @typeName(@TypeOf(Listener.ref))
- );
- if (@TypeOf(Listener.reload) != CallbackType)
- @compileLog(
- "Expected Listener.reload to be a callback but received " ++ @typeName(@TypeOf(Listener.reload))
- );
- if (@TypeOf(Listener.stop) != CallbackType)
- @compileLog(
- "Expected Listener.stop to be a callback but received " ++ @typeName(@TypeOf(Listener.stop))
- );
- if (@TypeOf(Listener.getUnix) != GetterType)
- @compileLog(
- "Expected Listener.getUnix to be a getter"
- );
-
- if (@TypeOf(Listener.unref) != CallbackType)
- @compileLog(
- "Expected Listener.unref to be a callback but received " ++ @typeName(@TypeOf(Listener.unref))
- );
+
+ if (@TypeOf(Listener.getData) != GetterType)
+ @compileLog("Expected Listener.getData to be a getter");
+
+ if (@TypeOf(Listener.setData) != SetterType)
+ @compileLog("Expected Listener.setData to be a setter");
+ if (@TypeOf(Listener.getHostname) != GetterType)
+ @compileLog("Expected Listener.getHostname to be a getter");
+
+ if (@TypeOf(Listener.getPort) != GetterType)
+ @compileLog("Expected Listener.getPort to be a getter");
+
+ if (@TypeOf(Listener.ref) != CallbackType)
+ @compileLog("Expected Listener.ref to be a callback but received " ++ @typeName(@TypeOf(Listener.ref)));
+ if (@TypeOf(Listener.reload) != CallbackType)
+ @compileLog("Expected Listener.reload to be a callback but received " ++ @typeName(@TypeOf(Listener.reload)));
+ if (@TypeOf(Listener.stop) != CallbackType)
+ @compileLog("Expected Listener.stop to be a callback but received " ++ @typeName(@TypeOf(Listener.stop)));
+ if (@TypeOf(Listener.getUnix) != GetterType)
+ @compileLog("Expected Listener.getUnix to be a getter");
+
+ if (@TypeOf(Listener.unref) != CallbackType)
+ @compileLog("Expected Listener.unref to be a callback but received " ++ @typeName(@TypeOf(Listener.unref)));
if (!JSC.is_bindgen) {
-@export(Listener.finalize, .{.name = "ListenerClass__finalize"});
- @export(Listener.getData, .{.name = "ListenerPrototype__getData"});
- @export(Listener.getHostname, .{.name = "ListenerPrototype__getHostname"});
- @export(Listener.getPort, .{.name = "ListenerPrototype__getPort"});
- @export(Listener.getUnix, .{.name = "ListenerPrototype__getUnix"});
- @export(Listener.ref, .{.name = "ListenerPrototype__ref"});
- @export(Listener.reload, .{.name = "ListenerPrototype__reload"});
- @export(Listener.setData, .{.name = "ListenerPrototype__setData"});
- @export(Listener.stop, .{.name = "ListenerPrototype__stop"});
- @export(Listener.unref, .{.name = "ListenerPrototype__unref"});
+ @export(Listener.finalize, .{ .name = "ListenerClass__finalize" });
+ @export(Listener.getData, .{ .name = "ListenerPrototype__getData" });
+ @export(Listener.getHostname, .{ .name = "ListenerPrototype__getHostname" });
+ @export(Listener.getPort, .{ .name = "ListenerPrototype__getPort" });
+ @export(Listener.getUnix, .{ .name = "ListenerPrototype__getUnix" });
+ @export(Listener.ref, .{ .name = "ListenerPrototype__ref" });
+ @export(Listener.reload, .{ .name = "ListenerPrototype__reload" });
+ @export(Listener.setData, .{ .name = "ListenerPrototype__setData" });
+ @export(Listener.stop, .{ .name = "ListenerPrototype__stop" });
+ @export(Listener.unref, .{ .name = "ListenerPrototype__unref" });
}
}
};
pub const JSMD4 = struct {
const MD4 = Classes.MD4;
- const GetterType = fn(*MD4, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*MD4, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*MD4, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*MD4, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*MD4, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*MD4, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*MD4, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*MD4, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*MD4, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*MD4, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -1195,16 +996,13 @@ pub const JSMD4 = struct {
return MD4__fromJS(value);
}
-
-
-
/// Get the MD4 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return MD4__getConstructor(globalObject);
}
-
+
/// Create a new instance of MD4
pub fn toJS(this: *MD4, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -1219,14 +1017,14 @@ pub const JSMD4 = struct {
/// Modify the internal ptr to point to a new instance of MD4.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*MD4) bool {
- JSC.markBinding(@src());
- return MD4__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return MD4__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *MD4, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(MD4__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(MD4__dangerouslySetPtr(value, null));
}
extern fn MD4__fromJS(JSC.JSValue) ?*MD4;
@@ -1237,55 +1035,44 @@ pub const JSMD4 = struct {
extern fn MD4__dangerouslySetPtr(JSC.JSValue, ?*MD4) bool;
comptime {
-
- if (@TypeOf(MD4.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*MD4)) {
- @compileLog("MD4.constructor is not a constructor");
+ if (@TypeOf(MD4.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*MD4)) {
+ @compileLog("MD4.constructor is not a constructor");
}
-
- if (@TypeOf(MD4.finalize) != (fn(*MD4) callconv(.C) void)) {
- @compileLog("MD4.finalize is not a finalizer");
+
+ if (@TypeOf(MD4.finalize) != (fn (*MD4) callconv(.C) void)) {
+ @compileLog("MD4.finalize is not a finalizer");
}
-
- if (@TypeOf(MD4.getByteLength) != GetterType)
- @compileLog(
- "Expected MD4.getByteLength to be a getter"
- );
-
- if (@TypeOf(MD4.digest) != CallbackType)
- @compileLog(
- "Expected MD4.digest to be a callback but received " ++ @typeName(@TypeOf(MD4.digest))
- );
- if (@TypeOf(MD4.update) != CallbackType)
- @compileLog(
- "Expected MD4.update to be a callback but received " ++ @typeName(@TypeOf(MD4.update))
- );
- if (@TypeOf(MD4.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected MD4.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(MD4.hash) != StaticCallbackType)
- @compileLog(
- "Expected MD4.hash to be a static callback"
- );
+
+ if (@TypeOf(MD4.getByteLength) != GetterType)
+ @compileLog("Expected MD4.getByteLength to be a getter");
+
+ if (@TypeOf(MD4.digest) != CallbackType)
+ @compileLog("Expected MD4.digest to be a callback but received " ++ @typeName(@TypeOf(MD4.digest)));
+ if (@TypeOf(MD4.update) != CallbackType)
+ @compileLog("Expected MD4.update to be a callback but received " ++ @typeName(@TypeOf(MD4.update)));
+ if (@TypeOf(MD4.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected MD4.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(MD4.hash) != StaticCallbackType)
+ @compileLog("Expected MD4.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(MD4.constructor, .{.name = "MD4Class__construct"});
- @export(MD4.digest, .{.name = "MD4Prototype__digest"});
- @export(MD4.finalize, .{.name = "MD4Class__finalize"});
- @export(MD4.getByteLength, .{.name = "MD4Prototype__getByteLength"});
- @export(MD4.getByteLengthStatic, .{.name = "MD4Class__getByteLengthStatic"});
- @export(MD4.hash, .{.name = "MD4Class__hash"});
- @export(MD4.update, .{.name = "MD4Prototype__update"});
+ @export(MD4.constructor, .{ .name = "MD4Class__construct" });
+ @export(MD4.digest, .{ .name = "MD4Prototype__digest" });
+ @export(MD4.finalize, .{ .name = "MD4Class__finalize" });
+ @export(MD4.getByteLength, .{ .name = "MD4Prototype__getByteLength" });
+ @export(MD4.getByteLengthStatic, .{ .name = "MD4Class__getByteLengthStatic" });
+ @export(MD4.hash, .{ .name = "MD4Class__hash" });
+ @export(MD4.update, .{ .name = "MD4Prototype__update" });
}
}
};
pub const JSMD5 = struct {
const MD5 = Classes.MD5;
- const GetterType = fn(*MD5, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*MD5, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*MD5, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*MD5, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*MD5, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*MD5, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*MD5, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*MD5, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*MD5, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*MD5, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -1294,16 +1081,13 @@ pub const JSMD5 = struct {
return MD5__fromJS(value);
}
-
-
-
/// Get the MD5 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return MD5__getConstructor(globalObject);
}
-
+
/// Create a new instance of MD5
pub fn toJS(this: *MD5, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -1318,14 +1102,14 @@ pub const JSMD5 = struct {
/// Modify the internal ptr to point to a new instance of MD5.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*MD5) bool {
- JSC.markBinding(@src());
- return MD5__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return MD5__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *MD5, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(MD5__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(MD5__dangerouslySetPtr(value, null));
}
extern fn MD5__fromJS(JSC.JSValue) ?*MD5;
@@ -1336,55 +1120,44 @@ pub const JSMD5 = struct {
extern fn MD5__dangerouslySetPtr(JSC.JSValue, ?*MD5) bool;
comptime {
-
- if (@TypeOf(MD5.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*MD5)) {
- @compileLog("MD5.constructor is not a constructor");
+ if (@TypeOf(MD5.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*MD5)) {
+ @compileLog("MD5.constructor is not a constructor");
}
-
- if (@TypeOf(MD5.finalize) != (fn(*MD5) callconv(.C) void)) {
- @compileLog("MD5.finalize is not a finalizer");
+
+ if (@TypeOf(MD5.finalize) != (fn (*MD5) callconv(.C) void)) {
+ @compileLog("MD5.finalize is not a finalizer");
}
-
- if (@TypeOf(MD5.getByteLength) != GetterType)
- @compileLog(
- "Expected MD5.getByteLength to be a getter"
- );
-
- if (@TypeOf(MD5.digest) != CallbackType)
- @compileLog(
- "Expected MD5.digest to be a callback but received " ++ @typeName(@TypeOf(MD5.digest))
- );
- if (@TypeOf(MD5.update) != CallbackType)
- @compileLog(
- "Expected MD5.update to be a callback but received " ++ @typeName(@TypeOf(MD5.update))
- );
- if (@TypeOf(MD5.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected MD5.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(MD5.hash) != StaticCallbackType)
- @compileLog(
- "Expected MD5.hash to be a static callback"
- );
+
+ if (@TypeOf(MD5.getByteLength) != GetterType)
+ @compileLog("Expected MD5.getByteLength to be a getter");
+
+ if (@TypeOf(MD5.digest) != CallbackType)
+ @compileLog("Expected MD5.digest to be a callback but received " ++ @typeName(@TypeOf(MD5.digest)));
+ if (@TypeOf(MD5.update) != CallbackType)
+ @compileLog("Expected MD5.update to be a callback but received " ++ @typeName(@TypeOf(MD5.update)));
+ if (@TypeOf(MD5.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected MD5.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(MD5.hash) != StaticCallbackType)
+ @compileLog("Expected MD5.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(MD5.constructor, .{.name = "MD5Class__construct"});
- @export(MD5.digest, .{.name = "MD5Prototype__digest"});
- @export(MD5.finalize, .{.name = "MD5Class__finalize"});
- @export(MD5.getByteLength, .{.name = "MD5Prototype__getByteLength"});
- @export(MD5.getByteLengthStatic, .{.name = "MD5Class__getByteLengthStatic"});
- @export(MD5.hash, .{.name = "MD5Class__hash"});
- @export(MD5.update, .{.name = "MD5Prototype__update"});
+ @export(MD5.constructor, .{ .name = "MD5Class__construct" });
+ @export(MD5.digest, .{ .name = "MD5Prototype__digest" });
+ @export(MD5.finalize, .{ .name = "MD5Class__finalize" });
+ @export(MD5.getByteLength, .{ .name = "MD5Prototype__getByteLength" });
+ @export(MD5.getByteLengthStatic, .{ .name = "MD5Class__getByteLengthStatic" });
+ @export(MD5.hash, .{ .name = "MD5Class__hash" });
+ @export(MD5.update, .{ .name = "MD5Prototype__update" });
}
}
};
pub const JSMatchedRoute = struct {
const MatchedRoute = Classes.MatchedRoute;
- const GetterType = fn(*MatchedRoute, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*MatchedRoute, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*MatchedRoute, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*MatchedRoute, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*MatchedRoute, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*MatchedRoute, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*MatchedRoute, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*MatchedRoute, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*MatchedRoute, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*MatchedRoute, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -1395,160 +1168,158 @@ pub const JSMatchedRoute = struct {
extern fn MatchedRoutePrototype__filePathSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn MatchedRoutePrototype__filePathGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.filePath` setter
- /// This value will be visited by the garbage collector.
- pub fn filePathSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__filePathSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__filePathGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `MatchedRoute.filePath` getter
- /// This value will be visited by the garbage collector.
- pub fn filePathGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__filePathGetCachedValue(thisValue);
- if (result == .zero)
+ /// `MatchedRoute.filePath` setter
+ /// This value will be visited by the garbage collector.
+ pub fn filePathSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__filePathSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.filePath` getter
+ /// This value will be visited by the garbage collector.
+ pub fn filePathGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__filePathGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__kindSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn MatchedRoutePrototype__kindGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.kind` setter
- /// This value will be visited by the garbage collector.
- pub fn kindSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__kindSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__kindSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `MatchedRoute.kind` getter
- /// This value will be visited by the garbage collector.
- pub fn kindGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__kindGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn MatchedRoutePrototype__kindGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `MatchedRoute.kind` setter
+ /// This value will be visited by the garbage collector.
+ pub fn kindSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__kindSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.kind` getter
+ /// This value will be visited by the garbage collector.
+ pub fn kindGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__kindGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__nameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn MatchedRoutePrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.name` setter
- /// This value will be visited by the garbage collector.
- pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__nameSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__nameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn MatchedRoutePrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `MatchedRoute.name` getter
- /// This value will be visited by the garbage collector.
- pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__nameGetCachedValue(thisValue);
- if (result == .zero)
+ /// `MatchedRoute.name` setter
+ /// This value will be visited by the garbage collector.
+ pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__nameSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.name` getter
+ /// This value will be visited by the garbage collector.
+ pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__nameGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__paramsSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn MatchedRoutePrototype__paramsSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn MatchedRoutePrototype__paramsGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.params` setter
- /// This value will be visited by the garbage collector.
- pub fn paramsSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__paramsSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__paramsGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `MatchedRoute.params` getter
- /// This value will be visited by the garbage collector.
- pub fn paramsGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__paramsGetCachedValue(thisValue);
- if (result == .zero)
+ /// `MatchedRoute.params` setter
+ /// This value will be visited by the garbage collector.
+ pub fn paramsSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__paramsSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.params` getter
+ /// This value will be visited by the garbage collector.
+ pub fn paramsGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__paramsGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__pathnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn MatchedRoutePrototype__pathnameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn MatchedRoutePrototype__pathnameGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.pathname` setter
- /// This value will be visited by the garbage collector.
- pub fn pathnameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__pathnameSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__pathnameGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `MatchedRoute.pathname` getter
- /// This value will be visited by the garbage collector.
- pub fn pathnameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__pathnameGetCachedValue(thisValue);
- if (result == .zero)
+ /// `MatchedRoute.pathname` setter
+ /// This value will be visited by the garbage collector.
+ pub fn pathnameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__pathnameSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.pathname` getter
+ /// This value will be visited by the garbage collector.
+ pub fn pathnameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__pathnameGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__querySetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn MatchedRoutePrototype__querySetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn MatchedRoutePrototype__queryGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.query` setter
- /// This value will be visited by the garbage collector.
- pub fn querySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__querySetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__queryGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `MatchedRoute.query` getter
- /// This value will be visited by the garbage collector.
- pub fn queryGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__queryGetCachedValue(thisValue);
- if (result == .zero)
+ /// `MatchedRoute.query` setter
+ /// This value will be visited by the garbage collector.
+ pub fn querySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__querySetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.query` getter
+ /// This value will be visited by the garbage collector.
+ pub fn queryGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__queryGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn MatchedRoutePrototype__scriptSrcSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn MatchedRoutePrototype__scriptSrcGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `MatchedRoute.scriptSrc` setter
- /// This value will be visited by the garbage collector.
- pub fn scriptSrcSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- MatchedRoutePrototype__scriptSrcSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn MatchedRoutePrototype__scriptSrcSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `MatchedRoute.scriptSrc` getter
- /// This value will be visited by the garbage collector.
- pub fn scriptSrcGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = MatchedRoutePrototype__scriptSrcGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn MatchedRoutePrototype__scriptSrcGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `MatchedRoute.scriptSrc` setter
+ /// This value will be visited by the garbage collector.
+ pub fn scriptSrcSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ MatchedRoutePrototype__scriptSrcSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `MatchedRoute.scriptSrc` getter
+ /// This value will be visited by the garbage collector.
+ pub fn scriptSrcGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = MatchedRoutePrototype__scriptSrcGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of MatchedRoute
pub fn toJS(this: *MatchedRoute, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -1563,14 +1334,14 @@ extern fn MatchedRoutePrototype__scriptSrcSetCachedValue(JSC.JSValue, *JSC.JSGlo
/// Modify the internal ptr to point to a new instance of MatchedRoute.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*MatchedRoute) bool {
- JSC.markBinding(@src());
- return MatchedRoute__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return MatchedRoute__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *MatchedRoute, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(MatchedRoute__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(MatchedRoute__dangerouslySetPtr(value, null));
}
extern fn MatchedRoute__fromJS(JSC.JSValue) ?*MatchedRoute;
@@ -1581,70 +1352,53 @@ extern fn MatchedRoutePrototype__scriptSrcSetCachedValue(JSC.JSValue, *JSC.JSGlo
extern fn MatchedRoute__dangerouslySetPtr(JSC.JSValue, ?*MatchedRoute) bool;
comptime {
-
- if (@TypeOf(MatchedRoute.finalize) != (fn(*MatchedRoute) callconv(.C) void)) {
- @compileLog("MatchedRoute.finalize is not a finalizer");
+ if (@TypeOf(MatchedRoute.finalize) != (fn (*MatchedRoute) callconv(.C) void)) {
+ @compileLog("MatchedRoute.finalize is not a finalizer");
}
-
- if (@TypeOf(MatchedRoute.getFilePath) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getFilePath to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getKind) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getKind to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getName) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getName to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getParams) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getParams to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getPathname) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getPathname to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getQuery) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getQuery to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getScriptSrc) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getScriptSrc to be a getter"
- );
-
- if (@TypeOf(MatchedRoute.getScriptSrc) != GetterType)
- @compileLog(
- "Expected MatchedRoute.getScriptSrc to be a getter"
- );
+
+ if (@TypeOf(MatchedRoute.getFilePath) != GetterType)
+ @compileLog("Expected MatchedRoute.getFilePath to be a getter");
+
+ if (@TypeOf(MatchedRoute.getKind) != GetterType)
+ @compileLog("Expected MatchedRoute.getKind to be a getter");
+
+ if (@TypeOf(MatchedRoute.getName) != GetterType)
+ @compileLog("Expected MatchedRoute.getName to be a getter");
+
+ if (@TypeOf(MatchedRoute.getParams) != GetterType)
+ @compileLog("Expected MatchedRoute.getParams to be a getter");
+
+ if (@TypeOf(MatchedRoute.getPathname) != GetterType)
+ @compileLog("Expected MatchedRoute.getPathname to be a getter");
+
+ if (@TypeOf(MatchedRoute.getQuery) != GetterType)
+ @compileLog("Expected MatchedRoute.getQuery to be a getter");
+
+ if (@TypeOf(MatchedRoute.getScriptSrc) != GetterType)
+ @compileLog("Expected MatchedRoute.getScriptSrc to be a getter");
+
+ if (@TypeOf(MatchedRoute.getScriptSrc) != GetterType)
+ @compileLog("Expected MatchedRoute.getScriptSrc to be a getter");
if (!JSC.is_bindgen) {
-@export(MatchedRoute.finalize, .{.name = "MatchedRouteClass__finalize"});
- @export(MatchedRoute.getFilePath, .{.name = "MatchedRoutePrototype__getFilePath"});
- @export(MatchedRoute.getKind, .{.name = "MatchedRoutePrototype__getKind"});
- @export(MatchedRoute.getName, .{.name = "MatchedRoutePrototype__getName"});
- @export(MatchedRoute.getParams, .{.name = "MatchedRoutePrototype__getParams"});
- @export(MatchedRoute.getPathname, .{.name = "MatchedRoutePrototype__getPathname"});
- @export(MatchedRoute.getQuery, .{.name = "MatchedRoutePrototype__getQuery"});
- @export(MatchedRoute.getScriptSrc, .{.name = "MatchedRoutePrototype__getScriptSrc"});
+ @export(MatchedRoute.finalize, .{ .name = "MatchedRouteClass__finalize" });
+ @export(MatchedRoute.getFilePath, .{ .name = "MatchedRoutePrototype__getFilePath" });
+ @export(MatchedRoute.getKind, .{ .name = "MatchedRoutePrototype__getKind" });
+ @export(MatchedRoute.getName, .{ .name = "MatchedRoutePrototype__getName" });
+ @export(MatchedRoute.getParams, .{ .name = "MatchedRoutePrototype__getParams" });
+ @export(MatchedRoute.getPathname, .{ .name = "MatchedRoutePrototype__getPathname" });
+ @export(MatchedRoute.getQuery, .{ .name = "MatchedRoutePrototype__getQuery" });
+ @export(MatchedRoute.getScriptSrc, .{ .name = "MatchedRoutePrototype__getScriptSrc" });
}
}
};
pub const JSNodeJSFS = struct {
const NodeJSFS = Classes.NodeJSFS;
- const GetterType = fn(*NodeJSFS, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*NodeJSFS, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*NodeJSFS, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*NodeJSFS, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*NodeJSFS, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*NodeJSFS, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -1653,16 +1407,13 @@ pub const JSNodeJSFS = struct {
return NodeJSFS__fromJS(value);
}
-
-
-
/// Get the NodeJSFS constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return NodeJSFS__getConstructor(globalObject);
}
-
+
/// Create a new instance of NodeJSFS
pub fn toJS(this: *NodeJSFS, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -1677,14 +1428,14 @@ pub const JSNodeJSFS = struct {
/// Modify the internal ptr to point to a new instance of NodeJSFS.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*NodeJSFS) bool {
- JSC.markBinding(@src());
- return NodeJSFS__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return NodeJSFS__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *NodeJSFS, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(NodeJSFS__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(NodeJSFS__dangerouslySetPtr(value, null));
}
extern fn NodeJSFS__fromJS(JSC.JSValue) ?*NodeJSFS;
@@ -1695,435 +1446,270 @@ pub const JSNodeJSFS = struct {
extern fn NodeJSFS__dangerouslySetPtr(JSC.JSValue, ?*NodeJSFS) bool;
comptime {
-
- if (@TypeOf(NodeJSFS.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*NodeJSFS)) {
- @compileLog("NodeJSFS.constructor is not a constructor");
- }
-
- if (@TypeOf(NodeJSFS.access) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.access to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.access))
- );
- if (@TypeOf(NodeJSFS.accessSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.accessSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.accessSync))
- );
- if (@TypeOf(NodeJSFS.appendFile) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.appendFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFile))
- );
- if (@TypeOf(NodeJSFS.appendFileSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.appendFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFileSync))
- );
- if (@TypeOf(NodeJSFS.chmod) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.chmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmod))
- );
- if (@TypeOf(NodeJSFS.chmodSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.chmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmodSync))
- );
- if (@TypeOf(NodeJSFS.chown) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.chown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chown))
- );
- if (@TypeOf(NodeJSFS.chownSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.chownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chownSync))
- );
- if (@TypeOf(NodeJSFS.close) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.close to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.close))
- );
- if (@TypeOf(NodeJSFS.closeSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.closeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.closeSync))
- );
- if (@TypeOf(NodeJSFS.copyFile) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.copyFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFile))
- );
- if (@TypeOf(NodeJSFS.copyFileSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.copyFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFileSync))
- );
- if (@TypeOf(NodeJSFS.getDirent) != GetterType)
- @compileLog(
- "Expected NodeJSFS.getDirent to be a getter"
- );
-
- if (@TypeOf(NodeJSFS.exists) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.exists to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.exists))
- );
- if (@TypeOf(NodeJSFS.existsSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.existsSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.existsSync))
- );
- if (@TypeOf(NodeJSFS.fchmod) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmod))
- );
- if (@TypeOf(NodeJSFS.fchmodSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmodSync))
- );
- if (@TypeOf(NodeJSFS.fchown) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchown))
- );
- if (@TypeOf(NodeJSFS.fchownSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchownSync))
- );
- if (@TypeOf(NodeJSFS.fdatasync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fdatasync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasync))
- );
- if (@TypeOf(NodeJSFS.fdatasyncSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fdatasyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasyncSync))
- );
- if (@TypeOf(NodeJSFS.fstat) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstat))
- );
- if (@TypeOf(NodeJSFS.fstatSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstatSync))
- );
- if (@TypeOf(NodeJSFS.fsync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fsync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsync))
- );
- if (@TypeOf(NodeJSFS.fsyncSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.fsyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsyncSync))
- );
- if (@TypeOf(NodeJSFS.ftruncate) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.ftruncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncate))
- );
- if (@TypeOf(NodeJSFS.ftruncateSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.ftruncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncateSync))
- );
- if (@TypeOf(NodeJSFS.futimes) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.futimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimes))
- );
- if (@TypeOf(NodeJSFS.futimesSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.futimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimesSync))
- );
- if (@TypeOf(NodeJSFS.lchmod) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmod))
- );
- if (@TypeOf(NodeJSFS.lchmodSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmodSync))
- );
- if (@TypeOf(NodeJSFS.lchown) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchown))
- );
- if (@TypeOf(NodeJSFS.lchownSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchownSync))
- );
- if (@TypeOf(NodeJSFS.link) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.link to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.link))
- );
- if (@TypeOf(NodeJSFS.linkSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.linkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.linkSync))
- );
- if (@TypeOf(NodeJSFS.lstat) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstat))
- );
- if (@TypeOf(NodeJSFS.lstatSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstatSync))
- );
- if (@TypeOf(NodeJSFS.lutimes) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lutimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimes))
- );
- if (@TypeOf(NodeJSFS.lutimesSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.lutimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimesSync))
- );
- if (@TypeOf(NodeJSFS.mkdir) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.mkdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdir))
- );
- if (@TypeOf(NodeJSFS.mkdirSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.mkdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdirSync))
- );
- if (@TypeOf(NodeJSFS.mkdtemp) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.mkdtemp to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtemp))
- );
- if (@TypeOf(NodeJSFS.mkdtempSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.mkdtempSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtempSync))
- );
- if (@TypeOf(NodeJSFS.open) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.open to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.open))
- );
- if (@TypeOf(NodeJSFS.opendir) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.opendir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendir))
- );
- if (@TypeOf(NodeJSFS.opendirSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.opendirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendirSync))
- );
- if (@TypeOf(NodeJSFS.openSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.openSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.openSync))
- );
- if (@TypeOf(NodeJSFS.read) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.read to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.read))
- );
- if (@TypeOf(NodeJSFS.readdir) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdir))
- );
- if (@TypeOf(NodeJSFS.readdirSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdirSync))
- );
- if (@TypeOf(NodeJSFS.readFile) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFile))
- );
- if (@TypeOf(NodeJSFS.readFileSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFileSync))
- );
- if (@TypeOf(NodeJSFS.readlink) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlink))
- );
- if (@TypeOf(NodeJSFS.readlinkSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlinkSync))
- );
- if (@TypeOf(NodeJSFS.readSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readSync))
- );
- if (@TypeOf(NodeJSFS.readv) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readv to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readv))
- );
- if (@TypeOf(NodeJSFS.readvSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.readvSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readvSync))
- );
- if (@TypeOf(NodeJSFS.realpath) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.realpath to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpath))
- );
- if (@TypeOf(NodeJSFS.realpathSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.realpathSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpathSync))
- );
- if (@TypeOf(NodeJSFS.rename) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.rename to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rename))
- );
- if (@TypeOf(NodeJSFS.renameSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.renameSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.renameSync))
- );
- if (@TypeOf(NodeJSFS.rm) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.rm to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rm))
- );
- if (@TypeOf(NodeJSFS.rmdir) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.rmdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdir))
- );
- if (@TypeOf(NodeJSFS.rmdirSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.rmdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdirSync))
- );
- if (@TypeOf(NodeJSFS.rmSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.rmSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmSync))
- );
- if (@TypeOf(NodeJSFS.stat) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.stat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.stat))
- );
- if (@TypeOf(NodeJSFS.getStats) != GetterType)
- @compileLog(
- "Expected NodeJSFS.getStats to be a getter"
- );
-
- if (@TypeOf(NodeJSFS.statSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.statSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.statSync))
- );
- if (@TypeOf(NodeJSFS.symlink) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.symlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlink))
- );
- if (@TypeOf(NodeJSFS.symlinkSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.symlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlinkSync))
- );
- if (@TypeOf(NodeJSFS.truncate) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.truncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncate))
- );
- if (@TypeOf(NodeJSFS.truncateSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.truncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncateSync))
- );
- if (@TypeOf(NodeJSFS.unlink) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.unlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlink))
- );
- if (@TypeOf(NodeJSFS.unlinkSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.unlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlinkSync))
- );
- if (@TypeOf(NodeJSFS.utimes) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.utimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimes))
- );
- if (@TypeOf(NodeJSFS.utimesSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.utimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimesSync))
- );
- if (@TypeOf(NodeJSFS.write) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.write to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.write))
- );
- if (@TypeOf(NodeJSFS.writeFile) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.writeFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFile))
- );
- if (@TypeOf(NodeJSFS.writeFileSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.writeFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFileSync))
- );
- if (@TypeOf(NodeJSFS.writeSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.writeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeSync))
- );
- if (@TypeOf(NodeJSFS.writev) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.writev to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writev))
- );
- if (@TypeOf(NodeJSFS.writevSync) != CallbackType)
- @compileLog(
- "Expected NodeJSFS.writevSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writevSync))
- );
+ if (@TypeOf(NodeJSFS.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*NodeJSFS)) {
+ @compileLog("NodeJSFS.constructor is not a constructor");
+ }
+
+ if (@TypeOf(NodeJSFS.access) != CallbackType)
+ @compileLog("Expected NodeJSFS.access to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.access)));
+ if (@TypeOf(NodeJSFS.accessSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.accessSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.accessSync)));
+ if (@TypeOf(NodeJSFS.appendFile) != CallbackType)
+ @compileLog("Expected NodeJSFS.appendFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFile)));
+ if (@TypeOf(NodeJSFS.appendFileSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.appendFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFileSync)));
+ if (@TypeOf(NodeJSFS.chmod) != CallbackType)
+ @compileLog("Expected NodeJSFS.chmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmod)));
+ if (@TypeOf(NodeJSFS.chmodSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.chmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmodSync)));
+ if (@TypeOf(NodeJSFS.chown) != CallbackType)
+ @compileLog("Expected NodeJSFS.chown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chown)));
+ if (@TypeOf(NodeJSFS.chownSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.chownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chownSync)));
+ if (@TypeOf(NodeJSFS.close) != CallbackType)
+ @compileLog("Expected NodeJSFS.close to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.close)));
+ if (@TypeOf(NodeJSFS.closeSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.closeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.closeSync)));
+ if (@TypeOf(NodeJSFS.copyFile) != CallbackType)
+ @compileLog("Expected NodeJSFS.copyFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFile)));
+ if (@TypeOf(NodeJSFS.copyFileSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.copyFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFileSync)));
+ if (@TypeOf(NodeJSFS.getDirent) != GetterType)
+ @compileLog("Expected NodeJSFS.getDirent to be a getter");
+
+ if (@TypeOf(NodeJSFS.exists) != CallbackType)
+ @compileLog("Expected NodeJSFS.exists to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.exists)));
+ if (@TypeOf(NodeJSFS.existsSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.existsSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.existsSync)));
+ if (@TypeOf(NodeJSFS.fchmod) != CallbackType)
+ @compileLog("Expected NodeJSFS.fchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmod)));
+ if (@TypeOf(NodeJSFS.fchmodSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmodSync)));
+ if (@TypeOf(NodeJSFS.fchown) != CallbackType)
+ @compileLog("Expected NodeJSFS.fchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchown)));
+ if (@TypeOf(NodeJSFS.fchownSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchownSync)));
+ if (@TypeOf(NodeJSFS.fdatasync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fdatasync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasync)));
+ if (@TypeOf(NodeJSFS.fdatasyncSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fdatasyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasyncSync)));
+ if (@TypeOf(NodeJSFS.fstat) != CallbackType)
+ @compileLog("Expected NodeJSFS.fstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstat)));
+ if (@TypeOf(NodeJSFS.fstatSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstatSync)));
+ if (@TypeOf(NodeJSFS.fsync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fsync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsync)));
+ if (@TypeOf(NodeJSFS.fsyncSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.fsyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsyncSync)));
+ if (@TypeOf(NodeJSFS.ftruncate) != CallbackType)
+ @compileLog("Expected NodeJSFS.ftruncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncate)));
+ if (@TypeOf(NodeJSFS.ftruncateSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.ftruncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncateSync)));
+ if (@TypeOf(NodeJSFS.futimes) != CallbackType)
+ @compileLog("Expected NodeJSFS.futimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimes)));
+ if (@TypeOf(NodeJSFS.futimesSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.futimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimesSync)));
+ if (@TypeOf(NodeJSFS.lchmod) != CallbackType)
+ @compileLog("Expected NodeJSFS.lchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmod)));
+ if (@TypeOf(NodeJSFS.lchmodSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.lchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmodSync)));
+ if (@TypeOf(NodeJSFS.lchown) != CallbackType)
+ @compileLog("Expected NodeJSFS.lchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchown)));
+ if (@TypeOf(NodeJSFS.lchownSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.lchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchownSync)));
+ if (@TypeOf(NodeJSFS.link) != CallbackType)
+ @compileLog("Expected NodeJSFS.link to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.link)));
+ if (@TypeOf(NodeJSFS.linkSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.linkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.linkSync)));
+ if (@TypeOf(NodeJSFS.lstat) != CallbackType)
+ @compileLog("Expected NodeJSFS.lstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstat)));
+ if (@TypeOf(NodeJSFS.lstatSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.lstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstatSync)));
+ if (@TypeOf(NodeJSFS.lutimes) != CallbackType)
+ @compileLog("Expected NodeJSFS.lutimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimes)));
+ if (@TypeOf(NodeJSFS.lutimesSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.lutimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimesSync)));
+ if (@TypeOf(NodeJSFS.mkdir) != CallbackType)
+ @compileLog("Expected NodeJSFS.mkdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdir)));
+ if (@TypeOf(NodeJSFS.mkdirSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.mkdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdirSync)));
+ if (@TypeOf(NodeJSFS.mkdtemp) != CallbackType)
+ @compileLog("Expected NodeJSFS.mkdtemp to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtemp)));
+ if (@TypeOf(NodeJSFS.mkdtempSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.mkdtempSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtempSync)));
+ if (@TypeOf(NodeJSFS.open) != CallbackType)
+ @compileLog("Expected NodeJSFS.open to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.open)));
+ if (@TypeOf(NodeJSFS.opendir) != CallbackType)
+ @compileLog("Expected NodeJSFS.opendir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendir)));
+ if (@TypeOf(NodeJSFS.opendirSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.opendirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendirSync)));
+ if (@TypeOf(NodeJSFS.openSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.openSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.openSync)));
+ if (@TypeOf(NodeJSFS.read) != CallbackType)
+ @compileLog("Expected NodeJSFS.read to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.read)));
+ if (@TypeOf(NodeJSFS.readdir) != CallbackType)
+ @compileLog("Expected NodeJSFS.readdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdir)));
+ if (@TypeOf(NodeJSFS.readdirSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.readdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdirSync)));
+ if (@TypeOf(NodeJSFS.readFile) != CallbackType)
+ @compileLog("Expected NodeJSFS.readFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFile)));
+ if (@TypeOf(NodeJSFS.readFileSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.readFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFileSync)));
+ if (@TypeOf(NodeJSFS.readlink) != CallbackType)
+ @compileLog("Expected NodeJSFS.readlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlink)));
+ if (@TypeOf(NodeJSFS.readlinkSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.readlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlinkSync)));
+ if (@TypeOf(NodeJSFS.readSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.readSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readSync)));
+ if (@TypeOf(NodeJSFS.readv) != CallbackType)
+ @compileLog("Expected NodeJSFS.readv to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readv)));
+ if (@TypeOf(NodeJSFS.readvSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.readvSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readvSync)));
+ if (@TypeOf(NodeJSFS.realpath) != CallbackType)
+ @compileLog("Expected NodeJSFS.realpath to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpath)));
+ if (@TypeOf(NodeJSFS.realpathSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.realpathSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpathSync)));
+ if (@TypeOf(NodeJSFS.rename) != CallbackType)
+ @compileLog("Expected NodeJSFS.rename to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rename)));
+ if (@TypeOf(NodeJSFS.renameSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.renameSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.renameSync)));
+ if (@TypeOf(NodeJSFS.rm) != CallbackType)
+ @compileLog("Expected NodeJSFS.rm to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rm)));
+ if (@TypeOf(NodeJSFS.rmdir) != CallbackType)
+ @compileLog("Expected NodeJSFS.rmdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdir)));
+ if (@TypeOf(NodeJSFS.rmdirSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.rmdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdirSync)));
+ if (@TypeOf(NodeJSFS.rmSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.rmSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmSync)));
+ if (@TypeOf(NodeJSFS.stat) != CallbackType)
+ @compileLog("Expected NodeJSFS.stat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.stat)));
+ if (@TypeOf(NodeJSFS.getStats) != GetterType)
+ @compileLog("Expected NodeJSFS.getStats to be a getter");
+
+ if (@TypeOf(NodeJSFS.statSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.statSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.statSync)));
+ if (@TypeOf(NodeJSFS.symlink) != CallbackType)
+ @compileLog("Expected NodeJSFS.symlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlink)));
+ if (@TypeOf(NodeJSFS.symlinkSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.symlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlinkSync)));
+ if (@TypeOf(NodeJSFS.truncate) != CallbackType)
+ @compileLog("Expected NodeJSFS.truncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncate)));
+ if (@TypeOf(NodeJSFS.truncateSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.truncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncateSync)));
+ if (@TypeOf(NodeJSFS.unlink) != CallbackType)
+ @compileLog("Expected NodeJSFS.unlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlink)));
+ if (@TypeOf(NodeJSFS.unlinkSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.unlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlinkSync)));
+ if (@TypeOf(NodeJSFS.utimes) != CallbackType)
+ @compileLog("Expected NodeJSFS.utimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimes)));
+ if (@TypeOf(NodeJSFS.utimesSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.utimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimesSync)));
+ if (@TypeOf(NodeJSFS.write) != CallbackType)
+ @compileLog("Expected NodeJSFS.write to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.write)));
+ if (@TypeOf(NodeJSFS.writeFile) != CallbackType)
+ @compileLog("Expected NodeJSFS.writeFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFile)));
+ if (@TypeOf(NodeJSFS.writeFileSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.writeFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFileSync)));
+ if (@TypeOf(NodeJSFS.writeSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.writeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeSync)));
+ if (@TypeOf(NodeJSFS.writev) != CallbackType)
+ @compileLog("Expected NodeJSFS.writev to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writev)));
+ if (@TypeOf(NodeJSFS.writevSync) != CallbackType)
+ @compileLog("Expected NodeJSFS.writevSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writevSync)));
if (!JSC.is_bindgen) {
-@export(NodeJSFS.access, .{.name = "NodeJSFSPrototype__access"});
- @export(NodeJSFS.accessSync, .{.name = "NodeJSFSPrototype__accessSync"});
- @export(NodeJSFS.appendFile, .{.name = "NodeJSFSPrototype__appendFile"});
- @export(NodeJSFS.appendFileSync, .{.name = "NodeJSFSPrototype__appendFileSync"});
- @export(NodeJSFS.chmod, .{.name = "NodeJSFSPrototype__chmod"});
- @export(NodeJSFS.chmodSync, .{.name = "NodeJSFSPrototype__chmodSync"});
- @export(NodeJSFS.chown, .{.name = "NodeJSFSPrototype__chown"});
- @export(NodeJSFS.chownSync, .{.name = "NodeJSFSPrototype__chownSync"});
- @export(NodeJSFS.close, .{.name = "NodeJSFSPrototype__close"});
- @export(NodeJSFS.closeSync, .{.name = "NodeJSFSPrototype__closeSync"});
- @export(NodeJSFS.constructor, .{.name = "NodeJSFSClass__construct"});
- @export(NodeJSFS.copyFile, .{.name = "NodeJSFSPrototype__copyFile"});
- @export(NodeJSFS.copyFileSync, .{.name = "NodeJSFSPrototype__copyFileSync"});
- @export(NodeJSFS.exists, .{.name = "NodeJSFSPrototype__exists"});
- @export(NodeJSFS.existsSync, .{.name = "NodeJSFSPrototype__existsSync"});
- @export(NodeJSFS.fchmod, .{.name = "NodeJSFSPrototype__fchmod"});
- @export(NodeJSFS.fchmodSync, .{.name = "NodeJSFSPrototype__fchmodSync"});
- @export(NodeJSFS.fchown, .{.name = "NodeJSFSPrototype__fchown"});
- @export(NodeJSFS.fchownSync, .{.name = "NodeJSFSPrototype__fchownSync"});
- @export(NodeJSFS.fdatasync, .{.name = "NodeJSFSPrototype__fdatasync"});
- @export(NodeJSFS.fdatasyncSync, .{.name = "NodeJSFSPrototype__fdatasyncSync"});
- @export(NodeJSFS.fstat, .{.name = "NodeJSFSPrototype__fstat"});
- @export(NodeJSFS.fstatSync, .{.name = "NodeJSFSPrototype__fstatSync"});
- @export(NodeJSFS.fsync, .{.name = "NodeJSFSPrototype__fsync"});
- @export(NodeJSFS.fsyncSync, .{.name = "NodeJSFSPrototype__fsyncSync"});
- @export(NodeJSFS.ftruncate, .{.name = "NodeJSFSPrototype__ftruncate"});
- @export(NodeJSFS.ftruncateSync, .{.name = "NodeJSFSPrototype__ftruncateSync"});
- @export(NodeJSFS.futimes, .{.name = "NodeJSFSPrototype__futimes"});
- @export(NodeJSFS.futimesSync, .{.name = "NodeJSFSPrototype__futimesSync"});
- @export(NodeJSFS.getDirent, .{.name = "NodeJSFSPrototype__getDirent"});
- @export(NodeJSFS.getStats, .{.name = "NodeJSFSPrototype__getStats"});
- @export(NodeJSFS.lchmod, .{.name = "NodeJSFSPrototype__lchmod"});
- @export(NodeJSFS.lchmodSync, .{.name = "NodeJSFSPrototype__lchmodSync"});
- @export(NodeJSFS.lchown, .{.name = "NodeJSFSPrototype__lchown"});
- @export(NodeJSFS.lchownSync, .{.name = "NodeJSFSPrototype__lchownSync"});
- @export(NodeJSFS.link, .{.name = "NodeJSFSPrototype__link"});
- @export(NodeJSFS.linkSync, .{.name = "NodeJSFSPrototype__linkSync"});
- @export(NodeJSFS.lstat, .{.name = "NodeJSFSPrototype__lstat"});
- @export(NodeJSFS.lstatSync, .{.name = "NodeJSFSPrototype__lstatSync"});
- @export(NodeJSFS.lutimes, .{.name = "NodeJSFSPrototype__lutimes"});
- @export(NodeJSFS.lutimesSync, .{.name = "NodeJSFSPrototype__lutimesSync"});
- @export(NodeJSFS.mkdir, .{.name = "NodeJSFSPrototype__mkdir"});
- @export(NodeJSFS.mkdirSync, .{.name = "NodeJSFSPrototype__mkdirSync"});
- @export(NodeJSFS.mkdtemp, .{.name = "NodeJSFSPrototype__mkdtemp"});
- @export(NodeJSFS.mkdtempSync, .{.name = "NodeJSFSPrototype__mkdtempSync"});
- @export(NodeJSFS.open, .{.name = "NodeJSFSPrototype__open"});
- @export(NodeJSFS.opendir, .{.name = "NodeJSFSPrototype__opendir"});
- @export(NodeJSFS.opendirSync, .{.name = "NodeJSFSPrototype__opendirSync"});
- @export(NodeJSFS.openSync, .{.name = "NodeJSFSPrototype__openSync"});
- @export(NodeJSFS.read, .{.name = "NodeJSFSPrototype__read"});
- @export(NodeJSFS.readdir, .{.name = "NodeJSFSPrototype__readdir"});
- @export(NodeJSFS.readdirSync, .{.name = "NodeJSFSPrototype__readdirSync"});
- @export(NodeJSFS.readFile, .{.name = "NodeJSFSPrototype__readFile"});
- @export(NodeJSFS.readFileSync, .{.name = "NodeJSFSPrototype__readFileSync"});
- @export(NodeJSFS.readlink, .{.name = "NodeJSFSPrototype__readlink"});
- @export(NodeJSFS.readlinkSync, .{.name = "NodeJSFSPrototype__readlinkSync"});
- @export(NodeJSFS.readSync, .{.name = "NodeJSFSPrototype__readSync"});
- @export(NodeJSFS.readv, .{.name = "NodeJSFSPrototype__readv"});
- @export(NodeJSFS.readvSync, .{.name = "NodeJSFSPrototype__readvSync"});
- @export(NodeJSFS.realpath, .{.name = "NodeJSFSPrototype__realpath"});
- @export(NodeJSFS.realpathSync, .{.name = "NodeJSFSPrototype__realpathSync"});
- @export(NodeJSFS.rename, .{.name = "NodeJSFSPrototype__rename"});
- @export(NodeJSFS.renameSync, .{.name = "NodeJSFSPrototype__renameSync"});
- @export(NodeJSFS.rm, .{.name = "NodeJSFSPrototype__rm"});
- @export(NodeJSFS.rmdir, .{.name = "NodeJSFSPrototype__rmdir"});
- @export(NodeJSFS.rmdirSync, .{.name = "NodeJSFSPrototype__rmdirSync"});
- @export(NodeJSFS.rmSync, .{.name = "NodeJSFSPrototype__rmSync"});
- @export(NodeJSFS.stat, .{.name = "NodeJSFSPrototype__stat"});
- @export(NodeJSFS.statSync, .{.name = "NodeJSFSPrototype__statSync"});
- @export(NodeJSFS.symlink, .{.name = "NodeJSFSPrototype__symlink"});
- @export(NodeJSFS.symlinkSync, .{.name = "NodeJSFSPrototype__symlinkSync"});
- @export(NodeJSFS.truncate, .{.name = "NodeJSFSPrototype__truncate"});
- @export(NodeJSFS.truncateSync, .{.name = "NodeJSFSPrototype__truncateSync"});
- @export(NodeJSFS.unlink, .{.name = "NodeJSFSPrototype__unlink"});
- @export(NodeJSFS.unlinkSync, .{.name = "NodeJSFSPrototype__unlinkSync"});
- @export(NodeJSFS.utimes, .{.name = "NodeJSFSPrototype__utimes"});
- @export(NodeJSFS.utimesSync, .{.name = "NodeJSFSPrototype__utimesSync"});
- @export(NodeJSFS.write, .{.name = "NodeJSFSPrototype__write"});
- @export(NodeJSFS.writeFile, .{.name = "NodeJSFSPrototype__writeFile"});
- @export(NodeJSFS.writeFileSync, .{.name = "NodeJSFSPrototype__writeFileSync"});
- @export(NodeJSFS.writeSync, .{.name = "NodeJSFSPrototype__writeSync"});
- @export(NodeJSFS.writev, .{.name = "NodeJSFSPrototype__writev"});
- @export(NodeJSFS.writevSync, .{.name = "NodeJSFSPrototype__writevSync"});
+ @export(NodeJSFS.access, .{ .name = "NodeJSFSPrototype__access" });
+ @export(NodeJSFS.accessSync, .{ .name = "NodeJSFSPrototype__accessSync" });
+ @export(NodeJSFS.appendFile, .{ .name = "NodeJSFSPrototype__appendFile" });
+ @export(NodeJSFS.appendFileSync, .{ .name = "NodeJSFSPrototype__appendFileSync" });
+ @export(NodeJSFS.chmod, .{ .name = "NodeJSFSPrototype__chmod" });
+ @export(NodeJSFS.chmodSync, .{ .name = "NodeJSFSPrototype__chmodSync" });
+ @export(NodeJSFS.chown, .{ .name = "NodeJSFSPrototype__chown" });
+ @export(NodeJSFS.chownSync, .{ .name = "NodeJSFSPrototype__chownSync" });
+ @export(NodeJSFS.close, .{ .name = "NodeJSFSPrototype__close" });
+ @export(NodeJSFS.closeSync, .{ .name = "NodeJSFSPrototype__closeSync" });
+ @export(NodeJSFS.constructor, .{ .name = "NodeJSFSClass__construct" });
+ @export(NodeJSFS.copyFile, .{ .name = "NodeJSFSPrototype__copyFile" });
+ @export(NodeJSFS.copyFileSync, .{ .name = "NodeJSFSPrototype__copyFileSync" });
+ @export(NodeJSFS.exists, .{ .name = "NodeJSFSPrototype__exists" });
+ @export(NodeJSFS.existsSync, .{ .name = "NodeJSFSPrototype__existsSync" });
+ @export(NodeJSFS.fchmod, .{ .name = "NodeJSFSPrototype__fchmod" });
+ @export(NodeJSFS.fchmodSync, .{ .name = "NodeJSFSPrototype__fchmodSync" });
+ @export(NodeJSFS.fchown, .{ .name = "NodeJSFSPrototype__fchown" });
+ @export(NodeJSFS.fchownSync, .{ .name = "NodeJSFSPrototype__fchownSync" });
+ @export(NodeJSFS.fdatasync, .{ .name = "NodeJSFSPrototype__fdatasync" });
+ @export(NodeJSFS.fdatasyncSync, .{ .name = "NodeJSFSPrototype__fdatasyncSync" });
+ @export(NodeJSFS.fstat, .{ .name = "NodeJSFSPrototype__fstat" });
+ @export(NodeJSFS.fstatSync, .{ .name = "NodeJSFSPrototype__fstatSync" });
+ @export(NodeJSFS.fsync, .{ .name = "NodeJSFSPrototype__fsync" });
+ @export(NodeJSFS.fsyncSync, .{ .name = "NodeJSFSPrototype__fsyncSync" });
+ @export(NodeJSFS.ftruncate, .{ .name = "NodeJSFSPrototype__ftruncate" });
+ @export(NodeJSFS.ftruncateSync, .{ .name = "NodeJSFSPrototype__ftruncateSync" });
+ @export(NodeJSFS.futimes, .{ .name = "NodeJSFSPrototype__futimes" });
+ @export(NodeJSFS.futimesSync, .{ .name = "NodeJSFSPrototype__futimesSync" });
+ @export(NodeJSFS.getDirent, .{ .name = "NodeJSFSPrototype__getDirent" });
+ @export(NodeJSFS.getStats, .{ .name = "NodeJSFSPrototype__getStats" });
+ @export(NodeJSFS.lchmod, .{ .name = "NodeJSFSPrototype__lchmod" });
+ @export(NodeJSFS.lchmodSync, .{ .name = "NodeJSFSPrototype__lchmodSync" });
+ @export(NodeJSFS.lchown, .{ .name = "NodeJSFSPrototype__lchown" });
+ @export(NodeJSFS.lchownSync, .{ .name = "NodeJSFSPrototype__lchownSync" });
+ @export(NodeJSFS.link, .{ .name = "NodeJSFSPrototype__link" });
+ @export(NodeJSFS.linkSync, .{ .name = "NodeJSFSPrototype__linkSync" });
+ @export(NodeJSFS.lstat, .{ .name = "NodeJSFSPrototype__lstat" });
+ @export(NodeJSFS.lstatSync, .{ .name = "NodeJSFSPrototype__lstatSync" });
+ @export(NodeJSFS.lutimes, .{ .name = "NodeJSFSPrototype__lutimes" });
+ @export(NodeJSFS.lutimesSync, .{ .name = "NodeJSFSPrototype__lutimesSync" });
+ @export(NodeJSFS.mkdir, .{ .name = "NodeJSFSPrototype__mkdir" });
+ @export(NodeJSFS.mkdirSync, .{ .name = "NodeJSFSPrototype__mkdirSync" });
+ @export(NodeJSFS.mkdtemp, .{ .name = "NodeJSFSPrototype__mkdtemp" });
+ @export(NodeJSFS.mkdtempSync, .{ .name = "NodeJSFSPrototype__mkdtempSync" });
+ @export(NodeJSFS.open, .{ .name = "NodeJSFSPrototype__open" });
+ @export(NodeJSFS.opendir, .{ .name = "NodeJSFSPrototype__opendir" });
+ @export(NodeJSFS.opendirSync, .{ .name = "NodeJSFSPrototype__opendirSync" });
+ @export(NodeJSFS.openSync, .{ .name = "NodeJSFSPrototype__openSync" });
+ @export(NodeJSFS.read, .{ .name = "NodeJSFSPrototype__read" });
+ @export(NodeJSFS.readdir, .{ .name = "NodeJSFSPrototype__readdir" });
+ @export(NodeJSFS.readdirSync, .{ .name = "NodeJSFSPrototype__readdirSync" });
+ @export(NodeJSFS.readFile, .{ .name = "NodeJSFSPrototype__readFile" });
+ @export(NodeJSFS.readFileSync, .{ .name = "NodeJSFSPrototype__readFileSync" });
+ @export(NodeJSFS.readlink, .{ .name = "NodeJSFSPrototype__readlink" });
+ @export(NodeJSFS.readlinkSync, .{ .name = "NodeJSFSPrototype__readlinkSync" });
+ @export(NodeJSFS.readSync, .{ .name = "NodeJSFSPrototype__readSync" });
+ @export(NodeJSFS.readv, .{ .name = "NodeJSFSPrototype__readv" });
+ @export(NodeJSFS.readvSync, .{ .name = "NodeJSFSPrototype__readvSync" });
+ @export(NodeJSFS.realpath, .{ .name = "NodeJSFSPrototype__realpath" });
+ @export(NodeJSFS.realpathSync, .{ .name = "NodeJSFSPrototype__realpathSync" });
+ @export(NodeJSFS.rename, .{ .name = "NodeJSFSPrototype__rename" });
+ @export(NodeJSFS.renameSync, .{ .name = "NodeJSFSPrototype__renameSync" });
+ @export(NodeJSFS.rm, .{ .name = "NodeJSFSPrototype__rm" });
+ @export(NodeJSFS.rmdir, .{ .name = "NodeJSFSPrototype__rmdir" });
+ @export(NodeJSFS.rmdirSync, .{ .name = "NodeJSFSPrototype__rmdirSync" });
+ @export(NodeJSFS.rmSync, .{ .name = "NodeJSFSPrototype__rmSync" });
+ @export(NodeJSFS.stat, .{ .name = "NodeJSFSPrototype__stat" });
+ @export(NodeJSFS.statSync, .{ .name = "NodeJSFSPrototype__statSync" });
+ @export(NodeJSFS.symlink, .{ .name = "NodeJSFSPrototype__symlink" });
+ @export(NodeJSFS.symlinkSync, .{ .name = "NodeJSFSPrototype__symlinkSync" });
+ @export(NodeJSFS.truncate, .{ .name = "NodeJSFSPrototype__truncate" });
+ @export(NodeJSFS.truncateSync, .{ .name = "NodeJSFSPrototype__truncateSync" });
+ @export(NodeJSFS.unlink, .{ .name = "NodeJSFSPrototype__unlink" });
+ @export(NodeJSFS.unlinkSync, .{ .name = "NodeJSFSPrototype__unlinkSync" });
+ @export(NodeJSFS.utimes, .{ .name = "NodeJSFSPrototype__utimes" });
+ @export(NodeJSFS.utimesSync, .{ .name = "NodeJSFSPrototype__utimesSync" });
+ @export(NodeJSFS.write, .{ .name = "NodeJSFSPrototype__write" });
+ @export(NodeJSFS.writeFile, .{ .name = "NodeJSFSPrototype__writeFile" });
+ @export(NodeJSFS.writeFileSync, .{ .name = "NodeJSFSPrototype__writeFileSync" });
+ @export(NodeJSFS.writeSync, .{ .name = "NodeJSFSPrototype__writeSync" });
+ @export(NodeJSFS.writev, .{ .name = "NodeJSFSPrototype__writev" });
+ @export(NodeJSFS.writevSync, .{ .name = "NodeJSFSPrototype__writevSync" });
}
}
};
pub const JSRequest = struct {
const Request = Classes.Request;
- const GetterType = fn(*Request, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Request, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Request, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Request, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Request, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Request, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Request, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Request, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Request, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Request, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2134,101 +1720,99 @@ pub const JSRequest = struct {
extern fn RequestPrototype__bodySetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn RequestPrototype__bodyGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Request.body` setter
- /// This value will be visited by the garbage collector.
- pub fn bodySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- RequestPrototype__bodySetCachedValue(thisValue, globalObject, value);
- }
+ extern fn RequestPrototype__bodyGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Request.body` getter
- /// This value will be visited by the garbage collector.
- pub fn bodyGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = RequestPrototype__bodyGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Request.body` setter
+ /// This value will be visited by the garbage collector.
+ pub fn bodySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ RequestPrototype__bodySetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Request.body` getter
+ /// This value will be visited by the garbage collector.
+ pub fn bodyGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = RequestPrototype__bodyGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn RequestPrototype__headersSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn RequestPrototype__headersGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Request.headers` setter
- /// This value will be visited by the garbage collector.
- pub fn headersSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- RequestPrototype__headersSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn RequestPrototype__headersSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn RequestPrototype__headersGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Request.headers` getter
- /// This value will be visited by the garbage collector.
- pub fn headersGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = RequestPrototype__headersGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Request.headers` setter
+ /// This value will be visited by the garbage collector.
+ pub fn headersSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ RequestPrototype__headersSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Request.headers` getter
+ /// This value will be visited by the garbage collector.
+ pub fn headersGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = RequestPrototype__headersGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn RequestPrototype__signalSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn RequestPrototype__signalSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn RequestPrototype__signalGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Request.signal` setter
- /// This value will be visited by the garbage collector.
- pub fn signalSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- RequestPrototype__signalSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn RequestPrototype__signalGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Request.signal` getter
- /// This value will be visited by the garbage collector.
- pub fn signalGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = RequestPrototype__signalGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Request.signal` setter
+ /// This value will be visited by the garbage collector.
+ pub fn signalSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ RequestPrototype__signalSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Request.signal` getter
+ /// This value will be visited by the garbage collector.
+ pub fn signalGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = RequestPrototype__signalGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn RequestPrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn RequestPrototype__urlGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Request.url` setter
- /// This value will be visited by the garbage collector.
- pub fn urlSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- RequestPrototype__urlSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn RequestPrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `Request.url` getter
- /// This value will be visited by the garbage collector.
- pub fn urlGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = RequestPrototype__urlGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn RequestPrototype__urlGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Request.url` setter
+ /// This value will be visited by the garbage collector.
+ pub fn urlSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ RequestPrototype__urlSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Request.url` getter
+ /// This value will be visited by the garbage collector.
+ pub fn urlGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = RequestPrototype__urlGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the Request constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Request__getConstructor(globalObject);
}
-
+
/// Create a new instance of Request
pub fn toJS(this: *Request, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2243,14 +1827,14 @@ extern fn RequestPrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
/// Modify the internal ptr to point to a new instance of Request.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Request) bool {
- JSC.markBinding(@src());
- return Request__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Request__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Request, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Request__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Request__dangerouslySetPtr(value, null));
}
extern fn Request__fromJS(JSC.JSValue) ?*Request;
@@ -2261,147 +1845,106 @@ extern fn RequestPrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
extern fn Request__dangerouslySetPtr(JSC.JSValue, ?*Request) bool;
comptime {
-
- if (@TypeOf(Request.estimatedSize) != (fn(*Request) callconv(.C) usize)) {
- @compileLog("Request.estimatedSize is not a size function");
+ if (@TypeOf(Request.estimatedSize) != (fn (*Request) callconv(.C) usize)) {
+ @compileLog("Request.estimatedSize is not a size function");
}
-
- if (@TypeOf(Request.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Request)) {
- @compileLog("Request.constructor is not a constructor");
+
+ if (@TypeOf(Request.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Request)) {
+ @compileLog("Request.constructor is not a constructor");
}
-
- if (@TypeOf(Request.finalize) != (fn(*Request) callconv(.C) void)) {
- @compileLog("Request.finalize is not a finalizer");
+
+ if (@TypeOf(Request.finalize) != (fn (*Request) callconv(.C) void)) {
+ @compileLog("Request.finalize is not a finalizer");
}
-
- if (@TypeOf(Request.getArrayBuffer) != CallbackType)
- @compileLog(
- "Expected Request.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Request.getArrayBuffer))
- );
- if (@TypeOf(Request.getBlob) != CallbackType)
- @compileLog(
- "Expected Request.getBlob to be a callback but received " ++ @typeName(@TypeOf(Request.getBlob))
- );
- if (@TypeOf(Request.getBody) != GetterType)
- @compileLog(
- "Expected Request.getBody to be a getter"
- );
-
- if (@TypeOf(Request.getBodyUsed) != GetterType)
- @compileLog(
- "Expected Request.getBodyUsed to be a getter"
- );
-
- if (@TypeOf(Request.getCache) != GetterType)
- @compileLog(
- "Expected Request.getCache to be a getter"
- );
-
- if (@TypeOf(Request.doClone) != CallbackType)
- @compileLog(
- "Expected Request.doClone to be a callback but received " ++ @typeName(@TypeOf(Request.doClone))
- );
- if (@TypeOf(Request.getCredentials) != GetterType)
- @compileLog(
- "Expected Request.getCredentials to be a getter"
- );
-
- if (@TypeOf(Request.getDestination) != GetterType)
- @compileLog(
- "Expected Request.getDestination to be a getter"
- );
-
- if (@TypeOf(Request.getFormData) != CallbackType)
- @compileLog(
- "Expected Request.getFormData to be a callback but received " ++ @typeName(@TypeOf(Request.getFormData))
- );
- if (@TypeOf(Request.getHeaders) != GetterType)
- @compileLog(
- "Expected Request.getHeaders to be a getter"
- );
-
- if (@TypeOf(Request.getIntegrity) != GetterType)
- @compileLog(
- "Expected Request.getIntegrity to be a getter"
- );
-
- if (@TypeOf(Request.getJSON) != CallbackType)
- @compileLog(
- "Expected Request.getJSON to be a callback but received " ++ @typeName(@TypeOf(Request.getJSON))
- );
- if (@TypeOf(Request.getMethod) != GetterType)
- @compileLog(
- "Expected Request.getMethod to be a getter"
- );
-
- if (@TypeOf(Request.getMode) != GetterType)
- @compileLog(
- "Expected Request.getMode to be a getter"
- );
-
- if (@TypeOf(Request.getRedirect) != GetterType)
- @compileLog(
- "Expected Request.getRedirect to be a getter"
- );
-
- if (@TypeOf(Request.getReferrer) != GetterType)
- @compileLog(
- "Expected Request.getReferrer to be a getter"
- );
-
- if (@TypeOf(Request.getReferrerPolicy) != GetterType)
- @compileLog(
- "Expected Request.getReferrerPolicy to be a getter"
- );
-
- if (@TypeOf(Request.getSignal) != GetterType)
- @compileLog(
- "Expected Request.getSignal to be a getter"
- );
-
- if (@TypeOf(Request.getText) != CallbackType)
- @compileLog(
- "Expected Request.getText to be a callback but received " ++ @typeName(@TypeOf(Request.getText))
- );
- if (@TypeOf(Request.getUrl) != GetterType)
- @compileLog(
- "Expected Request.getUrl to be a getter"
- );
+
+ if (@TypeOf(Request.getArrayBuffer) != CallbackType)
+ @compileLog("Expected Request.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Request.getArrayBuffer)));
+ if (@TypeOf(Request.getBlob) != CallbackType)
+ @compileLog("Expected Request.getBlob to be a callback but received " ++ @typeName(@TypeOf(Request.getBlob)));
+ if (@TypeOf(Request.getBody) != GetterType)
+ @compileLog("Expected Request.getBody to be a getter");
+
+ if (@TypeOf(Request.getBodyUsed) != GetterType)
+ @compileLog("Expected Request.getBodyUsed to be a getter");
+
+ if (@TypeOf(Request.getCache) != GetterType)
+ @compileLog("Expected Request.getCache to be a getter");
+
+ if (@TypeOf(Request.doClone) != CallbackType)
+ @compileLog("Expected Request.doClone to be a callback but received " ++ @typeName(@TypeOf(Request.doClone)));
+ if (@TypeOf(Request.getCredentials) != GetterType)
+ @compileLog("Expected Request.getCredentials to be a getter");
+
+ if (@TypeOf(Request.getDestination) != GetterType)
+ @compileLog("Expected Request.getDestination to be a getter");
+
+ if (@TypeOf(Request.getFormData) != CallbackType)
+ @compileLog("Expected Request.getFormData to be a callback but received " ++ @typeName(@TypeOf(Request.getFormData)));
+ if (@TypeOf(Request.getHeaders) != GetterType)
+ @compileLog("Expected Request.getHeaders to be a getter");
+
+ if (@TypeOf(Request.getIntegrity) != GetterType)
+ @compileLog("Expected Request.getIntegrity to be a getter");
+
+ if (@TypeOf(Request.getJSON) != CallbackType)
+ @compileLog("Expected Request.getJSON to be a callback but received " ++ @typeName(@TypeOf(Request.getJSON)));
+ if (@TypeOf(Request.getMethod) != GetterType)
+ @compileLog("Expected Request.getMethod to be a getter");
+
+ if (@TypeOf(Request.getMode) != GetterType)
+ @compileLog("Expected Request.getMode to be a getter");
+
+ if (@TypeOf(Request.getRedirect) != GetterType)
+ @compileLog("Expected Request.getRedirect to be a getter");
+
+ if (@TypeOf(Request.getReferrer) != GetterType)
+ @compileLog("Expected Request.getReferrer to be a getter");
+
+ if (@TypeOf(Request.getReferrerPolicy) != GetterType)
+ @compileLog("Expected Request.getReferrerPolicy to be a getter");
+
+ if (@TypeOf(Request.getSignal) != GetterType)
+ @compileLog("Expected Request.getSignal to be a getter");
+
+ if (@TypeOf(Request.getText) != CallbackType)
+ @compileLog("Expected Request.getText to be a callback but received " ++ @typeName(@TypeOf(Request.getText)));
+ if (@TypeOf(Request.getUrl) != GetterType)
+ @compileLog("Expected Request.getUrl to be a getter");
if (!JSC.is_bindgen) {
-@export(Request.constructor, .{.name = "RequestClass__construct"});
- @export(Request.doClone, .{.name = "RequestPrototype__doClone"});
- @export(Request.estimatedSize, .{.name = "Request__estimatedSize"});
- @export(Request.finalize, .{.name = "RequestClass__finalize"});
- @export(Request.getArrayBuffer, .{.name = "RequestPrototype__getArrayBuffer"});
- @export(Request.getBlob, .{.name = "RequestPrototype__getBlob"});
- @export(Request.getBody, .{.name = "RequestPrototype__getBody"});
- @export(Request.getBodyUsed, .{.name = "RequestPrototype__getBodyUsed"});
- @export(Request.getCache, .{.name = "RequestPrototype__getCache"});
- @export(Request.getCredentials, .{.name = "RequestPrototype__getCredentials"});
- @export(Request.getDestination, .{.name = "RequestPrototype__getDestination"});
- @export(Request.getFormData, .{.name = "RequestPrototype__getFormData"});
- @export(Request.getHeaders, .{.name = "RequestPrototype__getHeaders"});
- @export(Request.getIntegrity, .{.name = "RequestPrototype__getIntegrity"});
- @export(Request.getJSON, .{.name = "RequestPrototype__getJSON"});
- @export(Request.getMethod, .{.name = "RequestPrototype__getMethod"});
- @export(Request.getMode, .{.name = "RequestPrototype__getMode"});
- @export(Request.getRedirect, .{.name = "RequestPrototype__getRedirect"});
- @export(Request.getReferrer, .{.name = "RequestPrototype__getReferrer"});
- @export(Request.getReferrerPolicy, .{.name = "RequestPrototype__getReferrerPolicy"});
- @export(Request.getSignal, .{.name = "RequestPrototype__getSignal"});
- @export(Request.getText, .{.name = "RequestPrototype__getText"});
- @export(Request.getUrl, .{.name = "RequestPrototype__getUrl"});
+ @export(Request.constructor, .{ .name = "RequestClass__construct" });
+ @export(Request.doClone, .{ .name = "RequestPrototype__doClone" });
+ @export(Request.estimatedSize, .{ .name = "Request__estimatedSize" });
+ @export(Request.finalize, .{ .name = "RequestClass__finalize" });
+ @export(Request.getArrayBuffer, .{ .name = "RequestPrototype__getArrayBuffer" });
+ @export(Request.getBlob, .{ .name = "RequestPrototype__getBlob" });
+ @export(Request.getBody, .{ .name = "RequestPrototype__getBody" });
+ @export(Request.getBodyUsed, .{ .name = "RequestPrototype__getBodyUsed" });
+ @export(Request.getCache, .{ .name = "RequestPrototype__getCache" });
+ @export(Request.getCredentials, .{ .name = "RequestPrototype__getCredentials" });
+ @export(Request.getDestination, .{ .name = "RequestPrototype__getDestination" });
+ @export(Request.getFormData, .{ .name = "RequestPrototype__getFormData" });
+ @export(Request.getHeaders, .{ .name = "RequestPrototype__getHeaders" });
+ @export(Request.getIntegrity, .{ .name = "RequestPrototype__getIntegrity" });
+ @export(Request.getJSON, .{ .name = "RequestPrototype__getJSON" });
+ @export(Request.getMethod, .{ .name = "RequestPrototype__getMethod" });
+ @export(Request.getMode, .{ .name = "RequestPrototype__getMode" });
+ @export(Request.getRedirect, .{ .name = "RequestPrototype__getRedirect" });
+ @export(Request.getReferrer, .{ .name = "RequestPrototype__getReferrer" });
+ @export(Request.getReferrerPolicy, .{ .name = "RequestPrototype__getReferrerPolicy" });
+ @export(Request.getSignal, .{ .name = "RequestPrototype__getSignal" });
+ @export(Request.getText, .{ .name = "RequestPrototype__getText" });
+ @export(Request.getUrl, .{ .name = "RequestPrototype__getUrl" });
}
}
};
pub const JSResponse = struct {
const Response = Classes.Response;
- const GetterType = fn(*Response, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Response, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Response, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Response, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Response, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Response, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Response, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Response, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Response, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Response, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2412,101 +1955,99 @@ pub const JSResponse = struct {
extern fn ResponsePrototype__bodySetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ResponsePrototype__bodyGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Response.body` setter
- /// This value will be visited by the garbage collector.
- pub fn bodySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ResponsePrototype__bodySetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ResponsePrototype__bodyGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Response.body` getter
- /// This value will be visited by the garbage collector.
- pub fn bodyGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ResponsePrototype__bodyGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Response.body` setter
+ /// This value will be visited by the garbage collector.
+ pub fn bodySetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ResponsePrototype__bodySetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Response.body` getter
+ /// This value will be visited by the garbage collector.
+ pub fn bodyGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ResponsePrototype__bodyGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ResponsePrototype__headersSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn ResponsePrototype__headersSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ResponsePrototype__headersGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Response.headers` setter
- /// This value will be visited by the garbage collector.
- pub fn headersSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ResponsePrototype__headersSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ResponsePrototype__headersGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `Response.headers` getter
- /// This value will be visited by the garbage collector.
- pub fn headersGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ResponsePrototype__headersGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Response.headers` setter
+ /// This value will be visited by the garbage collector.
+ pub fn headersSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ResponsePrototype__headersSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Response.headers` getter
+ /// This value will be visited by the garbage collector.
+ pub fn headersGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ResponsePrototype__headersGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ResponsePrototype__statusTextSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn ResponsePrototype__statusTextSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ResponsePrototype__statusTextGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Response.statusText` setter
- /// This value will be visited by the garbage collector.
- pub fn statusTextSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ResponsePrototype__statusTextSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ResponsePrototype__statusTextGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Response.statusText` setter
+ /// This value will be visited by the garbage collector.
+ pub fn statusTextSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ResponsePrototype__statusTextSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Response.statusText` getter
- /// This value will be visited by the garbage collector.
- pub fn statusTextGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ResponsePrototype__statusTextGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Response.statusText` getter
+ /// This value will be visited by the garbage collector.
+ pub fn statusTextGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ResponsePrototype__statusTextGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ResponsePrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn ResponsePrototype__urlGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Response.url` setter
- /// This value will be visited by the garbage collector.
- pub fn urlSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ResponsePrototype__urlSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ResponsePrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn ResponsePrototype__urlGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Response.url` setter
+ /// This value will be visited by the garbage collector.
+ pub fn urlSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ResponsePrototype__urlSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Response.url` getter
- /// This value will be visited by the garbage collector.
- pub fn urlGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ResponsePrototype__urlGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Response.url` getter
+ /// This value will be visited by the garbage collector.
+ pub fn urlGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ResponsePrototype__urlGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the Response constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Response__getConstructor(globalObject);
}
-
+
/// Create a new instance of Response
pub fn toJS(this: *Response, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2521,14 +2062,14 @@ extern fn ResponsePrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
/// Modify the internal ptr to point to a new instance of Response.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Response) bool {
- JSC.markBinding(@src());
- return Response__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Response__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Response, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Response__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Response__dangerouslySetPtr(value, null));
}
extern fn Response__fromJS(JSC.JSValue) ?*Response;
@@ -2539,132 +2080,95 @@ extern fn ResponsePrototype__urlSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
extern fn Response__dangerouslySetPtr(JSC.JSValue, ?*Response) bool;
comptime {
-
- if (@TypeOf(Response.estimatedSize) != (fn(*Response) callconv(.C) usize)) {
- @compileLog("Response.estimatedSize is not a size function");
+ if (@TypeOf(Response.estimatedSize) != (fn (*Response) callconv(.C) usize)) {
+ @compileLog("Response.estimatedSize is not a size function");
}
-
- if (@TypeOf(Response.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Response)) {
- @compileLog("Response.constructor is not a constructor");
+
+ if (@TypeOf(Response.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Response)) {
+ @compileLog("Response.constructor is not a constructor");
}
-
- if (@TypeOf(Response.finalize) != (fn(*Response) callconv(.C) void)) {
- @compileLog("Response.finalize is not a finalizer");
+
+ if (@TypeOf(Response.finalize) != (fn (*Response) callconv(.C) void)) {
+ @compileLog("Response.finalize is not a finalizer");
}
-
- if (@TypeOf(Response.getArrayBuffer) != CallbackType)
- @compileLog(
- "Expected Response.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Response.getArrayBuffer))
- );
- if (@TypeOf(Response.getBlob) != CallbackType)
- @compileLog(
- "Expected Response.getBlob to be a callback but received " ++ @typeName(@TypeOf(Response.getBlob))
- );
- if (@TypeOf(Response.getBody) != GetterType)
- @compileLog(
- "Expected Response.getBody to be a getter"
- );
-
- if (@TypeOf(Response.getBodyUsed) != GetterType)
- @compileLog(
- "Expected Response.getBodyUsed to be a getter"
- );
-
- if (@TypeOf(Response.doClone) != CallbackType)
- @compileLog(
- "Expected Response.doClone to be a callback but received " ++ @typeName(@TypeOf(Response.doClone))
- );
- if (@TypeOf(Response.getFormData) != CallbackType)
- @compileLog(
- "Expected Response.getFormData to be a callback but received " ++ @typeName(@TypeOf(Response.getFormData))
- );
- if (@TypeOf(Response.getHeaders) != GetterType)
- @compileLog(
- "Expected Response.getHeaders to be a getter"
- );
-
- if (@TypeOf(Response.getJSON) != CallbackType)
- @compileLog(
- "Expected Response.getJSON to be a callback but received " ++ @typeName(@TypeOf(Response.getJSON))
- );
- if (@TypeOf(Response.getOK) != GetterType)
- @compileLog(
- "Expected Response.getOK to be a getter"
- );
-
- if (@TypeOf(Response.getRedirected) != GetterType)
- @compileLog(
- "Expected Response.getRedirected to be a getter"
- );
-
- if (@TypeOf(Response.getStatus) != GetterType)
- @compileLog(
- "Expected Response.getStatus to be a getter"
- );
-
- if (@TypeOf(Response.getStatusText) != GetterType)
- @compileLog(
- "Expected Response.getStatusText to be a getter"
- );
-
- if (@TypeOf(Response.getText) != CallbackType)
- @compileLog(
- "Expected Response.getText to be a callback but received " ++ @typeName(@TypeOf(Response.getText))
- );
- if (@TypeOf(Response.getResponseType) != GetterType)
- @compileLog(
- "Expected Response.getResponseType to be a getter"
- );
-
- if (@TypeOf(Response.getURL) != GetterType)
- @compileLog(
- "Expected Response.getURL to be a getter"
- );
-
- if (@TypeOf(Response.constructError) != StaticCallbackType)
- @compileLog(
- "Expected Response.constructError to be a static callback"
- );
- if (@TypeOf(Response.constructJSON) != StaticCallbackType)
- @compileLog(
- "Expected Response.constructJSON to be a static callback"
- );
- if (@TypeOf(Response.constructRedirect) != StaticCallbackType)
- @compileLog(
- "Expected Response.constructRedirect to be a static callback"
- );
+
+ if (@TypeOf(Response.getArrayBuffer) != CallbackType)
+ @compileLog("Expected Response.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Response.getArrayBuffer)));
+ if (@TypeOf(Response.getBlob) != CallbackType)
+ @compileLog("Expected Response.getBlob to be a callback but received " ++ @typeName(@TypeOf(Response.getBlob)));
+ if (@TypeOf(Response.getBody) != GetterType)
+ @compileLog("Expected Response.getBody to be a getter");
+
+ if (@TypeOf(Response.getBodyUsed) != GetterType)
+ @compileLog("Expected Response.getBodyUsed to be a getter");
+
+ if (@TypeOf(Response.doClone) != CallbackType)
+ @compileLog("Expected Response.doClone to be a callback but received " ++ @typeName(@TypeOf(Response.doClone)));
+ if (@TypeOf(Response.getFormData) != CallbackType)
+ @compileLog("Expected Response.getFormData to be a callback but received " ++ @typeName(@TypeOf(Response.getFormData)));
+ if (@TypeOf(Response.getHeaders) != GetterType)
+ @compileLog("Expected Response.getHeaders to be a getter");
+
+ if (@TypeOf(Response.getJSON) != CallbackType)
+ @compileLog("Expected Response.getJSON to be a callback but received " ++ @typeName(@TypeOf(Response.getJSON)));
+ if (@TypeOf(Response.getOK) != GetterType)
+ @compileLog("Expected Response.getOK to be a getter");
+
+ if (@TypeOf(Response.getRedirected) != GetterType)
+ @compileLog("Expected Response.getRedirected to be a getter");
+
+ if (@TypeOf(Response.getStatus) != GetterType)
+ @compileLog("Expected Response.getStatus to be a getter");
+
+ if (@TypeOf(Response.getStatusText) != GetterType)
+ @compileLog("Expected Response.getStatusText to be a getter");
+
+ if (@TypeOf(Response.getText) != CallbackType)
+ @compileLog("Expected Response.getText to be a callback but received " ++ @typeName(@TypeOf(Response.getText)));
+ if (@TypeOf(Response.getResponseType) != GetterType)
+ @compileLog("Expected Response.getResponseType to be a getter");
+
+ if (@TypeOf(Response.getURL) != GetterType)
+ @compileLog("Expected Response.getURL to be a getter");
+
+ if (@TypeOf(Response.constructError) != StaticCallbackType)
+ @compileLog("Expected Response.constructError to be a static callback");
+ if (@TypeOf(Response.constructJSON) != StaticCallbackType)
+ @compileLog("Expected Response.constructJSON to be a static callback");
+ if (@TypeOf(Response.constructRedirect) != StaticCallbackType)
+ @compileLog("Expected Response.constructRedirect to be a static callback");
if (!JSC.is_bindgen) {
-@export(Response.constructError, .{.name = "ResponseClass__constructError"});
- @export(Response.constructJSON, .{.name = "ResponseClass__constructJSON"});
- @export(Response.constructor, .{.name = "ResponseClass__construct"});
- @export(Response.constructRedirect, .{.name = "ResponseClass__constructRedirect"});
- @export(Response.doClone, .{.name = "ResponsePrototype__doClone"});
- @export(Response.estimatedSize, .{.name = "Response__estimatedSize"});
- @export(Response.finalize, .{.name = "ResponseClass__finalize"});
- @export(Response.getArrayBuffer, .{.name = "ResponsePrototype__getArrayBuffer"});
- @export(Response.getBlob, .{.name = "ResponsePrototype__getBlob"});
- @export(Response.getBody, .{.name = "ResponsePrototype__getBody"});
- @export(Response.getBodyUsed, .{.name = "ResponsePrototype__getBodyUsed"});
- @export(Response.getFormData, .{.name = "ResponsePrototype__getFormData"});
- @export(Response.getHeaders, .{.name = "ResponsePrototype__getHeaders"});
- @export(Response.getJSON, .{.name = "ResponsePrototype__getJSON"});
- @export(Response.getOK, .{.name = "ResponsePrototype__getOK"});
- @export(Response.getRedirected, .{.name = "ResponsePrototype__getRedirected"});
- @export(Response.getResponseType, .{.name = "ResponsePrototype__getResponseType"});
- @export(Response.getStatus, .{.name = "ResponsePrototype__getStatus"});
- @export(Response.getStatusText, .{.name = "ResponsePrototype__getStatusText"});
- @export(Response.getText, .{.name = "ResponsePrototype__getText"});
- @export(Response.getURL, .{.name = "ResponsePrototype__getURL"});
+ @export(Response.constructError, .{ .name = "ResponseClass__constructError" });
+ @export(Response.constructJSON, .{ .name = "ResponseClass__constructJSON" });
+ @export(Response.constructor, .{ .name = "ResponseClass__construct" });
+ @export(Response.constructRedirect, .{ .name = "ResponseClass__constructRedirect" });
+ @export(Response.doClone, .{ .name = "ResponsePrototype__doClone" });
+ @export(Response.estimatedSize, .{ .name = "Response__estimatedSize" });
+ @export(Response.finalize, .{ .name = "ResponseClass__finalize" });
+ @export(Response.getArrayBuffer, .{ .name = "ResponsePrototype__getArrayBuffer" });
+ @export(Response.getBlob, .{ .name = "ResponsePrototype__getBlob" });
+ @export(Response.getBody, .{ .name = "ResponsePrototype__getBody" });
+ @export(Response.getBodyUsed, .{ .name = "ResponsePrototype__getBodyUsed" });
+ @export(Response.getFormData, .{ .name = "ResponsePrototype__getFormData" });
+ @export(Response.getHeaders, .{ .name = "ResponsePrototype__getHeaders" });
+ @export(Response.getJSON, .{ .name = "ResponsePrototype__getJSON" });
+ @export(Response.getOK, .{ .name = "ResponsePrototype__getOK" });
+ @export(Response.getRedirected, .{ .name = "ResponsePrototype__getRedirected" });
+ @export(Response.getResponseType, .{ .name = "ResponsePrototype__getResponseType" });
+ @export(Response.getStatus, .{ .name = "ResponsePrototype__getStatus" });
+ @export(Response.getStatusText, .{ .name = "ResponsePrototype__getStatusText" });
+ @export(Response.getText, .{ .name = "ResponsePrototype__getText" });
+ @export(Response.getURL, .{ .name = "ResponsePrototype__getURL" });
}
}
};
pub const JSSHA1 = struct {
const SHA1 = Classes.SHA1;
- const GetterType = fn(*SHA1, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA1, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA1, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA1, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA1, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA1, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA1, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA1, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA1, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA1, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2673,16 +2177,13 @@ pub const JSSHA1 = struct {
return SHA1__fromJS(value);
}
-
-
-
/// Get the SHA1 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA1__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA1
pub fn toJS(this: *SHA1, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2697,14 +2198,14 @@ pub const JSSHA1 = struct {
/// Modify the internal ptr to point to a new instance of SHA1.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA1) bool {
- JSC.markBinding(@src());
- return SHA1__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA1__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA1, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA1__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA1__dangerouslySetPtr(value, null));
}
extern fn SHA1__fromJS(JSC.JSValue) ?*SHA1;
@@ -2715,55 +2216,44 @@ pub const JSSHA1 = struct {
extern fn SHA1__dangerouslySetPtr(JSC.JSValue, ?*SHA1) bool;
comptime {
-
- if (@TypeOf(SHA1.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA1)) {
- @compileLog("SHA1.constructor is not a constructor");
+ if (@TypeOf(SHA1.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA1)) {
+ @compileLog("SHA1.constructor is not a constructor");
}
-
- if (@TypeOf(SHA1.finalize) != (fn(*SHA1) callconv(.C) void)) {
- @compileLog("SHA1.finalize is not a finalizer");
+
+ if (@TypeOf(SHA1.finalize) != (fn (*SHA1) callconv(.C) void)) {
+ @compileLog("SHA1.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA1.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA1.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA1.digest) != CallbackType)
- @compileLog(
- "Expected SHA1.digest to be a callback but received " ++ @typeName(@TypeOf(SHA1.digest))
- );
- if (@TypeOf(SHA1.update) != CallbackType)
- @compileLog(
- "Expected SHA1.update to be a callback but received " ++ @typeName(@TypeOf(SHA1.update))
- );
- if (@TypeOf(SHA1.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA1.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA1.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA1.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA1.getByteLength) != GetterType)
+ @compileLog("Expected SHA1.getByteLength to be a getter");
+
+ if (@TypeOf(SHA1.digest) != CallbackType)
+ @compileLog("Expected SHA1.digest to be a callback but received " ++ @typeName(@TypeOf(SHA1.digest)));
+ if (@TypeOf(SHA1.update) != CallbackType)
+ @compileLog("Expected SHA1.update to be a callback but received " ++ @typeName(@TypeOf(SHA1.update)));
+ if (@TypeOf(SHA1.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA1.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA1.hash) != StaticCallbackType)
+ @compileLog("Expected SHA1.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA1.constructor, .{.name = "SHA1Class__construct"});
- @export(SHA1.digest, .{.name = "SHA1Prototype__digest"});
- @export(SHA1.finalize, .{.name = "SHA1Class__finalize"});
- @export(SHA1.getByteLength, .{.name = "SHA1Prototype__getByteLength"});
- @export(SHA1.getByteLengthStatic, .{.name = "SHA1Class__getByteLengthStatic"});
- @export(SHA1.hash, .{.name = "SHA1Class__hash"});
- @export(SHA1.update, .{.name = "SHA1Prototype__update"});
+ @export(SHA1.constructor, .{ .name = "SHA1Class__construct" });
+ @export(SHA1.digest, .{ .name = "SHA1Prototype__digest" });
+ @export(SHA1.finalize, .{ .name = "SHA1Class__finalize" });
+ @export(SHA1.getByteLength, .{ .name = "SHA1Prototype__getByteLength" });
+ @export(SHA1.getByteLengthStatic, .{ .name = "SHA1Class__getByteLengthStatic" });
+ @export(SHA1.hash, .{ .name = "SHA1Class__hash" });
+ @export(SHA1.update, .{ .name = "SHA1Prototype__update" });
}
}
};
pub const JSSHA224 = struct {
const SHA224 = Classes.SHA224;
- const GetterType = fn(*SHA224, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA224, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA224, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA224, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA224, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA224, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA224, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA224, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA224, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA224, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2772,16 +2262,13 @@ pub const JSSHA224 = struct {
return SHA224__fromJS(value);
}
-
-
-
/// Get the SHA224 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA224__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA224
pub fn toJS(this: *SHA224, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2796,14 +2283,14 @@ pub const JSSHA224 = struct {
/// Modify the internal ptr to point to a new instance of SHA224.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA224) bool {
- JSC.markBinding(@src());
- return SHA224__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA224__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA224, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA224__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA224__dangerouslySetPtr(value, null));
}
extern fn SHA224__fromJS(JSC.JSValue) ?*SHA224;
@@ -2814,55 +2301,44 @@ pub const JSSHA224 = struct {
extern fn SHA224__dangerouslySetPtr(JSC.JSValue, ?*SHA224) bool;
comptime {
-
- if (@TypeOf(SHA224.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA224)) {
- @compileLog("SHA224.constructor is not a constructor");
+ if (@TypeOf(SHA224.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA224)) {
+ @compileLog("SHA224.constructor is not a constructor");
}
-
- if (@TypeOf(SHA224.finalize) != (fn(*SHA224) callconv(.C) void)) {
- @compileLog("SHA224.finalize is not a finalizer");
+
+ if (@TypeOf(SHA224.finalize) != (fn (*SHA224) callconv(.C) void)) {
+ @compileLog("SHA224.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA224.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA224.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA224.digest) != CallbackType)
- @compileLog(
- "Expected SHA224.digest to be a callback but received " ++ @typeName(@TypeOf(SHA224.digest))
- );
- if (@TypeOf(SHA224.update) != CallbackType)
- @compileLog(
- "Expected SHA224.update to be a callback but received " ++ @typeName(@TypeOf(SHA224.update))
- );
- if (@TypeOf(SHA224.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA224.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA224.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA224.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA224.getByteLength) != GetterType)
+ @compileLog("Expected SHA224.getByteLength to be a getter");
+
+ if (@TypeOf(SHA224.digest) != CallbackType)
+ @compileLog("Expected SHA224.digest to be a callback but received " ++ @typeName(@TypeOf(SHA224.digest)));
+ if (@TypeOf(SHA224.update) != CallbackType)
+ @compileLog("Expected SHA224.update to be a callback but received " ++ @typeName(@TypeOf(SHA224.update)));
+ if (@TypeOf(SHA224.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA224.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA224.hash) != StaticCallbackType)
+ @compileLog("Expected SHA224.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA224.constructor, .{.name = "SHA224Class__construct"});
- @export(SHA224.digest, .{.name = "SHA224Prototype__digest"});
- @export(SHA224.finalize, .{.name = "SHA224Class__finalize"});
- @export(SHA224.getByteLength, .{.name = "SHA224Prototype__getByteLength"});
- @export(SHA224.getByteLengthStatic, .{.name = "SHA224Class__getByteLengthStatic"});
- @export(SHA224.hash, .{.name = "SHA224Class__hash"});
- @export(SHA224.update, .{.name = "SHA224Prototype__update"});
+ @export(SHA224.constructor, .{ .name = "SHA224Class__construct" });
+ @export(SHA224.digest, .{ .name = "SHA224Prototype__digest" });
+ @export(SHA224.finalize, .{ .name = "SHA224Class__finalize" });
+ @export(SHA224.getByteLength, .{ .name = "SHA224Prototype__getByteLength" });
+ @export(SHA224.getByteLengthStatic, .{ .name = "SHA224Class__getByteLengthStatic" });
+ @export(SHA224.hash, .{ .name = "SHA224Class__hash" });
+ @export(SHA224.update, .{ .name = "SHA224Prototype__update" });
}
}
};
pub const JSSHA256 = struct {
const SHA256 = Classes.SHA256;
- const GetterType = fn(*SHA256, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA256, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA256, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA256, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA256, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA256, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA256, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA256, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA256, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA256, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2871,16 +2347,13 @@ pub const JSSHA256 = struct {
return SHA256__fromJS(value);
}
-
-
-
/// Get the SHA256 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA256__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA256
pub fn toJS(this: *SHA256, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2895,14 +2368,14 @@ pub const JSSHA256 = struct {
/// Modify the internal ptr to point to a new instance of SHA256.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA256) bool {
- JSC.markBinding(@src());
- return SHA256__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA256__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA256, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA256__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA256__dangerouslySetPtr(value, null));
}
extern fn SHA256__fromJS(JSC.JSValue) ?*SHA256;
@@ -2913,55 +2386,44 @@ pub const JSSHA256 = struct {
extern fn SHA256__dangerouslySetPtr(JSC.JSValue, ?*SHA256) bool;
comptime {
-
- if (@TypeOf(SHA256.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA256)) {
- @compileLog("SHA256.constructor is not a constructor");
+ if (@TypeOf(SHA256.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA256)) {
+ @compileLog("SHA256.constructor is not a constructor");
}
-
- if (@TypeOf(SHA256.finalize) != (fn(*SHA256) callconv(.C) void)) {
- @compileLog("SHA256.finalize is not a finalizer");
+
+ if (@TypeOf(SHA256.finalize) != (fn (*SHA256) callconv(.C) void)) {
+ @compileLog("SHA256.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA256.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA256.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA256.digest) != CallbackType)
- @compileLog(
- "Expected SHA256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA256.digest))
- );
- if (@TypeOf(SHA256.update) != CallbackType)
- @compileLog(
- "Expected SHA256.update to be a callback but received " ++ @typeName(@TypeOf(SHA256.update))
- );
- if (@TypeOf(SHA256.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA256.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA256.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA256.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA256.getByteLength) != GetterType)
+ @compileLog("Expected SHA256.getByteLength to be a getter");
+
+ if (@TypeOf(SHA256.digest) != CallbackType)
+ @compileLog("Expected SHA256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA256.digest)));
+ if (@TypeOf(SHA256.update) != CallbackType)
+ @compileLog("Expected SHA256.update to be a callback but received " ++ @typeName(@TypeOf(SHA256.update)));
+ if (@TypeOf(SHA256.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA256.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA256.hash) != StaticCallbackType)
+ @compileLog("Expected SHA256.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA256.constructor, .{.name = "SHA256Class__construct"});
- @export(SHA256.digest, .{.name = "SHA256Prototype__digest"});
- @export(SHA256.finalize, .{.name = "SHA256Class__finalize"});
- @export(SHA256.getByteLength, .{.name = "SHA256Prototype__getByteLength"});
- @export(SHA256.getByteLengthStatic, .{.name = "SHA256Class__getByteLengthStatic"});
- @export(SHA256.hash, .{.name = "SHA256Class__hash"});
- @export(SHA256.update, .{.name = "SHA256Prototype__update"});
+ @export(SHA256.constructor, .{ .name = "SHA256Class__construct" });
+ @export(SHA256.digest, .{ .name = "SHA256Prototype__digest" });
+ @export(SHA256.finalize, .{ .name = "SHA256Class__finalize" });
+ @export(SHA256.getByteLength, .{ .name = "SHA256Prototype__getByteLength" });
+ @export(SHA256.getByteLengthStatic, .{ .name = "SHA256Class__getByteLengthStatic" });
+ @export(SHA256.hash, .{ .name = "SHA256Class__hash" });
+ @export(SHA256.update, .{ .name = "SHA256Prototype__update" });
}
}
};
pub const JSSHA384 = struct {
const SHA384 = Classes.SHA384;
- const GetterType = fn(*SHA384, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA384, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA384, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA384, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA384, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA384, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA384, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA384, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA384, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA384, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -2970,16 +2432,13 @@ pub const JSSHA384 = struct {
return SHA384__fromJS(value);
}
-
-
-
/// Get the SHA384 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA384__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA384
pub fn toJS(this: *SHA384, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -2994,14 +2453,14 @@ pub const JSSHA384 = struct {
/// Modify the internal ptr to point to a new instance of SHA384.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA384) bool {
- JSC.markBinding(@src());
- return SHA384__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA384__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA384, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA384__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA384__dangerouslySetPtr(value, null));
}
extern fn SHA384__fromJS(JSC.JSValue) ?*SHA384;
@@ -3012,55 +2471,44 @@ pub const JSSHA384 = struct {
extern fn SHA384__dangerouslySetPtr(JSC.JSValue, ?*SHA384) bool;
comptime {
-
- if (@TypeOf(SHA384.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA384)) {
- @compileLog("SHA384.constructor is not a constructor");
+ if (@TypeOf(SHA384.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA384)) {
+ @compileLog("SHA384.constructor is not a constructor");
}
-
- if (@TypeOf(SHA384.finalize) != (fn(*SHA384) callconv(.C) void)) {
- @compileLog("SHA384.finalize is not a finalizer");
+
+ if (@TypeOf(SHA384.finalize) != (fn (*SHA384) callconv(.C) void)) {
+ @compileLog("SHA384.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA384.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA384.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA384.digest) != CallbackType)
- @compileLog(
- "Expected SHA384.digest to be a callback but received " ++ @typeName(@TypeOf(SHA384.digest))
- );
- if (@TypeOf(SHA384.update) != CallbackType)
- @compileLog(
- "Expected SHA384.update to be a callback but received " ++ @typeName(@TypeOf(SHA384.update))
- );
- if (@TypeOf(SHA384.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA384.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA384.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA384.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA384.getByteLength) != GetterType)
+ @compileLog("Expected SHA384.getByteLength to be a getter");
+
+ if (@TypeOf(SHA384.digest) != CallbackType)
+ @compileLog("Expected SHA384.digest to be a callback but received " ++ @typeName(@TypeOf(SHA384.digest)));
+ if (@TypeOf(SHA384.update) != CallbackType)
+ @compileLog("Expected SHA384.update to be a callback but received " ++ @typeName(@TypeOf(SHA384.update)));
+ if (@TypeOf(SHA384.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA384.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA384.hash) != StaticCallbackType)
+ @compileLog("Expected SHA384.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA384.constructor, .{.name = "SHA384Class__construct"});
- @export(SHA384.digest, .{.name = "SHA384Prototype__digest"});
- @export(SHA384.finalize, .{.name = "SHA384Class__finalize"});
- @export(SHA384.getByteLength, .{.name = "SHA384Prototype__getByteLength"});
- @export(SHA384.getByteLengthStatic, .{.name = "SHA384Class__getByteLengthStatic"});
- @export(SHA384.hash, .{.name = "SHA384Class__hash"});
- @export(SHA384.update, .{.name = "SHA384Prototype__update"});
+ @export(SHA384.constructor, .{ .name = "SHA384Class__construct" });
+ @export(SHA384.digest, .{ .name = "SHA384Prototype__digest" });
+ @export(SHA384.finalize, .{ .name = "SHA384Class__finalize" });
+ @export(SHA384.getByteLength, .{ .name = "SHA384Prototype__getByteLength" });
+ @export(SHA384.getByteLengthStatic, .{ .name = "SHA384Class__getByteLengthStatic" });
+ @export(SHA384.hash, .{ .name = "SHA384Class__hash" });
+ @export(SHA384.update, .{ .name = "SHA384Prototype__update" });
}
}
};
pub const JSSHA512 = struct {
const SHA512 = Classes.SHA512;
- const GetterType = fn(*SHA512, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA512, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA512, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA512, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA512, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA512, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA512, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA512, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA512, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA512, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -3069,16 +2517,13 @@ pub const JSSHA512 = struct {
return SHA512__fromJS(value);
}
-
-
-
/// Get the SHA512 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA512__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA512
pub fn toJS(this: *SHA512, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -3093,14 +2538,14 @@ pub const JSSHA512 = struct {
/// Modify the internal ptr to point to a new instance of SHA512.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA512) bool {
- JSC.markBinding(@src());
- return SHA512__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA512__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA512, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA512__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA512__dangerouslySetPtr(value, null));
}
extern fn SHA512__fromJS(JSC.JSValue) ?*SHA512;
@@ -3111,55 +2556,44 @@ pub const JSSHA512 = struct {
extern fn SHA512__dangerouslySetPtr(JSC.JSValue, ?*SHA512) bool;
comptime {
-
- if (@TypeOf(SHA512.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA512)) {
- @compileLog("SHA512.constructor is not a constructor");
+ if (@TypeOf(SHA512.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA512)) {
+ @compileLog("SHA512.constructor is not a constructor");
}
-
- if (@TypeOf(SHA512.finalize) != (fn(*SHA512) callconv(.C) void)) {
- @compileLog("SHA512.finalize is not a finalizer");
+
+ if (@TypeOf(SHA512.finalize) != (fn (*SHA512) callconv(.C) void)) {
+ @compileLog("SHA512.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA512.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA512.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA512.digest) != CallbackType)
- @compileLog(
- "Expected SHA512.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512.digest))
- );
- if (@TypeOf(SHA512.update) != CallbackType)
- @compileLog(
- "Expected SHA512.update to be a callback but received " ++ @typeName(@TypeOf(SHA512.update))
- );
- if (@TypeOf(SHA512.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA512.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA512.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA512.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA512.getByteLength) != GetterType)
+ @compileLog("Expected SHA512.getByteLength to be a getter");
+
+ if (@TypeOf(SHA512.digest) != CallbackType)
+ @compileLog("Expected SHA512.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512.digest)));
+ if (@TypeOf(SHA512.update) != CallbackType)
+ @compileLog("Expected SHA512.update to be a callback but received " ++ @typeName(@TypeOf(SHA512.update)));
+ if (@TypeOf(SHA512.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA512.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA512.hash) != StaticCallbackType)
+ @compileLog("Expected SHA512.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA512.constructor, .{.name = "SHA512Class__construct"});
- @export(SHA512.digest, .{.name = "SHA512Prototype__digest"});
- @export(SHA512.finalize, .{.name = "SHA512Class__finalize"});
- @export(SHA512.getByteLength, .{.name = "SHA512Prototype__getByteLength"});
- @export(SHA512.getByteLengthStatic, .{.name = "SHA512Class__getByteLengthStatic"});
- @export(SHA512.hash, .{.name = "SHA512Class__hash"});
- @export(SHA512.update, .{.name = "SHA512Prototype__update"});
+ @export(SHA512.constructor, .{ .name = "SHA512Class__construct" });
+ @export(SHA512.digest, .{ .name = "SHA512Prototype__digest" });
+ @export(SHA512.finalize, .{ .name = "SHA512Class__finalize" });
+ @export(SHA512.getByteLength, .{ .name = "SHA512Prototype__getByteLength" });
+ @export(SHA512.getByteLengthStatic, .{ .name = "SHA512Class__getByteLengthStatic" });
+ @export(SHA512.hash, .{ .name = "SHA512Class__hash" });
+ @export(SHA512.update, .{ .name = "SHA512Prototype__update" });
}
}
};
pub const JSSHA512_256 = struct {
const SHA512_256 = Classes.SHA512_256;
- const GetterType = fn(*SHA512_256, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*SHA512_256, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*SHA512_256, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*SHA512_256, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*SHA512_256, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*SHA512_256, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*SHA512_256, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*SHA512_256, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*SHA512_256, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*SHA512_256, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -3168,16 +2602,13 @@ pub const JSSHA512_256 = struct {
return SHA512_256__fromJS(value);
}
-
-
-
/// Get the SHA512_256 constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return SHA512_256__getConstructor(globalObject);
}
-
+
/// Create a new instance of SHA512_256
pub fn toJS(this: *SHA512_256, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -3192,14 +2623,14 @@ pub const JSSHA512_256 = struct {
/// Modify the internal ptr to point to a new instance of SHA512_256.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*SHA512_256) bool {
- JSC.markBinding(@src());
- return SHA512_256__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return SHA512_256__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *SHA512_256, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(SHA512_256__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(SHA512_256__dangerouslySetPtr(value, null));
}
extern fn SHA512_256__fromJS(JSC.JSValue) ?*SHA512_256;
@@ -3210,55 +2641,44 @@ pub const JSSHA512_256 = struct {
extern fn SHA512_256__dangerouslySetPtr(JSC.JSValue, ?*SHA512_256) bool;
comptime {
-
- if (@TypeOf(SHA512_256.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA512_256)) {
- @compileLog("SHA512_256.constructor is not a constructor");
+ if (@TypeOf(SHA512_256.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*SHA512_256)) {
+ @compileLog("SHA512_256.constructor is not a constructor");
}
-
- if (@TypeOf(SHA512_256.finalize) != (fn(*SHA512_256) callconv(.C) void)) {
- @compileLog("SHA512_256.finalize is not a finalizer");
+
+ if (@TypeOf(SHA512_256.finalize) != (fn (*SHA512_256) callconv(.C) void)) {
+ @compileLog("SHA512_256.finalize is not a finalizer");
}
-
- if (@TypeOf(SHA512_256.getByteLength) != GetterType)
- @compileLog(
- "Expected SHA512_256.getByteLength to be a getter"
- );
-
- if (@TypeOf(SHA512_256.digest) != CallbackType)
- @compileLog(
- "Expected SHA512_256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.digest))
- );
- if (@TypeOf(SHA512_256.update) != CallbackType)
- @compileLog(
- "Expected SHA512_256.update to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.update))
- );
- if (@TypeOf(SHA512_256.getByteLengthStatic) != StaticGetterType)
- @compileLog(
- "Expected SHA512_256.getByteLengthStatic to be a static getter"
- );
-
- if (@TypeOf(SHA512_256.hash) != StaticCallbackType)
- @compileLog(
- "Expected SHA512_256.hash to be a static callback"
- );
+
+ if (@TypeOf(SHA512_256.getByteLength) != GetterType)
+ @compileLog("Expected SHA512_256.getByteLength to be a getter");
+
+ if (@TypeOf(SHA512_256.digest) != CallbackType)
+ @compileLog("Expected SHA512_256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.digest)));
+ if (@TypeOf(SHA512_256.update) != CallbackType)
+ @compileLog("Expected SHA512_256.update to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.update)));
+ if (@TypeOf(SHA512_256.getByteLengthStatic) != StaticGetterType)
+ @compileLog("Expected SHA512_256.getByteLengthStatic to be a static getter");
+
+ if (@TypeOf(SHA512_256.hash) != StaticCallbackType)
+ @compileLog("Expected SHA512_256.hash to be a static callback");
if (!JSC.is_bindgen) {
-@export(SHA512_256.constructor, .{.name = "SHA512_256Class__construct"});
- @export(SHA512_256.digest, .{.name = "SHA512_256Prototype__digest"});
- @export(SHA512_256.finalize, .{.name = "SHA512_256Class__finalize"});
- @export(SHA512_256.getByteLength, .{.name = "SHA512_256Prototype__getByteLength"});
- @export(SHA512_256.getByteLengthStatic, .{.name = "SHA512_256Class__getByteLengthStatic"});
- @export(SHA512_256.hash, .{.name = "SHA512_256Class__hash"});
- @export(SHA512_256.update, .{.name = "SHA512_256Prototype__update"});
+ @export(SHA512_256.constructor, .{ .name = "SHA512_256Class__construct" });
+ @export(SHA512_256.digest, .{ .name = "SHA512_256Prototype__digest" });
+ @export(SHA512_256.finalize, .{ .name = "SHA512_256Class__finalize" });
+ @export(SHA512_256.getByteLength, .{ .name = "SHA512_256Prototype__getByteLength" });
+ @export(SHA512_256.getByteLengthStatic, .{ .name = "SHA512_256Class__getByteLengthStatic" });
+ @export(SHA512_256.hash, .{ .name = "SHA512_256Class__hash" });
+ @export(SHA512_256.update, .{ .name = "SHA512_256Prototype__update" });
}
}
};
pub const JSServerWebSocket = struct {
const ServerWebSocket = Classes.ServerWebSocket;
- const GetterType = fn(*ServerWebSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*ServerWebSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*ServerWebSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*ServerWebSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*ServerWebSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*ServerWebSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*ServerWebSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*ServerWebSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*ServerWebSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -3269,57 +2689,55 @@ pub const JSServerWebSocket = struct {
extern fn ServerWebSocketPrototype__dataSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn ServerWebSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `ServerWebSocket.data` setter
- /// This value will be visited by the garbage collector.
- pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ServerWebSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ServerWebSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `ServerWebSocket.data` setter
+ /// This value will be visited by the garbage collector.
+ pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ServerWebSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
+ }
- /// `ServerWebSocket.data` getter
- /// This value will be visited by the garbage collector.
- pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ServerWebSocketPrototype__dataGetCachedValue(thisValue);
- if (result == .zero)
+ /// `ServerWebSocket.data` getter
+ /// This value will be visited by the garbage collector.
+ pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ServerWebSocketPrototype__dataGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn ServerWebSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn ServerWebSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `ServerWebSocket.remoteAddress` setter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- ServerWebSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn ServerWebSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn ServerWebSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `ServerWebSocket.remoteAddress` setter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ ServerWebSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
+ }
- /// `ServerWebSocket.remoteAddress` getter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = ServerWebSocketPrototype__remoteAddressGetCachedValue(thisValue);
- if (result == .zero)
+ /// `ServerWebSocket.remoteAddress` getter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = ServerWebSocketPrototype__remoteAddressGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the ServerWebSocket constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return ServerWebSocket__getConstructor(globalObject);
}
-
+
/// Create a new instance of ServerWebSocket
pub fn toJS(this: *ServerWebSocket, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -3334,14 +2752,14 @@ extern fn ServerWebSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JS
/// Modify the internal ptr to point to a new instance of ServerWebSocket.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*ServerWebSocket) bool {
- JSC.markBinding(@src());
- return ServerWebSocket__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return ServerWebSocket__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *ServerWebSocket, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(ServerWebSocket__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(ServerWebSocket__dangerouslySetPtr(value, null));
}
extern fn ServerWebSocket__fromJS(JSC.JSValue) ?*ServerWebSocket;
@@ -3352,142 +2770,97 @@ extern fn ServerWebSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JS
extern fn ServerWebSocket__dangerouslySetPtr(JSC.JSValue, ?*ServerWebSocket) bool;
comptime {
-
- if (@TypeOf(ServerWebSocket.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*ServerWebSocket)) {
- @compileLog("ServerWebSocket.constructor is not a constructor");
- }
-
- if (@TypeOf(ServerWebSocket.finalize) != (fn(*ServerWebSocket) callconv(.C) void)) {
- @compileLog("ServerWebSocket.finalize is not a finalizer");
- }
-
- if (@TypeOf(ServerWebSocket.getBinaryType) != GetterType)
- @compileLog(
- "Expected ServerWebSocket.getBinaryType to be a getter"
- );
-
- if (@TypeOf(ServerWebSocket.setBinaryType) != SetterType)
- @compileLog(
- "Expected ServerWebSocket.setBinaryType to be a setter"
- );
- if (@TypeOf(ServerWebSocket.close) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.close to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.close))
- );
- if (@TypeOf(ServerWebSocket.cork) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.cork to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.cork))
- );
- if (@TypeOf(ServerWebSocket.getData) != GetterType)
- @compileLog(
- "Expected ServerWebSocket.getData to be a getter"
- );
-
- if (@TypeOf(ServerWebSocket.setData) != SetterType)
- @compileLog(
- "Expected ServerWebSocket.setData to be a setter"
- );
- if (@TypeOf(ServerWebSocket.getBufferedAmount) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.getBufferedAmount to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.getBufferedAmount))
- );
- if (@TypeOf(ServerWebSocket.isSubscribed) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.isSubscribed to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.isSubscribed))
- );
- if (@TypeOf(ServerWebSocket.publish) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.publish to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publish))
- );
- if (@TypeOf(ServerWebSocket.publishBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSUint8Array) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected ServerWebSocket.publishBinaryWithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(ServerWebSocket.publishBinary) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.publishBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishBinary))
- );
- if (@TypeOf(ServerWebSocket.publishTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSString) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected ServerWebSocket.publishTextWithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(ServerWebSocket.publishText) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.publishText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishText))
- );
- if (@TypeOf(ServerWebSocket.getReadyState) != GetterType)
- @compileLog(
- "Expected ServerWebSocket.getReadyState to be a getter"
- );
-
- if (@TypeOf(ServerWebSocket.getRemoteAddress) != GetterType)
- @compileLog(
- "Expected ServerWebSocket.getRemoteAddress to be a getter"
- );
-
- if (@TypeOf(ServerWebSocket.send) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.send to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.send))
- );
- if (@TypeOf(ServerWebSocket.sendBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSUint8Array, bool) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected ServerWebSocket.sendBinaryWithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(ServerWebSocket.sendBinary) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.sendBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendBinary))
- );
- if (@TypeOf(ServerWebSocket.sendTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, bool) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected ServerWebSocket.sendTextWithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(ServerWebSocket.sendText) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.sendText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendText))
- );
- if (@TypeOf(ServerWebSocket.subscribe) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.subscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.subscribe))
- );
- if (@TypeOf(ServerWebSocket.unsubscribe) != CallbackType)
- @compileLog(
- "Expected ServerWebSocket.unsubscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.unsubscribe))
- );
+ if (@TypeOf(ServerWebSocket.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*ServerWebSocket)) {
+ @compileLog("ServerWebSocket.constructor is not a constructor");
+ }
+
+ if (@TypeOf(ServerWebSocket.finalize) != (fn (*ServerWebSocket) callconv(.C) void)) {
+ @compileLog("ServerWebSocket.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(ServerWebSocket.getBinaryType) != GetterType)
+ @compileLog("Expected ServerWebSocket.getBinaryType to be a getter");
+
+ if (@TypeOf(ServerWebSocket.setBinaryType) != SetterType)
+ @compileLog("Expected ServerWebSocket.setBinaryType to be a setter");
+ if (@TypeOf(ServerWebSocket.close) != CallbackType)
+ @compileLog("Expected ServerWebSocket.close to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.close)));
+ if (@TypeOf(ServerWebSocket.cork) != CallbackType)
+ @compileLog("Expected ServerWebSocket.cork to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.cork)));
+ if (@TypeOf(ServerWebSocket.getData) != GetterType)
+ @compileLog("Expected ServerWebSocket.getData to be a getter");
+
+ if (@TypeOf(ServerWebSocket.setData) != SetterType)
+ @compileLog("Expected ServerWebSocket.setData to be a setter");
+ if (@TypeOf(ServerWebSocket.getBufferedAmount) != CallbackType)
+ @compileLog("Expected ServerWebSocket.getBufferedAmount to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.getBufferedAmount)));
+ if (@TypeOf(ServerWebSocket.isSubscribed) != CallbackType)
+ @compileLog("Expected ServerWebSocket.isSubscribed to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.isSubscribed)));
+ if (@TypeOf(ServerWebSocket.publish) != CallbackType)
+ @compileLog("Expected ServerWebSocket.publish to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publish)));
+ if (@TypeOf(ServerWebSocket.publishBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSUint8Array) callconv(.C) JSC.JSValue)
+ @compileLog("Expected ServerWebSocket.publishBinaryWithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(ServerWebSocket.publishBinary) != CallbackType)
+ @compileLog("Expected ServerWebSocket.publishBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishBinary)));
+ if (@TypeOf(ServerWebSocket.publishTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSString) callconv(.C) JSC.JSValue)
+ @compileLog("Expected ServerWebSocket.publishTextWithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(ServerWebSocket.publishText) != CallbackType)
+ @compileLog("Expected ServerWebSocket.publishText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishText)));
+ if (@TypeOf(ServerWebSocket.getReadyState) != GetterType)
+ @compileLog("Expected ServerWebSocket.getReadyState to be a getter");
+
+ if (@TypeOf(ServerWebSocket.getRemoteAddress) != GetterType)
+ @compileLog("Expected ServerWebSocket.getRemoteAddress to be a getter");
+
+ if (@TypeOf(ServerWebSocket.send) != CallbackType)
+ @compileLog("Expected ServerWebSocket.send to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.send)));
+ if (@TypeOf(ServerWebSocket.sendBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSUint8Array, bool) callconv(.C) JSC.JSValue)
+ @compileLog("Expected ServerWebSocket.sendBinaryWithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(ServerWebSocket.sendBinary) != CallbackType)
+ @compileLog("Expected ServerWebSocket.sendBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendBinary)));
+ if (@TypeOf(ServerWebSocket.sendTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, bool) callconv(.C) JSC.JSValue)
+ @compileLog("Expected ServerWebSocket.sendTextWithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(ServerWebSocket.sendText) != CallbackType)
+ @compileLog("Expected ServerWebSocket.sendText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendText)));
+ if (@TypeOf(ServerWebSocket.subscribe) != CallbackType)
+ @compileLog("Expected ServerWebSocket.subscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.subscribe)));
+ if (@TypeOf(ServerWebSocket.unsubscribe) != CallbackType)
+ @compileLog("Expected ServerWebSocket.unsubscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.unsubscribe)));
if (!JSC.is_bindgen) {
-@export(ServerWebSocket.close, .{.name = "ServerWebSocketPrototype__close"});
- @export(ServerWebSocket.constructor, .{.name = "ServerWebSocketClass__construct"});
- @export(ServerWebSocket.cork, .{.name = "ServerWebSocketPrototype__cork"});
- @export(ServerWebSocket.finalize, .{.name = "ServerWebSocketClass__finalize"});
- @export(ServerWebSocket.getBinaryType, .{.name = "ServerWebSocketPrototype__getBinaryType"});
- @export(ServerWebSocket.getBufferedAmount, .{.name = "ServerWebSocketPrototype__getBufferedAmount"});
- @export(ServerWebSocket.getData, .{.name = "ServerWebSocketPrototype__getData"});
- @export(ServerWebSocket.getReadyState, .{.name = "ServerWebSocketPrototype__getReadyState"});
- @export(ServerWebSocket.getRemoteAddress, .{.name = "ServerWebSocketPrototype__getRemoteAddress"});
- @export(ServerWebSocket.isSubscribed, .{.name = "ServerWebSocketPrototype__isSubscribed"});
- @export(ServerWebSocket.publish, .{.name = "ServerWebSocketPrototype__publish"});
- @export(ServerWebSocket.publishBinary, .{.name = "ServerWebSocketPrototype__publishBinary"});
- @export(ServerWebSocket.publishBinaryWithoutTypeChecks, .{.name = "ServerWebSocketPrototype__publishBinaryWithoutTypeChecks"});
- @export(ServerWebSocket.publishText, .{.name = "ServerWebSocketPrototype__publishText"});
- @export(ServerWebSocket.publishTextWithoutTypeChecks, .{.name = "ServerWebSocketPrototype__publishTextWithoutTypeChecks"});
- @export(ServerWebSocket.send, .{.name = "ServerWebSocketPrototype__send"});
- @export(ServerWebSocket.sendBinary, .{.name = "ServerWebSocketPrototype__sendBinary"});
- @export(ServerWebSocket.sendBinaryWithoutTypeChecks, .{.name = "ServerWebSocketPrototype__sendBinaryWithoutTypeChecks"});
- @export(ServerWebSocket.sendText, .{.name = "ServerWebSocketPrototype__sendText"});
- @export(ServerWebSocket.sendTextWithoutTypeChecks, .{.name = "ServerWebSocketPrototype__sendTextWithoutTypeChecks"});
- @export(ServerWebSocket.setBinaryType, .{.name = "ServerWebSocketPrototype__setBinaryType"});
- @export(ServerWebSocket.setData, .{.name = "ServerWebSocketPrototype__setData"});
- @export(ServerWebSocket.subscribe, .{.name = "ServerWebSocketPrototype__subscribe"});
- @export(ServerWebSocket.unsubscribe, .{.name = "ServerWebSocketPrototype__unsubscribe"});
+ @export(ServerWebSocket.close, .{ .name = "ServerWebSocketPrototype__close" });
+ @export(ServerWebSocket.constructor, .{ .name = "ServerWebSocketClass__construct" });
+ @export(ServerWebSocket.cork, .{ .name = "ServerWebSocketPrototype__cork" });
+ @export(ServerWebSocket.finalize, .{ .name = "ServerWebSocketClass__finalize" });
+ @export(ServerWebSocket.getBinaryType, .{ .name = "ServerWebSocketPrototype__getBinaryType" });
+ @export(ServerWebSocket.getBufferedAmount, .{ .name = "ServerWebSocketPrototype__getBufferedAmount" });
+ @export(ServerWebSocket.getData, .{ .name = "ServerWebSocketPrototype__getData" });
+ @export(ServerWebSocket.getReadyState, .{ .name = "ServerWebSocketPrototype__getReadyState" });
+ @export(ServerWebSocket.getRemoteAddress, .{ .name = "ServerWebSocketPrototype__getRemoteAddress" });
+ @export(ServerWebSocket.isSubscribed, .{ .name = "ServerWebSocketPrototype__isSubscribed" });
+ @export(ServerWebSocket.publish, .{ .name = "ServerWebSocketPrototype__publish" });
+ @export(ServerWebSocket.publishBinary, .{ .name = "ServerWebSocketPrototype__publishBinary" });
+ @export(ServerWebSocket.publishBinaryWithoutTypeChecks, .{ .name = "ServerWebSocketPrototype__publishBinaryWithoutTypeChecks" });
+ @export(ServerWebSocket.publishText, .{ .name = "ServerWebSocketPrototype__publishText" });
+ @export(ServerWebSocket.publishTextWithoutTypeChecks, .{ .name = "ServerWebSocketPrototype__publishTextWithoutTypeChecks" });
+ @export(ServerWebSocket.send, .{ .name = "ServerWebSocketPrototype__send" });
+ @export(ServerWebSocket.sendBinary, .{ .name = "ServerWebSocketPrototype__sendBinary" });
+ @export(ServerWebSocket.sendBinaryWithoutTypeChecks, .{ .name = "ServerWebSocketPrototype__sendBinaryWithoutTypeChecks" });
+ @export(ServerWebSocket.sendText, .{ .name = "ServerWebSocketPrototype__sendText" });
+ @export(ServerWebSocket.sendTextWithoutTypeChecks, .{ .name = "ServerWebSocketPrototype__sendTextWithoutTypeChecks" });
+ @export(ServerWebSocket.setBinaryType, .{ .name = "ServerWebSocketPrototype__setBinaryType" });
+ @export(ServerWebSocket.setData, .{ .name = "ServerWebSocketPrototype__setData" });
+ @export(ServerWebSocket.subscribe, .{ .name = "ServerWebSocketPrototype__subscribe" });
+ @export(ServerWebSocket.unsubscribe, .{ .name = "ServerWebSocketPrototype__unsubscribe" });
}
}
};
pub const JSStats = struct {
const Stats = Classes.Stats;
- const GetterType = fn(*Stats, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Stats, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Stats, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Stats, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Stats, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Stats, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Stats, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Stats, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Stats, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Stats, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -3498,79 +2871,77 @@ pub const JSStats = struct {
extern fn StatsPrototype__atimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn StatsPrototype__atimeGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Stats.atime` setter
- /// This value will be visited by the garbage collector.
- pub fn atimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- StatsPrototype__atimeSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn StatsPrototype__atimeGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Stats.atime` setter
+ /// This value will be visited by the garbage collector.
+ pub fn atimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ StatsPrototype__atimeSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Stats.atime` getter
- /// This value will be visited by the garbage collector.
- pub fn atimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = StatsPrototype__atimeGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Stats.atime` getter
+ /// This value will be visited by the garbage collector.
+ pub fn atimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = StatsPrototype__atimeGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn StatsPrototype__ctimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
+
+ extern fn StatsPrototype__ctimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn StatsPrototype__ctimeGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Stats.ctime` setter
- /// This value will be visited by the garbage collector.
- pub fn ctimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- StatsPrototype__ctimeSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn StatsPrototype__ctimeGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Stats.ctime` setter
+ /// This value will be visited by the garbage collector.
+ pub fn ctimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ StatsPrototype__ctimeSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Stats.ctime` getter
- /// This value will be visited by the garbage collector.
- pub fn ctimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = StatsPrototype__ctimeGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Stats.ctime` getter
+ /// This value will be visited by the garbage collector.
+ pub fn ctimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = StatsPrototype__ctimeGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn StatsPrototype__mtimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn StatsPrototype__mtimeGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Stats.mtime` setter
- /// This value will be visited by the garbage collector.
- pub fn mtimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- StatsPrototype__mtimeSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn StatsPrototype__mtimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn StatsPrototype__mtimeGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Stats.mtime` setter
+ /// This value will be visited by the garbage collector.
+ pub fn mtimeSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ StatsPrototype__mtimeSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Stats.mtime` getter
- /// This value will be visited by the garbage collector.
- pub fn mtimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = StatsPrototype__mtimeGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Stats.mtime` getter
+ /// This value will be visited by the garbage collector.
+ pub fn mtimeGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = StatsPrototype__mtimeGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the Stats constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Stats__getConstructor(globalObject);
}
-
+
/// Create a new instance of Stats
pub fn toJS(this: *Stats, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -3585,14 +2956,14 @@ extern fn StatsPrototype__mtimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
/// Modify the internal ptr to point to a new instance of Stats.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Stats) bool {
- JSC.markBinding(@src());
- return Stats__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Stats__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Stats, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Stats__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Stats__dangerouslySetPtr(value, null));
}
extern fn Stats__fromJS(JSC.JSValue) ?*Stats;
@@ -3603,206 +2974,162 @@ extern fn StatsPrototype__mtimeSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject,
extern fn Stats__dangerouslySetPtr(JSC.JSValue, ?*Stats) bool;
comptime {
-
- if (@TypeOf(Stats.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Stats)) {
- @compileLog("Stats.constructor is not a constructor");
- }
-
- if (@TypeOf(Stats.finalize) != (fn(*Stats) callconv(.C) void)) {
- @compileLog("Stats.finalize is not a finalizer");
- }
-
- if (@TypeOf(Stats.atime) != GetterType)
- @compileLog(
- "Expected Stats.atime to be a getter"
- );
-
- if (@TypeOf(Stats.atimeMs) != GetterType)
- @compileLog(
- "Expected Stats.atimeMs to be a getter"
- );
-
- if (@TypeOf(Stats.birthtime) != GetterType)
- @compileLog(
- "Expected Stats.birthtime to be a getter"
- );
-
- if (@TypeOf(Stats.birthtimeMs) != GetterType)
- @compileLog(
- "Expected Stats.birthtimeMs to be a getter"
- );
-
- if (@TypeOf(Stats.blksize) != GetterType)
- @compileLog(
- "Expected Stats.blksize to be a getter"
- );
-
- if (@TypeOf(Stats.blocks) != GetterType)
- @compileLog(
- "Expected Stats.blocks to be a getter"
- );
-
- if (@TypeOf(Stats.ctime) != GetterType)
- @compileLog(
- "Expected Stats.ctime to be a getter"
- );
-
- if (@TypeOf(Stats.ctimeMs) != GetterType)
- @compileLog(
- "Expected Stats.ctimeMs to be a getter"
- );
-
- if (@TypeOf(Stats.dev) != GetterType)
- @compileLog(
- "Expected Stats.dev to be a getter"
- );
-
- if (@TypeOf(Stats.gid) != GetterType)
- @compileLog(
- "Expected Stats.gid to be a getter"
- );
-
- if (@TypeOf(Stats.ino) != GetterType)
- @compileLog(
- "Expected Stats.ino to be a getter"
- );
-
- if (@TypeOf(Stats.isBlockDevice_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isBlockDevice_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isBlockDevice_) != CallbackType)
- @compileLog(
- "Expected Stats.isBlockDevice_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isBlockDevice_))
- );
- if (@TypeOf(Stats.isCharacterDevice_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isCharacterDevice_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isCharacterDevice_) != CallbackType)
- @compileLog(
- "Expected Stats.isCharacterDevice_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isCharacterDevice_))
- );
- if (@TypeOf(Stats.isDirectory_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isDirectory_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isDirectory_) != CallbackType)
- @compileLog(
- "Expected Stats.isDirectory_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isDirectory_))
- );
- if (@TypeOf(Stats.isFIFO_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isFIFO_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isFIFO_) != CallbackType)
- @compileLog(
- "Expected Stats.isFIFO_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isFIFO_))
- );
- if (@TypeOf(Stats.isFile_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isFile_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isFile_) != CallbackType)
- @compileLog(
- "Expected Stats.isFile_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isFile_))
- );
- if (@TypeOf(Stats.isSocket_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isSocket_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isSocket_) != CallbackType)
- @compileLog(
- "Expected Stats.isSocket_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isSocket_))
- );
- if (@TypeOf(Stats.isSymbolicLink_WithoutTypeChecks) != fn (*Stats, *JSC.JSGlobalObject, ) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected Stats.isSymbolicLink_WithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(Stats.isSymbolicLink_) != CallbackType)
- @compileLog(
- "Expected Stats.isSymbolicLink_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isSymbolicLink_))
- );
- if (@TypeOf(Stats.mode) != GetterType)
- @compileLog(
- "Expected Stats.mode to be a getter"
- );
-
- if (@TypeOf(Stats.mtime) != GetterType)
- @compileLog(
- "Expected Stats.mtime to be a getter"
- );
-
- if (@TypeOf(Stats.mtimeMs) != GetterType)
- @compileLog(
- "Expected Stats.mtimeMs to be a getter"
- );
-
- if (@TypeOf(Stats.nlink) != GetterType)
- @compileLog(
- "Expected Stats.nlink to be a getter"
- );
-
- if (@TypeOf(Stats.rdev) != GetterType)
- @compileLog(
- "Expected Stats.rdev to be a getter"
- );
-
- if (@TypeOf(Stats.size) != GetterType)
- @compileLog(
- "Expected Stats.size to be a getter"
- );
-
- if (@TypeOf(Stats.uid) != GetterType)
- @compileLog(
- "Expected Stats.uid to be a getter"
- );
+ if (@TypeOf(Stats.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Stats)) {
+ @compileLog("Stats.constructor is not a constructor");
+ }
+
+ if (@TypeOf(Stats.finalize) != (fn (*Stats) callconv(.C) void)) {
+ @compileLog("Stats.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(Stats.atime) != GetterType)
+ @compileLog("Expected Stats.atime to be a getter");
+
+ if (@TypeOf(Stats.atimeMs) != GetterType)
+ @compileLog("Expected Stats.atimeMs to be a getter");
+
+ if (@TypeOf(Stats.birthtime) != GetterType)
+ @compileLog("Expected Stats.birthtime to be a getter");
+
+ if (@TypeOf(Stats.birthtimeMs) != GetterType)
+ @compileLog("Expected Stats.birthtimeMs to be a getter");
+
+ if (@TypeOf(Stats.blksize) != GetterType)
+ @compileLog("Expected Stats.blksize to be a getter");
+
+ if (@TypeOf(Stats.blocks) != GetterType)
+ @compileLog("Expected Stats.blocks to be a getter");
+
+ if (@TypeOf(Stats.ctime) != GetterType)
+ @compileLog("Expected Stats.ctime to be a getter");
+
+ if (@TypeOf(Stats.ctimeMs) != GetterType)
+ @compileLog("Expected Stats.ctimeMs to be a getter");
+
+ if (@TypeOf(Stats.dev) != GetterType)
+ @compileLog("Expected Stats.dev to be a getter");
+
+ if (@TypeOf(Stats.gid) != GetterType)
+ @compileLog("Expected Stats.gid to be a getter");
+
+ if (@TypeOf(Stats.ino) != GetterType)
+ @compileLog("Expected Stats.ino to be a getter");
+
+ if (@TypeOf(Stats.isBlockDevice_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isBlockDevice_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isBlockDevice_) != CallbackType)
+ @compileLog("Expected Stats.isBlockDevice_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isBlockDevice_)));
+ if (@TypeOf(Stats.isCharacterDevice_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isCharacterDevice_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isCharacterDevice_) != CallbackType)
+ @compileLog("Expected Stats.isCharacterDevice_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isCharacterDevice_)));
+ if (@TypeOf(Stats.isDirectory_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isDirectory_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isDirectory_) != CallbackType)
+ @compileLog("Expected Stats.isDirectory_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isDirectory_)));
+ if (@TypeOf(Stats.isFIFO_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isFIFO_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isFIFO_) != CallbackType)
+ @compileLog("Expected Stats.isFIFO_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isFIFO_)));
+ if (@TypeOf(Stats.isFile_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isFile_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isFile_) != CallbackType)
+ @compileLog("Expected Stats.isFile_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isFile_)));
+ if (@TypeOf(Stats.isSocket_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isSocket_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isSocket_) != CallbackType)
+ @compileLog("Expected Stats.isSocket_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isSocket_)));
+ if (@TypeOf(Stats.isSymbolicLink_WithoutTypeChecks) != fn (
+ *Stats,
+ *JSC.JSGlobalObject,
+ ) callconv(.C) JSC.JSValue)
+ @compileLog("Expected Stats.isSymbolicLink_WithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(Stats.isSymbolicLink_) != CallbackType)
+ @compileLog("Expected Stats.isSymbolicLink_ to be a callback but received " ++ @typeName(@TypeOf(Stats.isSymbolicLink_)));
+ if (@TypeOf(Stats.mode) != GetterType)
+ @compileLog("Expected Stats.mode to be a getter");
+
+ if (@TypeOf(Stats.mtime) != GetterType)
+ @compileLog("Expected Stats.mtime to be a getter");
+
+ if (@TypeOf(Stats.mtimeMs) != GetterType)
+ @compileLog("Expected Stats.mtimeMs to be a getter");
+
+ if (@TypeOf(Stats.nlink) != GetterType)
+ @compileLog("Expected Stats.nlink to be a getter");
+
+ if (@TypeOf(Stats.rdev) != GetterType)
+ @compileLog("Expected Stats.rdev to be a getter");
+
+ if (@TypeOf(Stats.size) != GetterType)
+ @compileLog("Expected Stats.size to be a getter");
+
+ if (@TypeOf(Stats.uid) != GetterType)
+ @compileLog("Expected Stats.uid to be a getter");
if (!JSC.is_bindgen) {
-@export(Stats.atime, .{.name = "StatsPrototype__atime"});
- @export(Stats.atimeMs, .{.name = "StatsPrototype__atimeMs"});
- @export(Stats.birthtime, .{.name = "StatsPrototype__birthtime"});
- @export(Stats.birthtimeMs, .{.name = "StatsPrototype__birthtimeMs"});
- @export(Stats.blksize, .{.name = "StatsPrototype__blksize"});
- @export(Stats.blocks, .{.name = "StatsPrototype__blocks"});
- @export(Stats.constructor, .{.name = "StatsClass__construct"});
- @export(Stats.ctime, .{.name = "StatsPrototype__ctime"});
- @export(Stats.ctimeMs, .{.name = "StatsPrototype__ctimeMs"});
- @export(Stats.dev, .{.name = "StatsPrototype__dev"});
- @export(Stats.finalize, .{.name = "StatsClass__finalize"});
- @export(Stats.gid, .{.name = "StatsPrototype__gid"});
- @export(Stats.ino, .{.name = "StatsPrototype__ino"});
- @export(Stats.isBlockDevice_, .{.name = "StatsPrototype__isBlockDevice_"});
- @export(Stats.isBlockDevice_WithoutTypeChecks, .{.name = "StatsPrototype__isBlockDevice_WithoutTypeChecks"});
- @export(Stats.isCharacterDevice_, .{.name = "StatsPrototype__isCharacterDevice_"});
- @export(Stats.isCharacterDevice_WithoutTypeChecks, .{.name = "StatsPrototype__isCharacterDevice_WithoutTypeChecks"});
- @export(Stats.isDirectory_, .{.name = "StatsPrototype__isDirectory_"});
- @export(Stats.isDirectory_WithoutTypeChecks, .{.name = "StatsPrototype__isDirectory_WithoutTypeChecks"});
- @export(Stats.isFIFO_, .{.name = "StatsPrototype__isFIFO_"});
- @export(Stats.isFIFO_WithoutTypeChecks, .{.name = "StatsPrototype__isFIFO_WithoutTypeChecks"});
- @export(Stats.isFile_, .{.name = "StatsPrototype__isFile_"});
- @export(Stats.isFile_WithoutTypeChecks, .{.name = "StatsPrototype__isFile_WithoutTypeChecks"});
- @export(Stats.isSocket_, .{.name = "StatsPrototype__isSocket_"});
- @export(Stats.isSocket_WithoutTypeChecks, .{.name = "StatsPrototype__isSocket_WithoutTypeChecks"});
- @export(Stats.isSymbolicLink_, .{.name = "StatsPrototype__isSymbolicLink_"});
- @export(Stats.isSymbolicLink_WithoutTypeChecks, .{.name = "StatsPrototype__isSymbolicLink_WithoutTypeChecks"});
- @export(Stats.mode, .{.name = "StatsPrototype__mode"});
- @export(Stats.mtime, .{.name = "StatsPrototype__mtime"});
- @export(Stats.mtimeMs, .{.name = "StatsPrototype__mtimeMs"});
- @export(Stats.nlink, .{.name = "StatsPrototype__nlink"});
- @export(Stats.rdev, .{.name = "StatsPrototype__rdev"});
- @export(Stats.size, .{.name = "StatsPrototype__size"});
- @export(Stats.uid, .{.name = "StatsPrototype__uid"});
+ @export(Stats.atime, .{ .name = "StatsPrototype__atime" });
+ @export(Stats.atimeMs, .{ .name = "StatsPrototype__atimeMs" });
+ @export(Stats.birthtime, .{ .name = "StatsPrototype__birthtime" });
+ @export(Stats.birthtimeMs, .{ .name = "StatsPrototype__birthtimeMs" });
+ @export(Stats.blksize, .{ .name = "StatsPrototype__blksize" });
+ @export(Stats.blocks, .{ .name = "StatsPrototype__blocks" });
+ @export(Stats.constructor, .{ .name = "StatsClass__construct" });
+ @export(Stats.ctime, .{ .name = "StatsPrototype__ctime" });
+ @export(Stats.ctimeMs, .{ .name = "StatsPrototype__ctimeMs" });
+ @export(Stats.dev, .{ .name = "StatsPrototype__dev" });
+ @export(Stats.finalize, .{ .name = "StatsClass__finalize" });
+ @export(Stats.gid, .{ .name = "StatsPrototype__gid" });
+ @export(Stats.ino, .{ .name = "StatsPrototype__ino" });
+ @export(Stats.isBlockDevice_, .{ .name = "StatsPrototype__isBlockDevice_" });
+ @export(Stats.isBlockDevice_WithoutTypeChecks, .{ .name = "StatsPrototype__isBlockDevice_WithoutTypeChecks" });
+ @export(Stats.isCharacterDevice_, .{ .name = "StatsPrototype__isCharacterDevice_" });
+ @export(Stats.isCharacterDevice_WithoutTypeChecks, .{ .name = "StatsPrototype__isCharacterDevice_WithoutTypeChecks" });
+ @export(Stats.isDirectory_, .{ .name = "StatsPrototype__isDirectory_" });
+ @export(Stats.isDirectory_WithoutTypeChecks, .{ .name = "StatsPrototype__isDirectory_WithoutTypeChecks" });
+ @export(Stats.isFIFO_, .{ .name = "StatsPrototype__isFIFO_" });
+ @export(Stats.isFIFO_WithoutTypeChecks, .{ .name = "StatsPrototype__isFIFO_WithoutTypeChecks" });
+ @export(Stats.isFile_, .{ .name = "StatsPrototype__isFile_" });
+ @export(Stats.isFile_WithoutTypeChecks, .{ .name = "StatsPrototype__isFile_WithoutTypeChecks" });
+ @export(Stats.isSocket_, .{ .name = "StatsPrototype__isSocket_" });
+ @export(Stats.isSocket_WithoutTypeChecks, .{ .name = "StatsPrototype__isSocket_WithoutTypeChecks" });
+ @export(Stats.isSymbolicLink_, .{ .name = "StatsPrototype__isSymbolicLink_" });
+ @export(Stats.isSymbolicLink_WithoutTypeChecks, .{ .name = "StatsPrototype__isSymbolicLink_WithoutTypeChecks" });
+ @export(Stats.mode, .{ .name = "StatsPrototype__mode" });
+ @export(Stats.mtime, .{ .name = "StatsPrototype__mtime" });
+ @export(Stats.mtimeMs, .{ .name = "StatsPrototype__mtimeMs" });
+ @export(Stats.nlink, .{ .name = "StatsPrototype__nlink" });
+ @export(Stats.rdev, .{ .name = "StatsPrototype__rdev" });
+ @export(Stats.size, .{ .name = "StatsPrototype__size" });
+ @export(Stats.uid, .{ .name = "StatsPrototype__uid" });
}
}
};
pub const JSSubprocess = struct {
const Subprocess = Classes.Subprocess;
- const GetterType = fn(*Subprocess, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Subprocess, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Subprocess, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Subprocess, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Subprocess, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Subprocess, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Subprocess, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Subprocess, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Subprocess, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Subprocess, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -3813,72 +3140,70 @@ pub const JSSubprocess = struct {
extern fn SubprocessPrototype__stderrSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn SubprocessPrototype__stderrGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Subprocess.stderr` setter
- /// This value will be visited by the garbage collector.
- pub fn stderrSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- SubprocessPrototype__stderrSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn SubprocessPrototype__stderrGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Subprocess.stderr` setter
+ /// This value will be visited by the garbage collector.
+ pub fn stderrSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ SubprocessPrototype__stderrSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Subprocess.stderr` getter
- /// This value will be visited by the garbage collector.
- pub fn stderrGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = SubprocessPrototype__stderrGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Subprocess.stderr` getter
+ /// This value will be visited by the garbage collector.
+ pub fn stderrGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = SubprocessPrototype__stderrGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn SubprocessPrototype__stdinSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn SubprocessPrototype__stdinGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Subprocess.stdin` setter
- /// This value will be visited by the garbage collector.
- pub fn stdinSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- SubprocessPrototype__stdinSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn SubprocessPrototype__stdinSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn SubprocessPrototype__stdinGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Subprocess.stdin` setter
+ /// This value will be visited by the garbage collector.
+ pub fn stdinSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ SubprocessPrototype__stdinSetCachedValue(thisValue, globalObject, value);
+ }
- /// `Subprocess.stdin` getter
- /// This value will be visited by the garbage collector.
- pub fn stdinGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = SubprocessPrototype__stdinGetCachedValue(thisValue);
- if (result == .zero)
+ /// `Subprocess.stdin` getter
+ /// This value will be visited by the garbage collector.
+ pub fn stdinGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = SubprocessPrototype__stdinGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn SubprocessPrototype__stdoutSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn SubprocessPrototype__stdoutGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `Subprocess.stdout` setter
- /// This value will be visited by the garbage collector.
- pub fn stdoutSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- SubprocessPrototype__stdoutSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn SubprocessPrototype__stdoutSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `Subprocess.stdout` getter
- /// This value will be visited by the garbage collector.
- pub fn stdoutGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = SubprocessPrototype__stdoutGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn SubprocessPrototype__stdoutGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `Subprocess.stdout` setter
+ /// This value will be visited by the garbage collector.
+ pub fn stdoutSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ SubprocessPrototype__stdoutSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `Subprocess.stdout` getter
+ /// This value will be visited by the garbage collector.
+ pub fn stdoutGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = SubprocessPrototype__stdoutGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of Subprocess
pub fn toJS(this: *Subprocess, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -3893,14 +3218,14 @@ extern fn SubprocessPrototype__stdoutSetCachedValue(JSC.JSValue, *JSC.JSGlobalOb
/// Modify the internal ptr to point to a new instance of Subprocess.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Subprocess) bool {
- JSC.markBinding(@src());
- return Subprocess__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Subprocess__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Subprocess, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Subprocess__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Subprocess__dangerouslySetPtr(value, null));
}
extern fn Subprocess__fromJS(JSC.JSValue) ?*Subprocess;
@@ -3911,97 +3236,70 @@ extern fn SubprocessPrototype__stdoutSetCachedValue(JSC.JSValue, *JSC.JSGlobalOb
extern fn Subprocess__dangerouslySetPtr(JSC.JSValue, ?*Subprocess) bool;
comptime {
-
- if (@TypeOf(Subprocess.finalize) != (fn(*Subprocess) callconv(.C) void)) {
- @compileLog("Subprocess.finalize is not a finalizer");
+ if (@TypeOf(Subprocess.finalize) != (fn (*Subprocess) callconv(.C) void)) {
+ @compileLog("Subprocess.finalize is not a finalizer");
}
-
- if (@TypeOf(Subprocess.getExitCode) != GetterType)
- @compileLog(
- "Expected Subprocess.getExitCode to be a getter"
- );
-
- if (@TypeOf(Subprocess.getExited) != GetterType)
- @compileLog(
- "Expected Subprocess.getExited to be a getter"
- );
-
- if (@TypeOf(Subprocess.kill) != CallbackType)
- @compileLog(
- "Expected Subprocess.kill to be a callback but received " ++ @typeName(@TypeOf(Subprocess.kill))
- );
- if (@TypeOf(Subprocess.getKilled) != GetterType)
- @compileLog(
- "Expected Subprocess.getKilled to be a getter"
- );
-
- if (@TypeOf(Subprocess.getPid) != GetterType)
- @compileLog(
- "Expected Subprocess.getPid to be a getter"
- );
-
- if (@TypeOf(Subprocess.getStdout) != GetterType)
- @compileLog(
- "Expected Subprocess.getStdout to be a getter"
- );
-
- if (@TypeOf(Subprocess.doRef) != CallbackType)
- @compileLog(
- "Expected Subprocess.doRef to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doRef))
- );
- if (@TypeOf(Subprocess.getSignalCode) != GetterType)
- @compileLog(
- "Expected Subprocess.getSignalCode to be a getter"
- );
-
- if (@TypeOf(Subprocess.getStderr) != GetterType)
- @compileLog(
- "Expected Subprocess.getStderr to be a getter"
- );
-
- if (@TypeOf(Subprocess.getStdin) != GetterType)
- @compileLog(
- "Expected Subprocess.getStdin to be a getter"
- );
-
- if (@TypeOf(Subprocess.getStdout) != GetterType)
- @compileLog(
- "Expected Subprocess.getStdout to be a getter"
- );
-
- if (@TypeOf(Subprocess.doUnref) != CallbackType)
- @compileLog(
- "Expected Subprocess.doUnref to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doUnref))
- );
- if (@TypeOf(Subprocess.getStdin) != GetterType)
- @compileLog(
- "Expected Subprocess.getStdin to be a getter"
- );
+
+ if (@TypeOf(Subprocess.getExitCode) != GetterType)
+ @compileLog("Expected Subprocess.getExitCode to be a getter");
+
+ if (@TypeOf(Subprocess.getExited) != GetterType)
+ @compileLog("Expected Subprocess.getExited to be a getter");
+
+ if (@TypeOf(Subprocess.kill) != CallbackType)
+ @compileLog("Expected Subprocess.kill to be a callback but received " ++ @typeName(@TypeOf(Subprocess.kill)));
+ if (@TypeOf(Subprocess.getKilled) != GetterType)
+ @compileLog("Expected Subprocess.getKilled to be a getter");
+
+ if (@TypeOf(Subprocess.getPid) != GetterType)
+ @compileLog("Expected Subprocess.getPid to be a getter");
+
+ if (@TypeOf(Subprocess.getStdout) != GetterType)
+ @compileLog("Expected Subprocess.getStdout to be a getter");
+
+ if (@TypeOf(Subprocess.doRef) != CallbackType)
+ @compileLog("Expected Subprocess.doRef to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doRef)));
+ if (@TypeOf(Subprocess.getSignalCode) != GetterType)
+ @compileLog("Expected Subprocess.getSignalCode to be a getter");
+
+ if (@TypeOf(Subprocess.getStderr) != GetterType)
+ @compileLog("Expected Subprocess.getStderr to be a getter");
+
+ if (@TypeOf(Subprocess.getStdin) != GetterType)
+ @compileLog("Expected Subprocess.getStdin to be a getter");
+
+ if (@TypeOf(Subprocess.getStdout) != GetterType)
+ @compileLog("Expected Subprocess.getStdout to be a getter");
+
+ if (@TypeOf(Subprocess.doUnref) != CallbackType)
+ @compileLog("Expected Subprocess.doUnref to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doUnref)));
+ if (@TypeOf(Subprocess.getStdin) != GetterType)
+ @compileLog("Expected Subprocess.getStdin to be a getter");
if (!JSC.is_bindgen) {
-@export(Subprocess.doRef, .{.name = "SubprocessPrototype__doRef"});
- @export(Subprocess.doUnref, .{.name = "SubprocessPrototype__doUnref"});
- @export(Subprocess.finalize, .{.name = "SubprocessClass__finalize"});
- @export(Subprocess.getExitCode, .{.name = "SubprocessPrototype__getExitCode"});
- @export(Subprocess.getExited, .{.name = "SubprocessPrototype__getExited"});
- @export(Subprocess.getKilled, .{.name = "SubprocessPrototype__getKilled"});
- @export(Subprocess.getPid, .{.name = "SubprocessPrototype__getPid"});
- @export(Subprocess.getSignalCode, .{.name = "SubprocessPrototype__getSignalCode"});
- @export(Subprocess.getStderr, .{.name = "SubprocessPrototype__getStderr"});
- @export(Subprocess.getStdin, .{.name = "SubprocessPrototype__getStdin"});
- @export(Subprocess.getStdout, .{.name = "SubprocessPrototype__getStdout"});
- @export(Subprocess.hasPendingActivity, .{.name = "Subprocess__hasPendingActivity"});
- @export(Subprocess.kill, .{.name = "SubprocessPrototype__kill"});
+ @export(Subprocess.doRef, .{ .name = "SubprocessPrototype__doRef" });
+ @export(Subprocess.doUnref, .{ .name = "SubprocessPrototype__doUnref" });
+ @export(Subprocess.finalize, .{ .name = "SubprocessClass__finalize" });
+ @export(Subprocess.getExitCode, .{ .name = "SubprocessPrototype__getExitCode" });
+ @export(Subprocess.getExited, .{ .name = "SubprocessPrototype__getExited" });
+ @export(Subprocess.getKilled, .{ .name = "SubprocessPrototype__getKilled" });
+ @export(Subprocess.getPid, .{ .name = "SubprocessPrototype__getPid" });
+ @export(Subprocess.getSignalCode, .{ .name = "SubprocessPrototype__getSignalCode" });
+ @export(Subprocess.getStderr, .{ .name = "SubprocessPrototype__getStderr" });
+ @export(Subprocess.getStdin, .{ .name = "SubprocessPrototype__getStdin" });
+ @export(Subprocess.getStdout, .{ .name = "SubprocessPrototype__getStdout" });
+ @export(Subprocess.hasPendingActivity, .{ .name = "Subprocess__hasPendingActivity" });
+ @export(Subprocess.kill, .{ .name = "SubprocessPrototype__kill" });
}
}
};
pub const JSTCPSocket = struct {
const TCPSocket = Classes.TCPSocket;
- const GetterType = fn(*TCPSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*TCPSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*TCPSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*TCPSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*TCPSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*TCPSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*TCPSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*TCPSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*TCPSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*TCPSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -4012,50 +3310,48 @@ pub const JSTCPSocket = struct {
extern fn TCPSocketPrototype__dataSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn TCPSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `TCPSocket.data` setter
- /// This value will be visited by the garbage collector.
- pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- TCPSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn TCPSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `TCPSocket.data` setter
+ /// This value will be visited by the garbage collector.
+ pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ TCPSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
+ }
- /// `TCPSocket.data` getter
- /// This value will be visited by the garbage collector.
- pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = TCPSocketPrototype__dataGetCachedValue(thisValue);
- if (result == .zero)
+ /// `TCPSocket.data` getter
+ /// This value will be visited by the garbage collector.
+ pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = TCPSocketPrototype__dataGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn TCPSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn TCPSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `TCPSocket.remoteAddress` setter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- TCPSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn TCPSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+
+ extern fn TCPSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `TCPSocket.remoteAddress` setter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ TCPSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
+ }
- /// `TCPSocket.remoteAddress` getter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = TCPSocketPrototype__remoteAddressGetCachedValue(thisValue);
- if (result == .zero)
+ /// `TCPSocket.remoteAddress` getter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = TCPSocketPrototype__remoteAddressGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of TCPSocket
pub fn toJS(this: *TCPSocket, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -4070,14 +3366,14 @@ extern fn TCPSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGl
/// Modify the internal ptr to point to a new instance of TCPSocket.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*TCPSocket) bool {
- JSC.markBinding(@src());
- return TCPSocket__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return TCPSocket__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *TCPSocket, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(TCPSocket__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(TCPSocket__dangerouslySetPtr(value, null));
}
extern fn TCPSocket__fromJS(JSC.JSValue) ?*TCPSocket;
@@ -4088,110 +3384,77 @@ extern fn TCPSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGl
extern fn TCPSocket__dangerouslySetPtr(JSC.JSValue, ?*TCPSocket) bool;
comptime {
-
- if (@TypeOf(TCPSocket.finalize) != (fn(*TCPSocket) callconv(.C) void)) {
- @compileLog("TCPSocket.finalize is not a finalizer");
- }
-
- if (@TypeOf(TCPSocket.getAuthorized) != GetterType)
- @compileLog(
- "Expected TCPSocket.getAuthorized to be a getter"
- );
-
- if (@TypeOf(TCPSocket.getData) != GetterType)
- @compileLog(
- "Expected TCPSocket.getData to be a getter"
- );
-
- if (@TypeOf(TCPSocket.setData) != SetterType)
- @compileLog(
- "Expected TCPSocket.setData to be a setter"
- );
- if (@TypeOf(TCPSocket.end) != CallbackType)
- @compileLog(
- "Expected TCPSocket.end to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.end))
- );
- if (@TypeOf(TCPSocket.flush) != CallbackType)
- @compileLog(
- "Expected TCPSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.flush))
- );
- if (@TypeOf(TCPSocket.getAuthorizationError) != CallbackType)
- @compileLog(
- "Expected TCPSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getAuthorizationError))
- );
- if (@TypeOf(TCPSocket.getListener) != GetterType)
- @compileLog(
- "Expected TCPSocket.getListener to be a getter"
- );
-
- if (@TypeOf(TCPSocket.getLocalPort) != GetterType)
- @compileLog(
- "Expected TCPSocket.getLocalPort to be a getter"
- );
-
- if (@TypeOf(TCPSocket.getReadyState) != GetterType)
- @compileLog(
- "Expected TCPSocket.getReadyState to be a getter"
- );
-
- if (@TypeOf(TCPSocket.ref) != CallbackType)
- @compileLog(
- "Expected TCPSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.ref))
- );
- if (@TypeOf(TCPSocket.reload) != CallbackType)
- @compileLog(
- "Expected TCPSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.reload))
- );
- if (@TypeOf(TCPSocket.getRemoteAddress) != GetterType)
- @compileLog(
- "Expected TCPSocket.getRemoteAddress to be a getter"
- );
-
- if (@TypeOf(TCPSocket.shutdown) != CallbackType)
- @compileLog(
- "Expected TCPSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.shutdown))
- );
- if (@TypeOf(TCPSocket.timeout) != CallbackType)
- @compileLog(
- "Expected TCPSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.timeout))
- );
- if (@TypeOf(TCPSocket.unref) != CallbackType)
- @compileLog(
- "Expected TCPSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.unref))
- );
- if (@TypeOf(TCPSocket.write) != CallbackType)
- @compileLog(
- "Expected TCPSocket.write to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.write))
- );
+ if (@TypeOf(TCPSocket.finalize) != (fn (*TCPSocket) callconv(.C) void)) {
+ @compileLog("TCPSocket.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(TCPSocket.getAuthorized) != GetterType)
+ @compileLog("Expected TCPSocket.getAuthorized to be a getter");
+
+ if (@TypeOf(TCPSocket.getData) != GetterType)
+ @compileLog("Expected TCPSocket.getData to be a getter");
+
+ if (@TypeOf(TCPSocket.setData) != SetterType)
+ @compileLog("Expected TCPSocket.setData to be a setter");
+ if (@TypeOf(TCPSocket.end) != CallbackType)
+ @compileLog("Expected TCPSocket.end to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.end)));
+ if (@TypeOf(TCPSocket.flush) != CallbackType)
+ @compileLog("Expected TCPSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.flush)));
+ if (@TypeOf(TCPSocket.getAuthorizationError) != CallbackType)
+ @compileLog("Expected TCPSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.getAuthorizationError)));
+ if (@TypeOf(TCPSocket.getListener) != GetterType)
+ @compileLog("Expected TCPSocket.getListener to be a getter");
+
+ if (@TypeOf(TCPSocket.getLocalPort) != GetterType)
+ @compileLog("Expected TCPSocket.getLocalPort to be a getter");
+
+ if (@TypeOf(TCPSocket.getReadyState) != GetterType)
+ @compileLog("Expected TCPSocket.getReadyState to be a getter");
+
+ if (@TypeOf(TCPSocket.ref) != CallbackType)
+ @compileLog("Expected TCPSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.ref)));
+ if (@TypeOf(TCPSocket.reload) != CallbackType)
+ @compileLog("Expected TCPSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.reload)));
+ if (@TypeOf(TCPSocket.getRemoteAddress) != GetterType)
+ @compileLog("Expected TCPSocket.getRemoteAddress to be a getter");
+
+ if (@TypeOf(TCPSocket.shutdown) != CallbackType)
+ @compileLog("Expected TCPSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.shutdown)));
+ if (@TypeOf(TCPSocket.timeout) != CallbackType)
+ @compileLog("Expected TCPSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.timeout)));
+ if (@TypeOf(TCPSocket.unref) != CallbackType)
+ @compileLog("Expected TCPSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.unref)));
+ if (@TypeOf(TCPSocket.write) != CallbackType)
+ @compileLog("Expected TCPSocket.write to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.write)));
if (!JSC.is_bindgen) {
-@export(TCPSocket.end, .{.name = "TCPSocketPrototype__end"});
- @export(TCPSocket.finalize, .{.name = "TCPSocketClass__finalize"});
- @export(TCPSocket.flush, .{.name = "TCPSocketPrototype__flush"});
- @export(TCPSocket.getAuthorizationError, .{.name = "TCPSocketPrototype__getAuthorizationError"});
- @export(TCPSocket.getAuthorized, .{.name = "TCPSocketPrototype__getAuthorized"});
- @export(TCPSocket.getData, .{.name = "TCPSocketPrototype__getData"});
- @export(TCPSocket.getListener, .{.name = "TCPSocketPrototype__getListener"});
- @export(TCPSocket.getLocalPort, .{.name = "TCPSocketPrototype__getLocalPort"});
- @export(TCPSocket.getReadyState, .{.name = "TCPSocketPrototype__getReadyState"});
- @export(TCPSocket.getRemoteAddress, .{.name = "TCPSocketPrototype__getRemoteAddress"});
- @export(TCPSocket.hasPendingActivity, .{.name = "TCPSocket__hasPendingActivity"});
- @export(TCPSocket.ref, .{.name = "TCPSocketPrototype__ref"});
- @export(TCPSocket.reload, .{.name = "TCPSocketPrototype__reload"});
- @export(TCPSocket.setData, .{.name = "TCPSocketPrototype__setData"});
- @export(TCPSocket.shutdown, .{.name = "TCPSocketPrototype__shutdown"});
- @export(TCPSocket.timeout, .{.name = "TCPSocketPrototype__timeout"});
- @export(TCPSocket.unref, .{.name = "TCPSocketPrototype__unref"});
- @export(TCPSocket.write, .{.name = "TCPSocketPrototype__write"});
+ @export(TCPSocket.end, .{ .name = "TCPSocketPrototype__end" });
+ @export(TCPSocket.finalize, .{ .name = "TCPSocketClass__finalize" });
+ @export(TCPSocket.flush, .{ .name = "TCPSocketPrototype__flush" });
+ @export(TCPSocket.getAuthorizationError, .{ .name = "TCPSocketPrototype__getAuthorizationError" });
+ @export(TCPSocket.getAuthorized, .{ .name = "TCPSocketPrototype__getAuthorized" });
+ @export(TCPSocket.getData, .{ .name = "TCPSocketPrototype__getData" });
+ @export(TCPSocket.getListener, .{ .name = "TCPSocketPrototype__getListener" });
+ @export(TCPSocket.getLocalPort, .{ .name = "TCPSocketPrototype__getLocalPort" });
+ @export(TCPSocket.getReadyState, .{ .name = "TCPSocketPrototype__getReadyState" });
+ @export(TCPSocket.getRemoteAddress, .{ .name = "TCPSocketPrototype__getRemoteAddress" });
+ @export(TCPSocket.hasPendingActivity, .{ .name = "TCPSocket__hasPendingActivity" });
+ @export(TCPSocket.ref, .{ .name = "TCPSocketPrototype__ref" });
+ @export(TCPSocket.reload, .{ .name = "TCPSocketPrototype__reload" });
+ @export(TCPSocket.setData, .{ .name = "TCPSocketPrototype__setData" });
+ @export(TCPSocket.shutdown, .{ .name = "TCPSocketPrototype__shutdown" });
+ @export(TCPSocket.timeout, .{ .name = "TCPSocketPrototype__timeout" });
+ @export(TCPSocket.unref, .{ .name = "TCPSocketPrototype__unref" });
+ @export(TCPSocket.write, .{ .name = "TCPSocketPrototype__write" });
}
}
};
pub const JSTLSSocket = struct {
const TLSSocket = Classes.TLSSocket;
- const GetterType = fn(*TLSSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*TLSSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*TLSSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*TLSSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*TLSSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*TLSSocket, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*TLSSocket, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*TLSSocket, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*TLSSocket, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*TLSSocket, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -4202,50 +3465,48 @@ pub const JSTLSSocket = struct {
extern fn TLSSocketPrototype__dataSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn TLSSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `TLSSocket.data` setter
- /// This value will be visited by the garbage collector.
- pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- TLSSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn TLSSocketPrototype__dataGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `TLSSocket.data` setter
+ /// This value will be visited by the garbage collector.
+ pub fn dataSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ TLSSocketPrototype__dataSetCachedValue(thisValue, globalObject, value);
+ }
- /// `TLSSocket.data` getter
- /// This value will be visited by the garbage collector.
- pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = TLSSocketPrototype__dataGetCachedValue(thisValue);
- if (result == .zero)
+ /// `TLSSocket.data` getter
+ /// This value will be visited by the garbage collector.
+ pub fn dataGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = TLSSocketPrototype__dataGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
-extern fn TLSSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
+ return result;
+ }
- extern fn TLSSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `TLSSocket.remoteAddress` setter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- TLSSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn TLSSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- /// `TLSSocket.remoteAddress` getter
- /// This value will be visited by the garbage collector.
- pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = TLSSocketPrototype__remoteAddressGetCachedValue(thisValue);
- if (result == .zero)
+ extern fn TLSSocketPrototype__remoteAddressGetCachedValue(JSC.JSValue) JSC.JSValue;
+
+ /// `TLSSocket.remoteAddress` setter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ TLSSocketPrototype__remoteAddressSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `TLSSocket.remoteAddress` getter
+ /// This value will be visited by the garbage collector.
+ pub fn remoteAddressGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = TLSSocketPrototype__remoteAddressGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Create a new instance of TLSSocket
pub fn toJS(this: *TLSSocket, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -4260,14 +3521,14 @@ extern fn TLSSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGl
/// Modify the internal ptr to point to a new instance of TLSSocket.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*TLSSocket) bool {
- JSC.markBinding(@src());
- return TLSSocket__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return TLSSocket__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *TLSSocket, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(TLSSocket__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(TLSSocket__dangerouslySetPtr(value, null));
}
extern fn TLSSocket__fromJS(JSC.JSValue) ?*TLSSocket;
@@ -4278,110 +3539,77 @@ extern fn TLSSocketPrototype__remoteAddressSetCachedValue(JSC.JSValue, *JSC.JSGl
extern fn TLSSocket__dangerouslySetPtr(JSC.JSValue, ?*TLSSocket) bool;
comptime {
-
- if (@TypeOf(TLSSocket.finalize) != (fn(*TLSSocket) callconv(.C) void)) {
- @compileLog("TLSSocket.finalize is not a finalizer");
- }
-
- if (@TypeOf(TLSSocket.getAuthorized) != GetterType)
- @compileLog(
- "Expected TLSSocket.getAuthorized to be a getter"
- );
-
- if (@TypeOf(TLSSocket.getData) != GetterType)
- @compileLog(
- "Expected TLSSocket.getData to be a getter"
- );
-
- if (@TypeOf(TLSSocket.setData) != SetterType)
- @compileLog(
- "Expected TLSSocket.setData to be a setter"
- );
- if (@TypeOf(TLSSocket.end) != CallbackType)
- @compileLog(
- "Expected TLSSocket.end to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.end))
- );
- if (@TypeOf(TLSSocket.flush) != CallbackType)
- @compileLog(
- "Expected TLSSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.flush))
- );
- if (@TypeOf(TLSSocket.getAuthorizationError) != CallbackType)
- @compileLog(
- "Expected TLSSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getAuthorizationError))
- );
- if (@TypeOf(TLSSocket.getListener) != GetterType)
- @compileLog(
- "Expected TLSSocket.getListener to be a getter"
- );
-
- if (@TypeOf(TLSSocket.getLocalPort) != GetterType)
- @compileLog(
- "Expected TLSSocket.getLocalPort to be a getter"
- );
-
- if (@TypeOf(TLSSocket.getReadyState) != GetterType)
- @compileLog(
- "Expected TLSSocket.getReadyState to be a getter"
- );
-
- if (@TypeOf(TLSSocket.ref) != CallbackType)
- @compileLog(
- "Expected TLSSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.ref))
- );
- if (@TypeOf(TLSSocket.reload) != CallbackType)
- @compileLog(
- "Expected TLSSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.reload))
- );
- if (@TypeOf(TLSSocket.getRemoteAddress) != GetterType)
- @compileLog(
- "Expected TLSSocket.getRemoteAddress to be a getter"
- );
-
- if (@TypeOf(TLSSocket.shutdown) != CallbackType)
- @compileLog(
- "Expected TLSSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.shutdown))
- );
- if (@TypeOf(TLSSocket.timeout) != CallbackType)
- @compileLog(
- "Expected TLSSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.timeout))
- );
- if (@TypeOf(TLSSocket.unref) != CallbackType)
- @compileLog(
- "Expected TLSSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.unref))
- );
- if (@TypeOf(TLSSocket.write) != CallbackType)
- @compileLog(
- "Expected TLSSocket.write to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.write))
- );
+ if (@TypeOf(TLSSocket.finalize) != (fn (*TLSSocket) callconv(.C) void)) {
+ @compileLog("TLSSocket.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(TLSSocket.getAuthorized) != GetterType)
+ @compileLog("Expected TLSSocket.getAuthorized to be a getter");
+
+ if (@TypeOf(TLSSocket.getData) != GetterType)
+ @compileLog("Expected TLSSocket.getData to be a getter");
+
+ if (@TypeOf(TLSSocket.setData) != SetterType)
+ @compileLog("Expected TLSSocket.setData to be a setter");
+ if (@TypeOf(TLSSocket.end) != CallbackType)
+ @compileLog("Expected TLSSocket.end to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.end)));
+ if (@TypeOf(TLSSocket.flush) != CallbackType)
+ @compileLog("Expected TLSSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.flush)));
+ if (@TypeOf(TLSSocket.getAuthorizationError) != CallbackType)
+ @compileLog("Expected TLSSocket.getAuthorizationError to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.getAuthorizationError)));
+ if (@TypeOf(TLSSocket.getListener) != GetterType)
+ @compileLog("Expected TLSSocket.getListener to be a getter");
+
+ if (@TypeOf(TLSSocket.getLocalPort) != GetterType)
+ @compileLog("Expected TLSSocket.getLocalPort to be a getter");
+
+ if (@TypeOf(TLSSocket.getReadyState) != GetterType)
+ @compileLog("Expected TLSSocket.getReadyState to be a getter");
+
+ if (@TypeOf(TLSSocket.ref) != CallbackType)
+ @compileLog("Expected TLSSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.ref)));
+ if (@TypeOf(TLSSocket.reload) != CallbackType)
+ @compileLog("Expected TLSSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.reload)));
+ if (@TypeOf(TLSSocket.getRemoteAddress) != GetterType)
+ @compileLog("Expected TLSSocket.getRemoteAddress to be a getter");
+
+ if (@TypeOf(TLSSocket.shutdown) != CallbackType)
+ @compileLog("Expected TLSSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.shutdown)));
+ if (@TypeOf(TLSSocket.timeout) != CallbackType)
+ @compileLog("Expected TLSSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.timeout)));
+ if (@TypeOf(TLSSocket.unref) != CallbackType)
+ @compileLog("Expected TLSSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.unref)));
+ if (@TypeOf(TLSSocket.write) != CallbackType)
+ @compileLog("Expected TLSSocket.write to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.write)));
if (!JSC.is_bindgen) {
-@export(TLSSocket.end, .{.name = "TLSSocketPrototype__end"});
- @export(TLSSocket.finalize, .{.name = "TLSSocketClass__finalize"});
- @export(TLSSocket.flush, .{.name = "TLSSocketPrototype__flush"});
- @export(TLSSocket.getAuthorizationError, .{.name = "TLSSocketPrototype__getAuthorizationError"});
- @export(TLSSocket.getAuthorized, .{.name = "TLSSocketPrototype__getAuthorized"});
- @export(TLSSocket.getData, .{.name = "TLSSocketPrototype__getData"});
- @export(TLSSocket.getListener, .{.name = "TLSSocketPrototype__getListener"});
- @export(TLSSocket.getLocalPort, .{.name = "TLSSocketPrototype__getLocalPort"});
- @export(TLSSocket.getReadyState, .{.name = "TLSSocketPrototype__getReadyState"});
- @export(TLSSocket.getRemoteAddress, .{.name = "TLSSocketPrototype__getRemoteAddress"});
- @export(TLSSocket.hasPendingActivity, .{.name = "TLSSocket__hasPendingActivity"});
- @export(TLSSocket.ref, .{.name = "TLSSocketPrototype__ref"});
- @export(TLSSocket.reload, .{.name = "TLSSocketPrototype__reload"});
- @export(TLSSocket.setData, .{.name = "TLSSocketPrototype__setData"});
- @export(TLSSocket.shutdown, .{.name = "TLSSocketPrototype__shutdown"});
- @export(TLSSocket.timeout, .{.name = "TLSSocketPrototype__timeout"});
- @export(TLSSocket.unref, .{.name = "TLSSocketPrototype__unref"});
- @export(TLSSocket.write, .{.name = "TLSSocketPrototype__write"});
+ @export(TLSSocket.end, .{ .name = "TLSSocketPrototype__end" });
+ @export(TLSSocket.finalize, .{ .name = "TLSSocketClass__finalize" });
+ @export(TLSSocket.flush, .{ .name = "TLSSocketPrototype__flush" });
+ @export(TLSSocket.getAuthorizationError, .{ .name = "TLSSocketPrototype__getAuthorizationError" });
+ @export(TLSSocket.getAuthorized, .{ .name = "TLSSocketPrototype__getAuthorized" });
+ @export(TLSSocket.getData, .{ .name = "TLSSocketPrototype__getData" });
+ @export(TLSSocket.getListener, .{ .name = "TLSSocketPrototype__getListener" });
+ @export(TLSSocket.getLocalPort, .{ .name = "TLSSocketPrototype__getLocalPort" });
+ @export(TLSSocket.getReadyState, .{ .name = "TLSSocketPrototype__getReadyState" });
+ @export(TLSSocket.getRemoteAddress, .{ .name = "TLSSocketPrototype__getRemoteAddress" });
+ @export(TLSSocket.hasPendingActivity, .{ .name = "TLSSocket__hasPendingActivity" });
+ @export(TLSSocket.ref, .{ .name = "TLSSocketPrototype__ref" });
+ @export(TLSSocket.reload, .{ .name = "TLSSocketPrototype__reload" });
+ @export(TLSSocket.setData, .{ .name = "TLSSocketPrototype__setData" });
+ @export(TLSSocket.shutdown, .{ .name = "TLSSocketPrototype__shutdown" });
+ @export(TLSSocket.timeout, .{ .name = "TLSSocketPrototype__timeout" });
+ @export(TLSSocket.unref, .{ .name = "TLSSocketPrototype__unref" });
+ @export(TLSSocket.write, .{ .name = "TLSSocketPrototype__write" });
}
}
};
pub const JSTextDecoder = struct {
const TextDecoder = Classes.TextDecoder;
- const GetterType = fn(*TextDecoder, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*TextDecoder, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*TextDecoder, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*TextDecoder, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*TextDecoder, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*TextDecoder, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*TextDecoder, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*TextDecoder, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*TextDecoder, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*TextDecoder, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -4392,35 +3620,33 @@ pub const JSTextDecoder = struct {
extern fn TextDecoderPrototype__encodingSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
- extern fn TextDecoderPrototype__encodingGetCachedValue(JSC.JSValue) JSC.JSValue;
-
- /// `TextDecoder.encoding` setter
- /// This value will be visited by the garbage collector.
- pub fn encodingSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- TextDecoderPrototype__encodingSetCachedValue(thisValue, globalObject, value);
- }
+ extern fn TextDecoderPrototype__encodingGetCachedValue(JSC.JSValue) JSC.JSValue;
- /// `TextDecoder.encoding` getter
- /// This value will be visited by the garbage collector.
- pub fn encodingGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
- JSC.markBinding(@src());
- const result = TextDecoderPrototype__encodingGetCachedValue(thisValue);
- if (result == .zero)
+ /// `TextDecoder.encoding` setter
+ /// This value will be visited by the garbage collector.
+ pub fn encodingSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ TextDecoderPrototype__encodingSetCachedValue(thisValue, globalObject, value);
+ }
+
+ /// `TextDecoder.encoding` getter
+ /// This value will be visited by the garbage collector.
+ pub fn encodingGetCached(thisValue: JSC.JSValue) ?JSC.JSValue {
+ JSC.markBinding(@src());
+ const result = TextDecoderPrototype__encodingGetCachedValue(thisValue);
+ if (result == .zero)
return null;
-
- return result;
- }
+ return result;
+ }
-
/// Get the TextDecoder constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return TextDecoder__getConstructor(globalObject);
}
-
+
/// Create a new instance of TextDecoder
pub fn toJS(this: *TextDecoder, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -4435,14 +3661,14 @@ pub const JSTextDecoder = struct {
/// Modify the internal ptr to point to a new instance of TextDecoder.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*TextDecoder) bool {
- JSC.markBinding(@src());
- return TextDecoder__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return TextDecoder__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *TextDecoder, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(TextDecoder__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(TextDecoder__dangerouslySetPtr(value, null));
}
extern fn TextDecoder__fromJS(JSC.JSValue) ?*TextDecoder;
@@ -4453,50 +3679,41 @@ pub const JSTextDecoder = struct {
extern fn TextDecoder__dangerouslySetPtr(JSC.JSValue, ?*TextDecoder) bool;
comptime {
-
- if (@TypeOf(TextDecoder.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*TextDecoder)) {
- @compileLog("TextDecoder.constructor is not a constructor");
+ if (@TypeOf(TextDecoder.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*TextDecoder)) {
+ @compileLog("TextDecoder.constructor is not a constructor");
}
-
- if (@TypeOf(TextDecoder.finalize) != (fn(*TextDecoder) callconv(.C) void)) {
- @compileLog("TextDecoder.finalize is not a finalizer");
+
+ if (@TypeOf(TextDecoder.finalize) != (fn (*TextDecoder) callconv(.C) void)) {
+ @compileLog("TextDecoder.finalize is not a finalizer");
}
-
- if (@TypeOf(TextDecoder.decodeWithoutTypeChecks) != fn (*TextDecoder, *JSC.JSGlobalObject, *JSC.JSUint8Array) callconv(.C) JSC.JSValue)
- @compileLog(
- "Expected TextDecoder.decodeWithoutTypeChecks to be a DOMJIT function"
- );
- if (@TypeOf(TextDecoder.decode) != CallbackType)
- @compileLog(
- "Expected TextDecoder.decode to be a callback but received " ++ @typeName(@TypeOf(TextDecoder.decode))
- );
- if (@TypeOf(TextDecoder.getEncoding) != GetterType)
- @compileLog(
- "Expected TextDecoder.getEncoding to be a getter"
- );
-
- if (@TypeOf(TextDecoder.getFatal) != GetterType)
- @compileLog(
- "Expected TextDecoder.getFatal to be a getter"
- );
+
+ if (@TypeOf(TextDecoder.decodeWithoutTypeChecks) != fn (*TextDecoder, *JSC.JSGlobalObject, *JSC.JSUint8Array) callconv(.C) JSC.JSValue)
+ @compileLog("Expected TextDecoder.decodeWithoutTypeChecks to be a DOMJIT function");
+ if (@TypeOf(TextDecoder.decode) != CallbackType)
+ @compileLog("Expected TextDecoder.decode to be a callback but received " ++ @typeName(@TypeOf(TextDecoder.decode)));
+ if (@TypeOf(TextDecoder.getEncoding) != GetterType)
+ @compileLog("Expected TextDecoder.getEncoding to be a getter");
+
+ if (@TypeOf(TextDecoder.getFatal) != GetterType)
+ @compileLog("Expected TextDecoder.getFatal to be a getter");
if (!JSC.is_bindgen) {
-@export(TextDecoder.constructor, .{.name = "TextDecoderClass__construct"});
- @export(TextDecoder.decode, .{.name = "TextDecoderPrototype__decode"});
- @export(TextDecoder.decodeWithoutTypeChecks, .{.name = "TextDecoderPrototype__decodeWithoutTypeChecks"});
- @export(TextDecoder.finalize, .{.name = "TextDecoderClass__finalize"});
- @export(TextDecoder.getEncoding, .{.name = "TextDecoderPrototype__getEncoding"});
- @export(TextDecoder.getFatal, .{.name = "TextDecoderPrototype__getFatal"});
+ @export(TextDecoder.constructor, .{ .name = "TextDecoderClass__construct" });
+ @export(TextDecoder.decode, .{ .name = "TextDecoderPrototype__decode" });
+ @export(TextDecoder.decodeWithoutTypeChecks, .{ .name = "TextDecoderPrototype__decodeWithoutTypeChecks" });
+ @export(TextDecoder.finalize, .{ .name = "TextDecoderClass__finalize" });
+ @export(TextDecoder.getEncoding, .{ .name = "TextDecoderPrototype__getEncoding" });
+ @export(TextDecoder.getFatal, .{ .name = "TextDecoderPrototype__getFatal" });
}
}
};
pub const JSTimeout = struct {
const Timeout = Classes.Timeout;
- const GetterType = fn(*Timeout, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Timeout, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Timeout, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Timeout, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Timeout, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Timeout, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Timeout, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Timeout, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Timeout, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Timeout, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -4505,9 +3722,6 @@ pub const JSTimeout = struct {
return Timeout__fromJS(value);
}
-
-
-
/// Create a new instance of Timeout
pub fn toJS(this: *Timeout, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -4522,14 +3736,14 @@ pub const JSTimeout = struct {
/// Modify the internal ptr to point to a new instance of Timeout.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Timeout) bool {
- JSC.markBinding(@src());
- return Timeout__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Timeout__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Timeout, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Timeout__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Timeout__dangerouslySetPtr(value, null));
}
extern fn Timeout__fromJS(JSC.JSValue) ?*Timeout;
@@ -4540,43 +3754,34 @@ pub const JSTimeout = struct {
extern fn Timeout__dangerouslySetPtr(JSC.JSValue, ?*Timeout) bool;
comptime {
-
- if (@TypeOf(Timeout.finalize) != (fn(*Timeout) callconv(.C) void)) {
- @compileLog("Timeout.finalize is not a finalizer");
- }
-
- if (@TypeOf(Timeout.toPrimitive) != CallbackType)
- @compileLog(
- "Expected Timeout.toPrimitive to be a callback but received " ++ @typeName(@TypeOf(Timeout.toPrimitive))
- );
- if (@TypeOf(Timeout.hasRef) != CallbackType)
- @compileLog(
- "Expected Timeout.hasRef to be a callback but received " ++ @typeName(@TypeOf(Timeout.hasRef))
- );
- if (@TypeOf(Timeout.doRef) != CallbackType)
- @compileLog(
- "Expected Timeout.doRef to be a callback but received " ++ @typeName(@TypeOf(Timeout.doRef))
- );
- if (@TypeOf(Timeout.doUnref) != CallbackType)
- @compileLog(
- "Expected Timeout.doUnref to be a callback but received " ++ @typeName(@TypeOf(Timeout.doUnref))
- );
+ if (@TypeOf(Timeout.finalize) != (fn (*Timeout) callconv(.C) void)) {
+ @compileLog("Timeout.finalize is not a finalizer");
+ }
+
+ if (@TypeOf(Timeout.toPrimitive) != CallbackType)
+ @compileLog("Expected Timeout.toPrimitive to be a callback but received " ++ @typeName(@TypeOf(Timeout.toPrimitive)));
+ if (@TypeOf(Timeout.hasRef) != CallbackType)
+ @compileLog("Expected Timeout.hasRef to be a callback but received " ++ @typeName(@TypeOf(Timeout.hasRef)));
+ if (@TypeOf(Timeout.doRef) != CallbackType)
+ @compileLog("Expected Timeout.doRef to be a callback but received " ++ @typeName(@TypeOf(Timeout.doRef)));
+ if (@TypeOf(Timeout.doUnref) != CallbackType)
+ @compileLog("Expected Timeout.doUnref to be a callback but received " ++ @typeName(@TypeOf(Timeout.doUnref)));
if (!JSC.is_bindgen) {
-@export(Timeout.doRef, .{.name = "TimeoutPrototype__doRef"});
- @export(Timeout.doUnref, .{.name = "TimeoutPrototype__doUnref"});
- @export(Timeout.finalize, .{.name = "TimeoutClass__finalize"});
- @export(Timeout.hasRef, .{.name = "TimeoutPrototype__hasRef"});
- @export(Timeout.toPrimitive, .{.name = "TimeoutPrototype__toPrimitive"});
+ @export(Timeout.doRef, .{ .name = "TimeoutPrototype__doRef" });
+ @export(Timeout.doUnref, .{ .name = "TimeoutPrototype__doUnref" });
+ @export(Timeout.finalize, .{ .name = "TimeoutClass__finalize" });
+ @export(Timeout.hasRef, .{ .name = "TimeoutPrototype__hasRef" });
+ @export(Timeout.toPrimitive, .{ .name = "TimeoutPrototype__toPrimitive" });
}
}
};
pub const JSTranspiler = struct {
const Transpiler = Classes.Transpiler;
- const GetterType = fn(*Transpiler, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const GetterTypeWithThisValue = fn(*Transpiler, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
- const SetterType = fn(*Transpiler, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const SetterTypeWithThisValue = fn(*Transpiler, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
- const CallbackType = fn(*Transpiler, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
+ const GetterType = fn (*Transpiler, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const GetterTypeWithThisValue = fn (*Transpiler, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue;
+ const SetterType = fn (*Transpiler, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const SetterTypeWithThisValue = fn (*Transpiler, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool;
+ const CallbackType = fn (*Transpiler, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue;
/// Return the pointer to the wrapped object.
/// If the object does not match the type, return null.
@@ -4585,16 +3790,13 @@ pub const JSTranspiler = struct {
return Transpiler__fromJS(value);
}
-
-
-
/// Get the Transpiler constructor value.
/// This loads lazily from the global object.
pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return Transpiler__getConstructor(globalObject);
}
-
+
/// Create a new instance of Transpiler
pub fn toJS(this: *Transpiler, globalObject: *JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
@@ -4609,14 +3811,14 @@ pub const JSTranspiler = struct {
/// Modify the internal ptr to point to a new instance of Transpiler.
pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Transpiler) bool {
- JSC.markBinding(@src());
- return Transpiler__dangerouslySetPtr(value, ptr);
+ JSC.markBinding(@src());
+ return Transpiler__dangerouslySetPtr(value, ptr);
}
/// Detach the ptr from the thisValue
pub fn detachPtr(_: *Transpiler, value: JSC.JSValue) void {
- JSC.markBinding(@src());
- std.debug.assert(Transpiler__dangerouslySetPtr(value, null));
+ JSC.markBinding(@src());
+ std.debug.assert(Transpiler__dangerouslySetPtr(value, null));
}
extern fn Transpiler__fromJS(JSC.JSValue) ?*Transpiler;
@@ -4627,70 +3829,59 @@ pub const JSTranspiler = struct {
extern fn Transpiler__dangerouslySetPtr(JSC.JSValue, ?*Transpiler) bool;
comptime {
-
- if (@TypeOf(Transpiler.constructor) != (fn(*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Transpiler)) {
- @compileLog("Transpiler.constructor is not a constructor");
+ if (@TypeOf(Transpiler.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Transpiler)) {
+ @compileLog("Transpiler.constructor is not a constructor");
}
-
- if (@TypeOf(Transpiler.finalize) != (fn(*Transpiler) callconv(.C) void)) {
- @compileLog("Transpiler.finalize is not a finalizer");
+
+ if (@TypeOf(Transpiler.finalize) != (fn (*Transpiler) callconv(.C) void)) {
+ @compileLog("Transpiler.finalize is not a finalizer");
}
-
- if (@TypeOf(Transpiler.scan) != CallbackType)
- @compileLog(
- "Expected Transpiler.scan to be a callback but received " ++ @typeName(@TypeOf(Transpiler.scan))
- );
- if (@TypeOf(Transpiler.scanImports) != CallbackType)
- @compileLog(
- "Expected Transpiler.scanImports to be a callback but received " ++ @typeName(@TypeOf(Transpiler.scanImports))
- );
- if (@TypeOf(Transpiler.transform) != CallbackType)
- @compileLog(
- "Expected Transpiler.transform to be a callback but received " ++ @typeName(@TypeOf(Transpiler.transform))
- );
- if (@TypeOf(Transpiler.transformSync) != CallbackType)
- @compileLog(
- "Expected Transpiler.transformSync to be a callback but received " ++ @typeName(@TypeOf(Transpiler.transformSync))
- );
+
+ if (@TypeOf(Transpiler.scan) != CallbackType)
+ @compileLog("Expected Transpiler.scan to be a callback but received " ++ @typeName(@TypeOf(Transpiler.scan)));
+ if (@TypeOf(Transpiler.scanImports) != CallbackType)
+ @compileLog("Expected Transpiler.scanImports to be a callback but received " ++ @typeName(@TypeOf(Transpiler.scanImports)));
+ if (@TypeOf(Transpiler.transform) != CallbackType)
+ @compileLog("Expected Transpiler.transform to be a callback but received " ++ @typeName(@TypeOf(Transpiler.transform)));
+ if (@TypeOf(Transpiler.transformSync) != CallbackType)
+ @compileLog("Expected Transpiler.transformSync to be a callback but received " ++ @typeName(@TypeOf(Transpiler.transformSync)));
if (!JSC.is_bindgen) {
-@export(Transpiler.constructor, .{.name = "TranspilerClass__construct"});
- @export(Transpiler.finalize, .{.name = "TranspilerClass__finalize"});
- @export(Transpiler.scan, .{.name = "TranspilerPrototype__scan"});
- @export(Transpiler.scanImports, .{.name = "TranspilerPrototype__scanImports"});
- @export(Transpiler.transform, .{.name = "TranspilerPrototype__transform"});
- @export(Transpiler.transformSync, .{.name = "TranspilerPrototype__transformSync"});
+ @export(Transpiler.constructor, .{ .name = "TranspilerClass__construct" });
+ @export(Transpiler.finalize, .{ .name = "TranspilerClass__finalize" });
+ @export(Transpiler.scan, .{ .name = "TranspilerPrototype__scan" });
+ @export(Transpiler.scanImports, .{ .name = "TranspilerPrototype__scanImports" });
+ @export(Transpiler.transform, .{ .name = "TranspilerPrototype__transform" });
+ @export(Transpiler.transformSync, .{ .name = "TranspilerPrototype__transformSync" });
}
}
};
comptime {
- _ = JSBlob;
- _ = JSCryptoHasher;
- _ = JSDirent;
- _ = JSExpect;
- _ = JSExpectAny;
- _ = JSFileSystemRouter;
- _ = JSListener;
- _ = JSMD4;
- _ = JSMD5;
- _ = JSMatchedRoute;
- _ = JSNodeJSFS;
- _ = JSRequest;
- _ = JSResponse;
- _ = JSSHA1;
- _ = JSSHA224;
- _ = JSSHA256;
- _ = JSSHA384;
- _ = JSSHA512;
- _ = JSSHA512_256;
- _ = JSServerWebSocket;
- _ = JSStats;
- _ = JSSubprocess;
- _ = JSTCPSocket;
- _ = JSTLSSocket;
- _ = JSTextDecoder;
- _ = JSTimeout;
- _ = JSTranspiler;
+ _ = JSBlob;
+ _ = JSCryptoHasher;
+ _ = JSDirent;
+ _ = JSExpect;
+ _ = JSExpectAny;
+ _ = JSFileSystemRouter;
+ _ = JSListener;
+ _ = JSMD4;
+ _ = JSMD5;
+ _ = JSMatchedRoute;
+ _ = JSNodeJSFS;
+ _ = JSRequest;
+ _ = JSResponse;
+ _ = JSSHA1;
+ _ = JSSHA224;
+ _ = JSSHA256;
+ _ = JSSHA384;
+ _ = JSSHA512;
+ _ = JSSHA512_256;
+ _ = JSServerWebSocket;
+ _ = JSStats;
+ _ = JSSubprocess;
+ _ = JSTCPSocket;
+ _ = JSTLSSocket;
+ _ = JSTextDecoder;
+ _ = JSTimeout;
+ _ = JSTranspiler;
}
-
- \ No newline at end of file
diff --git a/src/bun.js/bindings/generated_classes_list.zig b/src/bun.js/bindings/generated_classes_list.zig
index 267905086..d1d1c83cd 100644
--- a/src/bun.js/bindings/generated_classes_list.zig
+++ b/src/bun.js/bindings/generated_classes_list.zig
@@ -1,4 +1,4 @@
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub const Classes = struct {
pub const Blob = JSC.WebCore.Blob;
diff --git a/src/bun.js/bindings/header-gen.zig b/src/bun.js/bindings/header-gen.zig
index cb1629de7..65ee15786 100644
--- a/src/bun.js/bindings/header-gen.zig
+++ b/src/bun.js/bindings/header-gen.zig
@@ -8,7 +8,7 @@ const UnionMeta = std.builtin.Type.Union;
const warn = std.debug.warn;
const StaticExport = @import("./static_export.zig");
const typeBaseName = @import("../../meta.zig").typeBaseName;
-const bun = @import("bun");
+const bun = @import("root").bun;
const TypeNameMap = bun.StringHashMap([]const u8);
fn isCppObject(comptime Type: type) bool {
diff --git a/src/bun.js/bindings/headers-replacements.zig b/src/bun.js/bindings/headers-replacements.zig
index f586bd028..b84a7b65a 100644
--- a/src/bun.js/bindings/headers-replacements.zig
+++ b/src/bun.js/bindings/headers-replacements.zig
@@ -1,4 +1,4 @@
-const bindings = @import("bun").JSC;
+const bindings = @import("root").bun.JSC;
pub const struct_JSC__CallFrame = bindings.CallFrame;
pub const struct_JSC__StringPrototype = bindings.StringPrototype;
pub const struct_JSC__SetIteratorPrototype = bindings.SetIteratorPrototype;
diff --git a/src/bun.js/bindings/headers.zig b/src/bun.js/bindings/headers.zig
index 11ccd2e53..a33799c1b 100644
--- a/src/bun.js/bindings/headers.zig
+++ b/src/bun.js/bindings/headers.zig
@@ -1,6 +1,6 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
-const bindings = @import("bun").JSC;
+const bindings = @import("root").bun.JSC;
pub const struct_JSC__CallFrame = bindings.CallFrame;
pub const struct_JSC__StringPrototype = bindings.StringPrototype;
pub const struct_JSC__SetIteratorPrototype = bindings.SetIteratorPrototype;
diff --git a/src/bun.js/config.zig b/src/bun.js/config.zig
index d7f167c8f..b3614854e 100644
--- a/src/bun.js/config.zig
+++ b/src/bun.js/config.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -14,7 +14,7 @@ const Fs = @import("../fs.zig");
const resolver = @import("../resolver/resolver.zig");
const ast = @import("../import_record.zig");
const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../api/schema.zig").Api;
const options = @import("../options.zig");
const Bundler = bun.bundler.ServeBundler;
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index cf0b046ec..83f36922a 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -1,10 +1,10 @@
const std = @import("std");
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const JSGlobalObject = JSC.JSGlobalObject;
const VirtualMachine = JSC.VirtualMachine;
const Lock = @import("../lock.zig").Lock;
const Microtask = JSC.Microtask;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = bun.Environment;
const Fetch = JSC.WebCore.Fetch;
const WebCore = JSC.WebCore;
@@ -21,8 +21,8 @@ const JSValue = JSC.JSValue;
const js = JSC.C;
pub const WorkPool = @import("../work_pool.zig").WorkPool;
pub const WorkPoolTask = @import("../work_pool.zig").Task;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
-const uws = @import("bun").uws;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
+const uws = @import("root").bun.uws;
pub fn ConcurrentPromiseTask(comptime Context: type) type {
return struct {
@@ -258,7 +258,7 @@ pub const ConcurrentTask = struct {
}
};
-const AsyncIO = @import("bun").AsyncIO;
+const AsyncIO = @import("root").bun.AsyncIO;
// This type must be unique per JavaScript thread
pub const GarbageCollectionController = struct {
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index 3616e174d..a0fd52546 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false;
const StaticExport = @import("./bindings/static_export.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,8 +13,8 @@ const default_allocator = bun.default_allocator;
const StoredFileDescriptorType = bun.StoredFileDescriptorType;
const Arena = @import("../mimalloc_arena.zig").Arena;
const C = bun.C;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
-const IO = @import("bun").AsyncIO;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
+const IO = @import("root").bun.AsyncIO;
const Allocator = std.mem.Allocator;
const IdentityContext = @import("../identity_context.zig").IdentityContext;
const Fs = @import("../fs.zig");
@@ -23,7 +23,7 @@ const ast = @import("../import_record.zig");
const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle;
const MacroEntryPoint = bun.bundler.MacroEntryPoint;
const ParseResult = bun.bundler.ParseResult;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../api/schema.zig").Api;
const options = @import("../options.zig");
const Bundler = bun.Bundler;
@@ -36,46 +36,46 @@ const http = @import("../http.zig");
const NodeFallbackModules = @import("../node_fallbacks.zig");
const ImportKind = ast.ImportKind;
const Analytics = @import("../analytics/analytics_thread.zig");
-const ZigString = @import("bun").JSC.ZigString;
+const ZigString = @import("root").bun.JSC.ZigString;
const Runtime = @import("../runtime.zig");
const Router = @import("./api/filesystem_router.zig");
const ImportRecord = ast.ImportRecord;
const DotEnv = @import("../env_loader.zig");
const PackageJSON = @import("../resolver/package_json.zig").PackageJSON;
const MacroRemap = @import("../resolver/package_json.zig").MacroMap;
-const WebCore = @import("bun").JSC.WebCore;
+const WebCore = @import("root").bun.JSC.WebCore;
const Request = WebCore.Request;
const Response = WebCore.Response;
const Headers = WebCore.Headers;
const Fetch = WebCore.Fetch;
const FetchEvent = WebCore.FetchEvent;
-const js = @import("bun").JSC.C;
-const JSC = @import("bun").JSC;
+const js = @import("root").bun.JSC.C;
+const JSC = @import("root").bun.JSC;
const JSError = @import("./base.zig").JSError;
const d = @import("./base.zig").d;
const MarkedArrayBuffer = @import("./base.zig").MarkedArrayBuffer;
const getAllocator = @import("./base.zig").getAllocator;
-const JSValue = @import("bun").JSC.JSValue;
+const JSValue = @import("root").bun.JSC.JSValue;
const NewClass = @import("./base.zig").NewClass;
-const Microtask = @import("bun").JSC.Microtask;
-const JSGlobalObject = @import("bun").JSC.JSGlobalObject;
-const ExceptionValueRef = @import("bun").JSC.ExceptionValueRef;
-const JSPrivateDataPtr = @import("bun").JSC.JSPrivateDataPtr;
-const ZigConsoleClient = @import("bun").JSC.ZigConsoleClient;
-const Node = @import("bun").JSC.Node;
-const ZigException = @import("bun").JSC.ZigException;
-const ZigStackTrace = @import("bun").JSC.ZigStackTrace;
-const ErrorableResolvedSource = @import("bun").JSC.ErrorableResolvedSource;
-const ResolvedSource = @import("bun").JSC.ResolvedSource;
-const JSPromise = @import("bun").JSC.JSPromise;
-const JSInternalPromise = @import("bun").JSC.JSInternalPromise;
-const JSModuleLoader = @import("bun").JSC.JSModuleLoader;
-const JSPromiseRejectionOperation = @import("bun").JSC.JSPromiseRejectionOperation;
-const Exception = @import("bun").JSC.Exception;
-const ErrorableZigString = @import("bun").JSC.ErrorableZigString;
-const ZigGlobalObject = @import("bun").JSC.ZigGlobalObject;
-const VM = @import("bun").JSC.VM;
-const JSFunction = @import("bun").JSC.JSFunction;
+const Microtask = @import("root").bun.JSC.Microtask;
+const JSGlobalObject = @import("root").bun.JSC.JSGlobalObject;
+const ExceptionValueRef = @import("root").bun.JSC.ExceptionValueRef;
+const JSPrivateDataPtr = @import("root").bun.JSC.JSPrivateDataPtr;
+const ZigConsoleClient = @import("root").bun.JSC.ZigConsoleClient;
+const Node = @import("root").bun.JSC.Node;
+const ZigException = @import("root").bun.JSC.ZigException;
+const ZigStackTrace = @import("root").bun.JSC.ZigStackTrace;
+const ErrorableResolvedSource = @import("root").bun.JSC.ErrorableResolvedSource;
+const ResolvedSource = @import("root").bun.JSC.ResolvedSource;
+const JSPromise = @import("root").bun.JSC.JSPromise;
+const JSInternalPromise = @import("root").bun.JSC.JSInternalPromise;
+const JSModuleLoader = @import("root").bun.JSC.JSModuleLoader;
+const JSPromiseRejectionOperation = @import("root").bun.JSC.JSPromiseRejectionOperation;
+const Exception = @import("root").bun.JSC.Exception;
+const ErrorableZigString = @import("root").bun.JSC.ErrorableZigString;
+const ZigGlobalObject = @import("root").bun.JSC.ZigGlobalObject;
+const VM = @import("root").bun.JSC.VM;
+const JSFunction = @import("root").bun.JSC.JSFunction;
const Config = @import("./config.zig");
const URL = @import("../url.zig").URL;
const Bun = JSC.API.Bun;
@@ -241,7 +241,7 @@ pub const SavedSourceMap = struct {
return SourceMap.Mapping.find(mappings, line, column);
}
};
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
pub export fn Bun__getDefaultGlobal() *JSGlobalObject {
_ = @sizeOf(JSC.VirtualMachine) + 1;
diff --git a/src/bun.js/javascript_core_c_api.zig b/src/bun.js/javascript_core_c_api.zig
index f2b6d19a4..4dc1e0f6b 100644
--- a/src/bun.js/javascript_core_c_api.zig
+++ b/src/bun.js/javascript_core_c_api.zig
@@ -4,7 +4,7 @@
/// To generate a new class exposed to JavaScript, look at *.classes.ts
/// Otherwise, use `JSC.JSValue`.
/// ************************************
-const bun = @import("bun");
+const bun = @import("root").bun;
const std = @import("std");
const cpp = @import("./bindings/bindings.zig");
const generic = opaque {
@@ -12,7 +12,7 @@ const generic = opaque {
return @intToEnum(cpp.JSValue, @bitCast(cpp.JSValue.Type, @ptrToInt(this)));
}
- pub inline fn bunVM(this: *@This()) *@import("bun").JSC.VirtualMachine {
+ pub inline fn bunVM(this: *@This()) *@import("root").bun.JSC.VirtualMachine {
return this.ptr().bunVM();
}
};
@@ -180,13 +180,13 @@ pub extern fn JSValueToNumber(ctx: JSContextRef, value: JSValueRef, exception: E
pub extern fn JSValueToStringCopy(ctx: JSContextRef, value: JSValueRef, exception: ExceptionRef) JSStringRef;
pub extern fn JSValueToObject(ctx: JSContextRef, value: JSValueRef, exception: ExceptionRef) JSObjectRef;
-const log_protection = @import("bun").Environment.allow_assert and false;
+const log_protection = @import("root").bun.Environment.allow_assert and false;
pub inline fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef) void {
const Wrapped = struct {
pub extern fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef) void;
};
if (comptime log_protection) {
- const Output = @import("bun").Output;
+ const Output = @import("root").bun.Output;
Output.debug("[unprotect] {d}\n", .{@ptrToInt(value)});
}
// wrapper exists to make it easier to set a breakpoint
@@ -198,7 +198,7 @@ pub inline fn JSValueProtect(ctx: JSContextRef, value: JSValueRef) void {
pub extern fn JSValueProtect(ctx: JSContextRef, value: JSValueRef) void;
};
if (comptime log_protection) {
- const Output = @import("bun").Output;
+ const Output = @import("root").bun.Output;
Output.debug("[protect] {d}\n", .{@ptrToInt(value)});
}
// wrapper exists to make it easier to set a breakpoint
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index e89cd21eb..ee1f392c5 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false;
const StaticExport = @import("./bindings/static_export.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,8 +13,8 @@ const default_allocator = bun.default_allocator;
const StoredFileDescriptorType = bun.StoredFileDescriptorType;
const Arena = @import("../mimalloc_arena.zig").Arena;
const C = bun.C;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
-const IO = @import("bun").AsyncIO;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
+const IO = @import("root").bun.AsyncIO;
const Allocator = std.mem.Allocator;
const IdentityContext = @import("../identity_context.zig").IdentityContext;
const Fs = @import("../fs.zig");
@@ -23,7 +23,7 @@ const ast = @import("../import_record.zig");
const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle;
const MacroEntryPoint = bun.bundler.MacroEntryPoint;
const ParseResult = bun.bundler.ParseResult;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Api = @import("../api/schema.zig").Api;
const options = @import("../options.zig");
const Bundler = bun.Bundler;
@@ -36,46 +36,46 @@ const http = @import("../http.zig");
const NodeFallbackModules = @import("../node_fallbacks.zig");
const ImportKind = ast.ImportKind;
const Analytics = @import("../analytics/analytics_thread.zig");
-const ZigString = @import("bun").JSC.ZigString;
+const ZigString = @import("root").bun.JSC.ZigString;
const Runtime = @import("../runtime.zig");
const Router = @import("./api/filesystem_router.zig");
const ImportRecord = ast.ImportRecord;
const DotEnv = @import("../env_loader.zig");
const PackageJSON = @import("../resolver/package_json.zig").PackageJSON;
const MacroRemap = @import("../resolver/package_json.zig").MacroMap;
-const WebCore = @import("bun").JSC.WebCore;
+const WebCore = @import("root").bun.JSC.WebCore;
const Request = WebCore.Request;
const Response = WebCore.Response;
const Headers = WebCore.Headers;
const Fetch = WebCore.Fetch;
const FetchEvent = WebCore.FetchEvent;
-const js = @import("bun").JSC.C;
-const JSC = @import("bun").JSC;
+const js = @import("root").bun.JSC.C;
+const JSC = @import("root").bun.JSC;
const JSError = @import("./base.zig").JSError;
const d = @import("./base.zig").d;
const MarkedArrayBuffer = @import("./base.zig").MarkedArrayBuffer;
const getAllocator = @import("./base.zig").getAllocator;
-const JSValue = @import("bun").JSC.JSValue;
+const JSValue = @import("root").bun.JSC.JSValue;
const NewClass = @import("./base.zig").NewClass;
-const Microtask = @import("bun").JSC.Microtask;
-const JSGlobalObject = @import("bun").JSC.JSGlobalObject;
-const ExceptionValueRef = @import("bun").JSC.ExceptionValueRef;
-const JSPrivateDataPtr = @import("bun").JSC.JSPrivateDataPtr;
-const ZigConsoleClient = @import("bun").JSC.ZigConsoleClient;
-const Node = @import("bun").JSC.Node;
-const ZigException = @import("bun").JSC.ZigException;
-const ZigStackTrace = @import("bun").JSC.ZigStackTrace;
-const ErrorableResolvedSource = @import("bun").JSC.ErrorableResolvedSource;
-const ResolvedSource = @import("bun").JSC.ResolvedSource;
-const JSPromise = @import("bun").JSC.JSPromise;
-const JSInternalPromise = @import("bun").JSC.JSInternalPromise;
-const JSModuleLoader = @import("bun").JSC.JSModuleLoader;
-const JSPromiseRejectionOperation = @import("bun").JSC.JSPromiseRejectionOperation;
-const Exception = @import("bun").JSC.Exception;
-const ErrorableZigString = @import("bun").JSC.ErrorableZigString;
-const ZigGlobalObject = @import("bun").JSC.ZigGlobalObject;
-const VM = @import("bun").JSC.VM;
-const JSFunction = @import("bun").JSC.JSFunction;
+const Microtask = @import("root").bun.JSC.Microtask;
+const JSGlobalObject = @import("root").bun.JSC.JSGlobalObject;
+const ExceptionValueRef = @import("root").bun.JSC.ExceptionValueRef;
+const JSPrivateDataPtr = @import("root").bun.JSC.JSPrivateDataPtr;
+const ZigConsoleClient = @import("root").bun.JSC.ZigConsoleClient;
+const Node = @import("root").bun.JSC.Node;
+const ZigException = @import("root").bun.JSC.ZigException;
+const ZigStackTrace = @import("root").bun.JSC.ZigStackTrace;
+const ErrorableResolvedSource = @import("root").bun.JSC.ErrorableResolvedSource;
+const ResolvedSource = @import("root").bun.JSC.ResolvedSource;
+const JSPromise = @import("root").bun.JSC.JSPromise;
+const JSInternalPromise = @import("root").bun.JSC.JSInternalPromise;
+const JSModuleLoader = @import("root").bun.JSC.JSModuleLoader;
+const JSPromiseRejectionOperation = @import("root").bun.JSC.JSPromiseRejectionOperation;
+const Exception = @import("root").bun.JSC.Exception;
+const ErrorableZigString = @import("root").bun.JSC.ErrorableZigString;
+const ZigGlobalObject = @import("root").bun.JSC.ZigGlobalObject;
+const VM = @import("root").bun.JSC.VM;
+const JSFunction = @import("root").bun.JSC.JSFunction;
const Config = @import("./config.zig");
const URL = @import("../url.zig").URL;
const Bun = JSC.API.Bun;
diff --git a/src/bun.js/node/buffer.zig b/src/bun.js/node/buffer.zig
index f3cc3c2c2..f73498069 100644
--- a/src/bun.js/node/buffer.zig
+++ b/src/bun.js/node/buffer.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const JSC = bun.JSC;
const Encoder = JSC.WebCore.Encoder;
diff --git a/src/bun.js/node/dir_iterator.zig b/src/bun.js/node/dir_iterator.zig
index 7db7facc7..f1063621e 100644
--- a/src/bun.js/node/dir_iterator.zig
+++ b/src/bun.js/node/dir_iterator.zig
@@ -9,12 +9,12 @@ const std = @import("std");
const os = std.os;
const Dir = std.fs.Dir;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const PathString = JSC.PathString;
const IteratorError = error{ AccessDenied, SystemResources } || os.UnexpectedError;
const mem = std.mem;
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const Maybe = JSC.Maybe;
const File = std.fs.File;
const Result = Maybe(?Entry);
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig
index 845992ecc..93bcfc090 100644
--- a/src/bun.js/node/node_fs.zig
+++ b/src/bun.js/node/node_fs.zig
@@ -2,11 +2,11 @@
// for interacting with the filesystem from JavaScript.
// The top-level functions assume the arguments are already validated
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const strings = bun.strings;
const string = bun.string;
-const AsyncIO = @import("bun").AsyncIO;
-const JSC = @import("bun").JSC;
+const AsyncIO = @import("root").bun.AsyncIO;
+const JSC = @import("root").bun.JSC;
const PathString = JSC.PathString;
const Environment = bun.Environment;
const C = bun.C;
diff --git a/src/bun.js/node/node_fs_binding.zig b/src/bun.js/node/node_fs_binding.zig
index 61fd0f82b..0e0875a18 100644
--- a/src/bun.js/node/node_fs_binding.zig
+++ b/src/bun.js/node/node_fs_binding.zig
@@ -1,11 +1,11 @@
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const std = @import("std");
const Flavor = JSC.Node.Flavor;
const ArgumentsSlice = JSC.Node.ArgumentsSlice;
const system = std.os.system;
const Maybe = JSC.Maybe;
const Encoding = JSC.Node.Encoding;
-const FeatureFlags = @import("bun").FeatureFlags;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const Args = JSC.Node.NodeFS.Arguments;
const d = JSC.d;
diff --git a/src/bun.js/node/node_fs_constant.zig b/src/bun.js/node/node_fs_constant.zig
index fab775b48..378f332c6 100644
--- a/src/bun.js/node/node_fs_constant.zig
+++ b/src/bun.js/node/node_fs_constant.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = bun.Environment;
const std = @import("std");
diff --git a/src/bun.js/node/node_os.zig b/src/bun.js/node/node_os.zig
index 81770086d..226c8659b 100644
--- a/src/bun.js/node/node_os.zig
+++ b/src/bun.js/node/node_os.zig
@@ -1,10 +1,10 @@
const std = @import("std");
const builtin = @import("builtin");
-const bun = @import("bun");
+const bun = @import("root").bun;
const C = bun.C;
const string = bun.string;
const strings = bun.strings;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Environment = bun.Environment;
const Global = bun.Global;
const is_bindgen: bool = std.meta.globalOption("bindgen", bool) orelse false;
diff --git a/src/bun.js/node/os/constants.zig b/src/bun.js/node/os/constants.zig
index 2d441b793..a3508d383 100644
--- a/src/bun.js/node/os/constants.zig
+++ b/src/bun.js/node/os/constants.zig
@@ -1,8 +1,8 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Environment = bun.Environment;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const ConstantType = enum { ERRNO, ERRNO_WIN, SIG, DLOPEN, OTHER };
diff --git a/src/bun.js/node/syscall.zig b/src/bun.js/node/syscall.zig
index 087bb06dd..68a29a280 100644
--- a/src/bun.js/node/syscall.zig
+++ b/src/bun.js/node/syscall.zig
@@ -5,14 +5,14 @@ const os = std.os;
const builtin = @import("builtin");
const Syscall = @This();
-const Environment = @import("bun").Environment;
-const default_allocator = @import("bun").default_allocator;
-const JSC = @import("bun").JSC;
+const Environment = @import("root").bun.Environment;
+const default_allocator = @import("root").bun.default_allocator;
+const JSC = @import("root").bun.JSC;
const SystemError = JSC.SystemError;
-const bun = @import("bun");
+const bun = @import("root").bun;
const MAX_PATH_BYTES = bun.MAX_PATH_BYTES;
const fd_t = bun.FileDescriptor;
-const C = @import("bun").C;
+const C = @import("root").bun.C;
const linux = os.linux;
const Maybe = JSC.Maybe;
@@ -21,7 +21,7 @@ pub const syslog = log;
// On Linux AARCh64, zig is missing stat & lstat syscalls
const use_libc = (Environment.isLinux and Environment.isAarch64) or Environment.isMac;
-pub const system = if (Environment.isLinux) linux else @import("bun").AsyncIO.darwin;
+pub const system = if (Environment.isLinux) linux else @import("root").bun.AsyncIO.darwin;
pub const S = struct {
pub usingnamespace if (Environment.isLinux) linux.S else std.os.S;
};
@@ -108,7 +108,7 @@ pub const Tag = enum(u8) {
getaddrinfo,
pub var strings = std.EnumMap(Tag, JSC.C.JSStringRef).initFull(null);
};
-const PathString = @import("bun").PathString;
+const PathString = @import("root").bun.PathString;
const mode_t = os.mode_t;
diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig
index 2dcbad38f..dacb9540c 100644
--- a/src/bun.js/node/types.zig
+++ b/src/bun.js/node/types.zig
@@ -1,10 +1,10 @@
const std = @import("std");
const builtin = @import("builtin");
-const bun = @import("bun");
+const bun = @import("root").bun;
const strings = bun.strings;
const string = bun.string;
-const AsyncIO = @import("bun").AsyncIO;
-const JSC = @import("bun").JSC;
+const AsyncIO = @import("root").bun.AsyncIO;
+const JSC = @import("root").bun.JSC;
const PathString = JSC.PathString;
const Environment = bun.Environment;
const C = bun.C;
@@ -12,7 +12,7 @@ const Syscall = @import("./syscall.zig");
const os = std.os;
const Buffer = JSC.MarkedArrayBuffer;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Fs = @import("../../fs.zig");
const URL = @import("../../url.zig").URL;
const Shimmer = @import("../bindings/shimmer.zig").Shimmer;
diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig
index 238d44700..ddda96bf4 100644
--- a/src/bun.js/rare_data.zig
+++ b/src/bun.js/rare_data.zig
@@ -1,13 +1,13 @@
const EditorContext = @import("../open.zig").EditorContext;
const Blob = JSC.WebCore.Blob;
-const default_allocator = @import("bun").default_allocator;
-const Output = @import("bun").Output;
+const default_allocator = @import("root").bun.default_allocator;
+const Output = @import("root").bun.Output;
const RareData = @This();
const Syscall = @import("./node/syscall.zig");
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const std = @import("std");
-const BoringSSL = @import("bun").BoringSSL;
-const bun = @import("bun");
+const BoringSSL = @import("root").bun.BoringSSL;
+const bun = @import("root").bun;
const WebSocketClientMask = @import("../http/websocket_http_client.zig").Mask;
boring_ssl_engine: ?*BoringSSL.ENGINE = null,
diff --git a/src/bun.js/script_execution_context.zig b/src/bun.js/script_execution_context.zig
index 0f1bfb20b..50f531689 100644
--- a/src/bun.js/script_execution_context.zig
+++ b/src/bun.js/script_execution_context.zig
@@ -1,4 +1,4 @@
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub const ScriptExecutionContext = extern struct {
main_file_path: JSC.ZigString,
diff --git a/src/bun.js/scripts/generate-classes.ts b/src/bun.js/scripts/generate-classes.ts
index f13132f8f..8afde35c7 100644
--- a/src/bun.js/scripts/generate-classes.ts
+++ b/src/bun.js/scripts/generate-classes.ts
@@ -1600,7 +1600,7 @@ const ZIG_GENERATED_CLASSES_HEADER = `
/// - pub usingnamespace JSC.Codegen.JSMyClassName;
/// 5. make clean-bindings && make bindings -j10
///
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Classes = @import("./generated_classes_list.zig").Classes;
const Environment = @import("../../env.zig");
const std = @import("std");
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig
index 2c26600c4..04ae36aa9 100644
--- a/src/bun.js/test/jest.zig
+++ b/src/bun.js/test/jest.zig
@@ -1,31 +1,31 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const js_parser = bun.js_parser;
const js_ast = bun.JSAst;
const Api = @import("../../api/schema.zig").Api;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const Environment = @import("../../env.zig");
const DiffMatchPatch = @import("../../deps/diffz/DiffMatchPatch.zig");
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Method = @import("../../http/method.zig").Method;
const ObjectPool = @import("../../pool.zig").ObjectPool;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
diff --git a/src/bun.js/test/pretty_format.zig b/src/bun.js/test/pretty_format.zig
index dd5814aca..d33299113 100644
--- a/src/bun.js/test/pretty_format.zig
+++ b/src/bun.js/test/pretty_format.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const Output = bun.Output;
const JSC = bun.JSC;
const JSGlobalObject = JSC.JSGlobalObject;
diff --git a/src/bun.js/uuid.zig b/src/bun.js/uuid.zig
index f172c6225..e8bdff661 100644
--- a/src/bun.js/uuid.zig
+++ b/src/bun.js/uuid.zig
@@ -3,7 +3,7 @@ const std = @import("std");
const crypto = std.crypto;
const fmt = std.fmt;
const testing = std.testing;
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const Error = error{InvalidUUID};
const UUID = @This();
diff --git a/src/bun.js/webcore.zig b/src/bun.js/webcore.zig
index 4bb0bd2a5..e7357e4ca 100644
--- a/src/bun.js/webcore.zig
+++ b/src/bun.js/webcore.zig
@@ -5,9 +5,9 @@ pub usingnamespace @import("./webcore/blob.zig");
pub usingnamespace @import("./webcore/request.zig");
pub usingnamespace @import("./webcore/body.zig");
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
pub const AbortSignal = @import("./bindings/bindings.zig").AbortSignal;
@@ -366,7 +366,7 @@ pub const Prompt = struct {
pub const Crypto = struct {
const UUID = @import("./uuid.zig");
- const BoringSSL = @import("bun").BoringSSL;
+ const BoringSSL = @import("root").bun.BoringSSL;
pub const Class = JSC.NewClass(
void,
.{ .name = "crypto" },
diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig
index 030b77a2c..a3650755f 100644
--- a/src/bun.js/webcore/blob.zig
+++ b/src/bun.js/webcore/blob.zig
@@ -1,25 +1,25 @@
const std = @import("std");
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const AsyncIO = NetworkThread.AsyncIO;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
const FetchHeaders = JSC.FetchHeaders;
const ObjectPool = @import("../../pool.zig").ObjectPool;
const SystemError = JSC.SystemError;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -40,9 +40,9 @@ const NullableAllocator = @import("../../nullable_allocator.zig").NullableAlloca
const VirtualMachine = JSC.VirtualMachine;
const Task = JSC.Task;
const JSPrinter = bun.js_printer;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const StringJoiner = @import("../../string_joiner.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const null_fd = bun.invalid_fd;
const Response = JSC.WebCore.Response;
diff --git a/src/bun.js/webcore/body.zig b/src/bun.js/webcore/body.zig
index 13431e695..ae873fa88 100644
--- a/src/bun.js/webcore/body.zig
+++ b/src/bun.js/webcore/body.zig
@@ -1,25 +1,25 @@
const std = @import("std");
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const AsyncIO = NetworkThread.AsyncIO;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
const FetchHeaders = JSC.FetchHeaders;
const ObjectPool = @import("../../pool.zig").ObjectPool;
const SystemError = JSC.SystemError;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -40,9 +40,9 @@ const NullableAllocator = @import("../../nullable_allocator.zig").NullableAlloca
const VirtualMachine = JSC.VirtualMachine;
const Task = JSC.Task;
const JSPrinter = bun.js_printer;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const StringJoiner = @import("../../string_joiner.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const Blob = JSC.WebCore.Blob;
const InlineBlob = JSC.WebCore.InlineBlob;
diff --git a/src/bun.js/webcore/encoding.zig b/src/bun.js/webcore/encoding.zig
index 184f1c0e1..7b6dbe70b 100644
--- a/src/bun.js/webcore/encoding.zig
+++ b/src/bun.js/webcore/encoding.zig
@@ -3,22 +3,22 @@ const Api = @import("../../api/schema.zig").Api;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
const ObjectPool = @import("../../pool.zig").ObjectPool;
-const bun = @import("bun");
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const bun = @import("root").bun;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -38,7 +38,7 @@ const JSGlobalObject = JSC.JSGlobalObject;
const VirtualMachine = JSC.VirtualMachine;
const Task = @import("../javascript.zig").Task;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
pub const TextEncoder = struct {
filler: u32 = 0,
diff --git a/src/bun.js/webcore/request.zig b/src/bun.js/webcore/request.zig
index fe8fd9c9c..854f7ff43 100644
--- a/src/bun.js/webcore/request.zig
+++ b/src/bun.js/webcore/request.zig
@@ -1,13 +1,13 @@
const std = @import("std");
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const AsyncIO = NetworkThread.AsyncIO;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
@@ -15,12 +15,12 @@ const FetchHeaders = JSC.FetchHeaders;
const AbortSignal = JSC.WebCore.AbortSignal;
const ObjectPool = @import("../../pool.zig").ObjectPool;
const SystemError = JSC.SystemError;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -41,9 +41,9 @@ const NullableAllocator = @import("../../nullable_allocator.zig").NullableAlloca
const VirtualMachine = JSC.VirtualMachine;
const Task = JSC.Task;
const JSPrinter = bun.js_printer;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const StringJoiner = @import("../../string_joiner.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const InlineBlob = JSC.WebCore.InlineBlob;
const AnyBlob = JSC.WebCore.AnyBlob;
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig
index 154a2c627..7d207dbc6 100644
--- a/src/bun.js/webcore/response.zig
+++ b/src/bun.js/webcore/response.zig
@@ -1,25 +1,25 @@
const std = @import("std");
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const AsyncIO = NetworkThread.AsyncIO;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
const FetchHeaders = JSC.FetchHeaders;
const ObjectPool = @import("../../pool.zig").ObjectPool;
const SystemError = JSC.SystemError;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -40,9 +40,9 @@ const NullableAllocator = @import("../../nullable_allocator.zig").NullableAlloca
const VirtualMachine = JSC.VirtualMachine;
const Task = JSC.Task;
const JSPrinter = bun.js_printer;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const StringJoiner = @import("../../string_joiner.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const InlineBlob = JSC.WebCore.InlineBlob;
const AnyBlob = JSC.WebCore.AnyBlob;
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index e73c34b5e..186b9304a 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -1,25 +1,25 @@
const std = @import("std");
const Api = @import("../../api/schema.zig").Api;
-const bun = @import("bun");
+const bun = @import("root").bun;
const RequestContext = @import("../../http.zig").RequestContext;
const MimeType = @import("../../http.zig").MimeType;
const ZigURL = @import("../../url.zig").URL;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const NetworkThread = HTTPClient.NetworkThread;
const AsyncIO = NetworkThread.AsyncIO;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const js = JSC.C;
const Method = @import("../../http/method.zig").Method;
const FetchHeaders = JSC.FetchHeaders;
const ObjectPool = @import("../../pool.zig").ObjectPool;
const SystemError = JSC.SystemError;
-const Output = @import("bun").Output;
-const MutableString = @import("bun").MutableString;
-const strings = @import("bun").strings;
-const string = @import("bun").string;
-const default_allocator = @import("bun").default_allocator;
-const FeatureFlags = @import("bun").FeatureFlags;
+const Output = @import("root").bun.Output;
+const MutableString = @import("root").bun.MutableString;
+const strings = @import("root").bun.strings;
+const string = @import("root").bun.string;
+const default_allocator = @import("root").bun.default_allocator;
+const FeatureFlags = @import("root").bun.FeatureFlags;
const ArrayBuffer = @import("../base.zig").ArrayBuffer;
const Properties = @import("../base.zig").Properties;
const NewClass = @import("../base.zig").NewClass;
@@ -40,9 +40,9 @@ const JSGlobalObject = JSC.JSGlobalObject;
const VirtualMachine = JSC.VirtualMachine;
const Task = JSC.Task;
const JSPrinter = bun.js_printer;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const StringJoiner = @import("../../string_joiner.zig");
-const uws = @import("bun").uws;
+const uws = @import("root").bun.uws;
const Blob = JSC.WebCore.Blob;
const Response = JSC.WebCore.Response;
const Request = JSC.WebCore.Request;
diff --git a/src/bun_js.zig b/src/bun_js.zig
index 2797096bc..8d725cbae 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("options.zig");
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
@@ -28,8 +28,8 @@ const bundler = bun.bundler;
const NodeModuleBundle = @import("node_module_bundle.zig").NodeModuleBundle;
const DotEnv = @import("env_loader.zig");
const which = @import("which.zig").which;
-const JSC = @import("bun").JSC;
-const AsyncHTTP = @import("bun").HTTP.AsyncHTTP;
+const JSC = @import("root").bun.JSC;
+const AsyncHTTP = @import("root").bun.HTTP.AsyncHTTP;
const Arena = @import("./mimalloc_arena.zig").Arena;
const OpaqueWrap = JSC.OpaqueWrap;
diff --git a/src/bun_redirect.zig b/src/bun_redirect.zig
deleted file mode 100644
index 91fc3244d..000000000
--- a/src/bun_redirect.zig
+++ /dev/null
@@ -1 +0,0 @@
-pub usingnamespace @import("root").bun;
diff --git a/src/bundler.zig b/src/bundler.zig
index 6cf4ca044..34544afb0 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -12,7 +12,7 @@ const FeatureFlags = bun.FeatureFlags;
const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("options.zig");
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
@@ -51,7 +51,7 @@ const Report = @import("./report.zig");
const Linker = linker.Linker;
const Resolver = _resolver.Resolver;
const TOML = @import("./toml/toml_parser.zig").TOML;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const PackageManager = @import("./install/install.zig").PackageManager;
pub fn MacroJSValueType_() type {
diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig
index 51d2244b6..2bdac2817 100644
--- a/src/bundler/bundle_v2.zig
+++ b/src/bundler/bundle_v2.zig
@@ -1,6 +1,6 @@
const Bundler = bun.Bundler;
const GenerateNodeModulesBundle = @This();
-const bun = @import("bun");
+const bun = @import("root").bun;
const from = bun.from;
const string = bun.string;
const Output = bun.Output;
diff --git a/src/bundler/entry_points.zig b/src/bundler/entry_points.zig
index a4068d2af..866d4b2f1 100644
--- a/src/bundler/entry_points.zig
+++ b/src/bundler/entry_points.zig
@@ -1,6 +1,6 @@
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Fs = @import("../fs.zig");
const js_ast = bun.JSAst;
diff --git a/src/bundler/generate_node_modules_bundle.zig b/src/bundler/generate_node_modules_bundle.zig
index b45d1f986..2bb0e72a6 100644
--- a/src/bundler/generate_node_modules_bundle.zig
+++ b/src/bundler/generate_node_modules_bundle.zig
@@ -1,6 +1,6 @@
const Bundler = bun.Bundler;
const GenerateNodeModulesBundle = @This();
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -14,7 +14,7 @@ const FeatureFlags = bun.FeatureFlags;
const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
@@ -56,7 +56,7 @@ const EntryPoints = @import("./entry_points.zig");
const BunQueue = sync.Channel(PendingImports, .Dynamic);
const GenerateNodeModuleBundle = @This();
const ThisBundler = bun.Bundler;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub const ThreadPool = struct {
pool: ThreadPoolLib = undefined,
// Hardcode 512 as max number of threads for now.
diff --git a/src/bunfig.zig b/src/bunfig.zig
index 0bdb20889..fc6a5e773 100644
--- a/src/bunfig.zig
+++ b/src/bunfig.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const default_allocator = bun.default_allocator;
const URL = @import("./url.zig").URL;
const C = bun.C;
const options = @import("./options.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_ast = bun.JSAst;
const js_lexer = bun.js_lexer;
const Defines = @import("./defines.zig");
diff --git a/src/c.zig b/src/c.zig
index 2423d176d..a8ac08de3 100644
--- a/src/c.zig
+++ b/src/c.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = @import("./env.zig");
const PlatformSpecific = switch (@import("builtin").target.os.tag) {
diff --git a/src/cache.zig b/src/cache.zig
index cffeccadd..d77c5c6b2 100644
--- a/src/cache.zig
+++ b/src/cache.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const StoredFileDescriptorType = bun.StoredFileDescriptorType;
@@ -12,7 +12,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const js_ast = bun.JSAst;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
const options = @import("./options.zig");
diff --git a/src/cli.zig b/src/cli.zig
index 8ba2b4fd7..e5065fd79 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,7 +13,7 @@ const C = bun.C;
const root = @import("root");
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("options.zig");
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
@@ -25,7 +25,7 @@ const sync = @import("./sync.zig");
const Api = @import("api/schema.zig").Api;
const resolve_path = @import("./resolver/resolve_path.zig");
const configureTransformOptionsForBun = @import("./bun.js/config.zig").configureTransformOptionsForBun;
-const clap = @import("bun").clap;
+const clap = @import("root").bun.clap;
const BunJS = @import("./bun_js.zig");
const Install = @import("./install/install.zig");
const bundler = bun.bundler;
diff --git a/src/cli/build_command.zig b/src/cli/build_command.zig
index aa4ee211f..0f0cd2609 100644
--- a/src/cli/build_command.zig
+++ b/src/cli/build_command.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const Command = @import("../cli.zig").Command;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -12,7 +12,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig
index 6aba8379e..7fb028b68 100644
--- a/src/cli/bunx_command.zig
+++ b/src/cli/bunx_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/cli/colon_list_type.zig b/src/cli/colon_list_type.zig
index 1151d6a18..9f94a1b4c 100644
--- a/src/cli/colon_list_type.zig
+++ b/src/cli/colon_list_type.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig
index 8614d10d7..cdfe10156 100644
--- a/src/cli/create_command.zig
+++ b/src/cli/create_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const constStrToU8 = bun.constStrToU8;
const Output = bun.Output;
@@ -12,7 +12,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
@@ -29,7 +29,7 @@ const bundler = bun.bundler;
const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle;
const fs = @import("../fs.zig");
const URL = @import("../url.zig").URL;
-const HTTP = @import("bun").HTTP;
+const HTTP = @import("root").bun.HTTP;
const NetworkThread = HTTP.NetworkThread;
const ParseJSON = @import("../json_parser.zig").ParseJSONUTF8;
const Archive = @import("../libarchive/libarchive.zig").Archive;
@@ -38,9 +38,9 @@ const JSPrinter = bun.js_printer;
const DotEnv = @import("../env_loader.zig");
const NPMClient = @import("../which_npm_client.zig").NPMClient;
const which = @import("../which.zig").which;
-const clap = @import("bun").clap;
+const clap = @import("root").bun.clap;
const Lock = @import("../lock.zig").Lock;
-const Headers = @import("bun").HTTP.Headers;
+const Headers = @import("root").bun.HTTP.Headers;
const CopyFile = @import("../copy_file.zig");
var bun_path_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
const Futex = @import("../futex.zig");
@@ -1665,7 +1665,7 @@ const Commands = .{
&[_]string{""},
&[_]string{""},
};
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
pub const DownloadedExample = struct {
tarball_bytes: MutableString,
diff --git a/src/cli/dev_command.zig b/src/cli/dev_command.zig
index 77f974e05..9fb846fe7 100644
--- a/src/cli/dev_command.zig
+++ b/src/cli/dev_command.zig
@@ -1,6 +1,6 @@
const Server = @import("../http.zig").Server;
const Command = @import("../cli.zig").Command;
-const Global = @import("bun").Global;
+const Global = @import("root").bun.Global;
pub const DevCommand = struct {
pub fn exec(ctx: Command.Context) !void {
Global.configureAllocator(.{ .long_running = true });
diff --git a/src/cli/discord_command.zig b/src/cli/discord_command.zig
index 0f260c20b..9df5c4958 100644
--- a/src/cli/discord_command.zig
+++ b/src/cli/discord_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/cli/init_command.zig b/src/cli/init_command.zig
index 33cf70caf..a7abd02e8 100644
--- a/src/cli/init_command.zig
+++ b/src/cli/init_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -19,7 +19,7 @@ const linker = @import("../linker.zig");
const options = @import("../options.zig");
const initializeStore = @import("./create_command.zig").initializeStore;
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const JSPrinter = bun.js_printer;
fn exists(path: anytype) bool {
diff --git a/src/cli/install_completions_command.zig b/src/cli/install_completions_command.zig
index 9d1d0568a..b51c75d60 100644
--- a/src/cli/install_completions_command.zig
+++ b/src/cli/install_completions_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
@@ -35,9 +35,9 @@ const JSPrinter = bun.js_printer;
const DotEnv = @import("../env_loader.zig");
const NPMClient = @import("../which_npm_client.zig").NPMClient;
const which = @import("../which.zig").which;
-const clap = @import("bun").clap;
+const clap = @import("root").bun.clap;
const Lock = @import("../lock.zig").Lock;
-const Headers = @import("bun").HTTP.Headers;
+const Headers = @import("root").bun.HTTP.Headers;
const CopyFile = @import("../copy_file.zig");
const ShellCompletions = @import("./shell_completions.zig");
diff --git a/src/cli/package_manager_command.zig b/src/cli/package_manager_command.zig
index fb4309f1b..b7e547c7a 100644
--- a/src/cli/package_manager_command.zig
+++ b/src/cli/package_manager_command.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const Global = bun.Global;
const Output = bun.Output;
const string = bun.string;
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index 30f00f51f..6b02d825b 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
diff --git a/src/cli/shell_completions.zig b/src/cli/shell_completions.zig
index 1ac9cb2c3..35f0ff00b 100644
--- a/src/cli/shell_completions.zig
+++ b/src/cli/shell_completions.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig
index bdcb0ee55..07a86cc3a 100644
--- a/src/cli/test_command.zig
+++ b/src/cli/test_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const FileSystem = @import("../fs.zig").FileSystem;
const PathName = @import("../fs.zig").PathName;
@@ -36,15 +36,15 @@ var path_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var path_buf2: [bun.MAX_PATH_BYTES]u8 = undefined;
const PathString = bun.PathString;
const is_bindgen = std.meta.globalOption("bindgen", bool) orelse false;
-const HTTPThread = @import("bun").HTTP.HTTPThread;
+const HTTPThread = @import("root").bun.HTTP.HTTPThread;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const jest = JSC.Jest;
const TestRunner = JSC.Jest.TestRunner;
const Snapshots = JSC.Jest.Snapshots;
const Test = TestRunner.Test;
-const NetworkThread = @import("bun").HTTP.NetworkThread;
-const uws = @import("bun").uws;
+const NetworkThread = @import("root").bun.HTTP.NetworkThread;
+const uws = @import("root").bun.uws;
fn fmtStatusTextLine(comptime status: @Type(.EnumLiteral), comptime emoji: bool) []const u8 {
comptime {
diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig
index 8bcb91771..b23914c28 100644
--- a/src/cli/upgrade_command.zig
+++ b/src/cli/upgrade_command.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const C = bun.C;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const js_parser = bun.js_parser;
@@ -28,16 +28,16 @@ const bundler = bun.bundler;
const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle;
const fs = @import("../fs.zig");
const URL = @import("../url.zig").URL;
-const HTTP = @import("bun").HTTP;
+const HTTP = @import("root").bun.HTTP;
const ParseJSON = @import("../json_parser.zig").ParseJSONUTF8;
const Archive = @import("../libarchive/libarchive.zig").Archive;
const Zlib = @import("../zlib.zig");
const JSPrinter = bun.js_printer;
const DotEnv = @import("../env_loader.zig");
const which = @import("../which.zig").which;
-const clap = @import("bun").clap;
+const clap = @import("root").bun.clap;
const Lock = @import("../lock.zig").Lock;
-const Headers = @import("bun").HTTP.Headers;
+const Headers = @import("root").bun.HTTP.Headers;
const CopyFile = @import("../copy_file.zig");
const NetworkThread = HTTP.NetworkThread;
diff --git a/src/copy_file.zig b/src/copy_file.zig
index 1e49e33bf..29c74c5aa 100644
--- a/src/copy_file.zig
+++ b/src/copy_file.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const os = std.os;
const math = std.math;
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const CopyFileRangeError = error{
FileTooBig,
@@ -64,7 +64,7 @@ pub fn copyFile(fd_in: os.fd_t, fd_out: os.fd_t) CopyFileError!void {
}
}
-const Platform = @import("bun").analytics.GenerateHeader.GeneratePlatform;
+const Platform = @import("root").bun.analytics.GenerateHeader.GeneratePlatform;
var can_use_copy_file_range = std.atomic.Atomic(i32).init(0);
fn canUseCopyFileRangeSyscall() bool {
diff --git a/src/crash_reporter.zig b/src/crash_reporter.zig
index d98326530..e1ac54190 100644
--- a/src/crash_reporter.zig
+++ b/src/crash_reporter.zig
@@ -28,7 +28,7 @@ noinline fn sigaction_handler(sig: i32, info: *const std.os.siginfo_t, _: ?*cons
}
noinline fn sigpipe_handler(_: i32, _: *const std.os.siginfo_t, _: ?*const anyopaque) callconv(.C) void {
- const bun = @import("bun");
+ const bun = @import("root").bun;
bun.Output.debug("SIGPIPE received\n", .{});
}
diff --git a/src/css_scanner.zig b/src/css_scanner.zig
index 3760f2b01..0a733a6c6 100644
--- a/src/css_scanner.zig
+++ b/src/css_scanner.zig
@@ -1,6 +1,6 @@
const Fs = @import("fs.zig");
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -15,7 +15,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const options = @import("./options.zig");
const import_record = @import("import_record.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Options = options;
const resolver = @import("./resolver/resolver.zig");
const _linker = @import("./linker.zig");
diff --git a/src/darwin_c.zig b/src/darwin_c.zig
index a8f9f9894..205fd5a0a 100644
--- a/src/darwin_c.zig
+++ b/src/darwin_c.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const builtin = @import("builtin");
const os = std.os;
const mem = std.mem;
diff --git a/src/defines-table.zig b/src/defines-table.zig
index b4d7eed49..7c3d4f8d0 100644
--- a/src/defines-table.zig
+++ b/src/defines-table.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/defines.zig b/src/defines.zig
index 8bc57d8c0..6584f1f7f 100644
--- a/src/defines.zig
+++ b/src/defines.zig
@@ -1,10 +1,10 @@
const std = @import("std");
const js_ast = bun.JSAst;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_lexer = bun.js_lexer;
const json_parser = bun.JSON;
const fs = @import("fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/deps/boringssl.translated.zig b/src/deps/boringssl.translated.zig
index f2fdbe6a0..32fdb704b 100644
--- a/src/deps/boringssl.translated.zig
+++ b/src/deps/boringssl.translated.zig
@@ -18862,8 +18862,8 @@ pub const SSL = opaque {
};
}
- const Output = @import("bun").Output;
- const Environment = @import("bun").Environment;
+ const Output = @import("root").bun.Output;
+ const Environment = @import("root").bun.Environment;
pub fn read(this: *SSL, buf: []u8) Error!usize {
const rc = SSL_read(this, buf.ptr, @intCast(c_int, buf.len));
diff --git a/src/deps/c_ares.zig b/src/deps/c_ares.zig
index 5f42000e2..06c9dfbf1 100644
--- a/src/deps/c_ares.zig
+++ b/src/deps/c_ares.zig
@@ -1,6 +1,6 @@
const c = @import("std").c;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const strings = bun.strings;
const iovec = @import("std").os.iovec;
const struct_in_addr = std.os.sockaddr.in;
diff --git a/src/deps/diffz/DiffMatchPatch.zig b/src/deps/diffz/DiffMatchPatch.zig
index 4603aee1b..f46d88cd5 100644
--- a/src/deps/diffz/DiffMatchPatch.zig
+++ b/src/deps/diffz/DiffMatchPatch.zig
@@ -23,7 +23,7 @@
const DiffMatchPatch = @This();
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const testing = std.testing;
const ArrayListUnmanaged = std.ArrayListUnmanaged;
const DiffList = ArrayListUnmanaged(Diff);
diff --git a/src/deps/lol-html.zig b/src/deps/lol-html.zig
index 60b7318db..975aac2b3 100644
--- a/src/deps/lol-html.zig
+++ b/src/deps/lol-html.zig
@@ -7,7 +7,7 @@ pub const MemorySettings = extern struct {
};
inline fn auto_disable() void {
- if (comptime @import("bun").FeatureFlags.disable_lolhtml)
+ if (comptime @import("root").bun.FeatureFlags.disable_lolhtml)
unreachable;
}
diff --git a/src/deps/picohttp.zig b/src/deps/picohttp.zig
index e483df5fa..d18cb7fa0 100644
--- a/src/deps/picohttp.zig
+++ b/src/deps/picohttp.zig
@@ -1,10 +1,10 @@
const std = @import("std");
const c = @import("picohttpparser.zig");
-const ExactSizeMatcher = @import("bun").ExactSizeMatcher;
+const ExactSizeMatcher = @import("root").bun.ExactSizeMatcher;
const Match = ExactSizeMatcher(2);
-const Output = @import("bun").Output;
-const Environment = @import("bun").Environment;
-const StringBuilder = @import("bun").StringBuilder;
+const Output = @import("root").bun.Output;
+const Environment = @import("root").bun.Environment;
+const StringBuilder = @import("root").bun.StringBuilder;
const fmt = std.fmt;
diff --git a/src/deps/uws.zig b/src/deps/uws.zig
index 2713f8760..2dce774ef 100644
--- a/src/deps/uws.zig
+++ b/src/deps/uws.zig
@@ -1,5 +1,5 @@
pub const is_bindgen = @import("std").meta.globalOption("bindgen", bool) orelse false;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Api = bun.ApiSchema;
const std = @import("std");
const Environment = bun.Environment;
@@ -13,7 +13,7 @@ pub const Socket = opaque {};
const uws = @This();
-const BoringSSL = @import("bun").BoringSSL;
+const BoringSSL = @import("root").bun.BoringSSL;
fn NativeSocketHandleType(comptime ssl: bool) type {
if (ssl) {
return BoringSSL.SSL;
diff --git a/src/deps/zig-clap/clap/comptime.zig b/src/deps/zig-clap/clap/comptime.zig
index 3dcd4f7d7..71e0d1b54 100644
--- a/src/deps/zig-clap/clap/comptime.zig
+++ b/src/deps/zig-clap/clap/comptime.zig
@@ -76,7 +76,7 @@ pub fn ComptimeClap(
if (param.names.long == null and param.names.short == null) {
try pos.append(arg.value.?);
if (opt.stop_after_positional_at > 0 and pos.items.len >= opt.stop_after_positional_at) {
- const bun = @import("bun");
+ const bun = @import("root").bun;
if (comptime bun.Environment.isWindows) @compileError(
"TODO: implement stop_after_positional_at on windows",
);
diff --git a/src/env_loader.zig b/src/env_loader.zig
index 38c0744a3..76a8d293d 100644
--- a/src/env_loader.zig
+++ b/src/env_loader.zig
@@ -1,6 +1,6 @@
const std = @import("std");
-const logger = @import("bun").logger;
-const bun = @import("bun");
+const logger = @import("root").bun.logger;
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/feature_flags.zig b/src/feature_flags.zig
index a64029d23..c2055cbb6 100644
--- a/src/feature_flags.zig
+++ b/src/feature_flags.zig
@@ -112,7 +112,7 @@ pub const hardcode_localhost_to_127_0_0_1 = true;
/// so we just disable it
pub const support_jsxs_in_jsx_transform = false;
-pub const use_simdutf = !@import("bun").JSC.is_bindgen;
+pub const use_simdutf = !@import("root").bun.JSC.is_bindgen;
pub const inline_properties_in_transpiler = true;
@@ -120,7 +120,7 @@ pub const same_target_becomes_destructuring = true;
pub const react_server_components = true;
-pub const help_catch_memory_issues = @import("bun").Environment.allow_assert;
+pub const help_catch_memory_issues = @import("root").bun.Environment.allow_assert;
/// This performs similar transforms as https://github.com/rollup/plugins/tree/master/packages/commonjs
///
diff --git a/src/fs.zig b/src/fs.zig
index db0685936..557d909b2 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/http.zig b/src/http.zig
index 8541ee007..a030aed80 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -1,6 +1,6 @@
// const c = @import("./c.zig");
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -19,7 +19,7 @@ const ByteApiWriter = @import("./api/schema.zig").ByteWriter;
const NewApiWriter = @import("./api/schema.zig").Writer;
const js_ast = bun.JSAst;
const bundler = bun.bundler;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Fs = @import("./fs.zig");
const Options = @import("./options.zig");
const Fallback = @import("./runtime.zig").Fallback;
@@ -38,7 +38,7 @@ const Arena = std.heap.ArenaAllocator;
const ThreadlocalArena = @import("./mimalloc_arena.zig").Arena;
const JSON = bun.JSON;
const DateTime = bun.DateTime;
-const ThreadPool = @import("bun").ThreadPool;
+const ThreadPool = @import("root").bun.ThreadPool;
const SourceMap = @import("./sourcemap/sourcemap.zig");
const ObjectPool = @import("./pool.zig").ObjectPool;
const Lock = @import("./lock.zig").Lock;
@@ -52,7 +52,7 @@ pub const MutableStringAPIWriter = NewApiWriter(*MutableString);
const os = std.os;
-const picohttp = @import("bun").picohttp;
+const picohttp = @import("root").bun.picohttp;
const Header = picohttp.Header;
const Request = picohttp.Request;
const Response = picohttp.Response;
@@ -65,7 +65,7 @@ const watcher = @import("./watcher.zig");
threadlocal var req_headers_buf: [100]picohttp.Header = undefined;
threadlocal var res_headers_buf: [100]picohttp.Header = undefined;
const sync = @import("./sync.zig");
-const JavaScript = @import("bun").JSC;
+const JavaScript = @import("root").bun.JSC;
const JavaScriptCore = JavaScriptCore.C;
const Syscall = JavaScript.Node.Syscall;
const Router = @import("./router.zig");
@@ -675,7 +675,7 @@ pub const RequestContext = struct {
_ = try ctx.writeSocket(writer.getWritten(), SOCKET_FLAGS);
}
- const AsyncIO = @import("bun").AsyncIO;
+ const AsyncIO = @import("root").bun.AsyncIO;
pub fn writeSocket(ctx: *RequestContext, buf_: anytype, _: anytype) !usize {
var total: usize = 0;
var buf: []const u8 = buf_;
diff --git a/src/http/header_builder.zig b/src/http/header_builder.zig
index 9e53455d1..82e0868d9 100644
--- a/src/http/header_builder.zig
+++ b/src/http/header_builder.zig
@@ -1,7 +1,7 @@
const HeaderBuilder = @This();
const StringBuilder = @import("../string_builder.zig");
const Headers = @import("./headers.zig");
-const string = @import("bun").string;
+const string = @import("root").bun.string;
const HTTPClient = @import("../http_client_async.zig");
const Api = @import("../api/schema.zig").Api;
const std = @import("std");
diff --git a/src/http/method.zig b/src/http/method.zig
index 33d24f71c..4a3d45133 100644
--- a/src/http/method.zig
+++ b/src/http/method.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/http/mime_type.zig b/src/http/mime_type.zig
index 9084a8f6b..3d3d9a9a9 100644
--- a/src/http/mime_type.zig
+++ b/src/http/mime_type.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/http/url_path.zig b/src/http/url_path.zig
index ba8bee297..ac31c740d 100644
--- a/src/http/url_path.zig
+++ b/src/http/url_path.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const toMutable = bun.constStrToU8;
diff --git a/src/http/websocket.zig b/src/http/websocket.zig
index 8bc101abb..98410d57c 100644
--- a/src/http/websocket.zig
+++ b/src/http/websocket.zig
@@ -4,7 +4,7 @@ const std = @import("std");
const native_endian = @import("builtin").target.cpu.arch.endian();
const os = std.os;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/http/websocket_http_client.zig b/src/http/websocket_http_client.zig
index a5be7faab..89c3f70c8 100644
--- a/src/http/websocket_http_client.zig
+++ b/src/http/websocket_http_client.zig
@@ -3,7 +3,7 @@
const std = @import("std");
const native_endian = @import("builtin").target.cpu.arch.endian();
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -14,9 +14,9 @@ const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
-const uws = @import("bun").uws;
-const JSC = @import("bun").JSC;
-const PicoHTTP = @import("bun").picohttp;
+const uws = @import("root").bun.uws;
+const JSC = @import("root").bun.JSC;
+const PicoHTTP = @import("root").bun.picohttp;
const ObjectPool = @import("../pool.zig").ObjectPool;
const WebsocketHeader = @import("./websocket.zig").WebsocketHeader;
const WebsocketDataFrame = @import("./websocket.zig").WebsocketDataFrame;
diff --git a/src/http/zlib.zig b/src/http/zlib.zig
index 13db13646..e827dc1b3 100644
--- a/src/http/zlib.zig
+++ b/src/http/zlib.zig
@@ -1,10 +1,10 @@
const Lock = @import("../lock.zig").Lock;
const std = @import("std");
-const MutableString = @import("bun").MutableString;
+const MutableString = @import("root").bun.MutableString;
const getAllocator = @import("../http_client_async.zig").getAllocator;
const ZlibPool = @This();
const Zlib = @import("../zlib.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
fn initMutableString(allocator: std.mem.Allocator) anyerror!MutableString {
return MutableString.initEmpty(allocator);
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index bf33e65fc..c2998f6c6 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const picohttp = bun.picohttp;
const JSC = bun.JSC;
const string = bun.string;
diff --git a/src/import_record.zig b/src/import_record.zig
index 27e7bd31f..6cc86a4ad 100644
--- a/src/import_record.zig
+++ b/src/import_record.zig
@@ -1,6 +1,6 @@
-const fs = @import("bun").fs;
-const bun = @import("bun");
-const logger = @import("bun").logger;
+const fs = @import("root").bun.fs;
+const bun = @import("root").bun;
+const logger = @import("root").bun.logger;
const std = @import("std");
const Ref = @import("ast/base.zig").Ref;
const Index = @import("ast/base.zig").Index;
diff --git a/src/install/bin.zig b/src/install/bin.zig
index 3b90544e0..371ce0dde 100644
--- a/src/install/bin.zig
+++ b/src/install/bin.zig
@@ -3,14 +3,14 @@ const Semver = @import("./semver.zig");
const ExternalString = Semver.ExternalString;
const String = Semver.String;
const std = @import("std");
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const Environment = @import("../env.zig");
const Path = @import("../resolver/resolve_path.zig");
const C = @import("../c.zig");
const Fs = @import("../fs.zig");
-const stringZ = @import("bun").stringZ;
+const stringZ = @import("root").bun.stringZ;
const Resolution = @import("./resolution.zig").Resolution;
-const bun = @import("bun");
+const bun = @import("root").bun;
/// Normalized `bin` field in [package.json](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin)
/// Can be a:
/// - file path (relative to the package root)
diff --git a/src/install/dependency.zig b/src/install/dependency.zig
index 6af2e7754..0480dd9d8 100644
--- a/src/install/dependency.zig
+++ b/src/install/dependency.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const logger = bun.logger;
const Environment = @import("../env.zig");
const Install = @import("./install.zig");
diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig
index 2244230ab..893be19fe 100644
--- a/src/install/extract_tarball.zig
+++ b/src/install/extract_tarball.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const default_allocator = bun.default_allocator;
const Global = bun.Global;
const json_parser = bun.JSON;
diff --git a/src/install/install.zig b/src/install/install.zig
index 94a984416..d6ecd2f46 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index eab6ad9a3..86ad1ac54 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/install/npm.zig b/src/install/npm.zig
index 91b003c5e..0e26a5588 100644
--- a/src/install/npm.zig
+++ b/src/install/npm.zig
@@ -1,5 +1,5 @@
const URL = @import("../url.zig").URL;
-const bun = @import("bun");
+const bun = @import("root").bun;
const std = @import("std");
const MutableString = @import("../string_mutable.zig").MutableString;
const Semver = @import("./semver.zig");
@@ -12,15 +12,15 @@ const ExternalStringMap = @import("./install.zig").ExternalStringMap;
const ExternalStringList = @import("./install.zig").ExternalStringList;
const ExternalSlice = @import("./install.zig").ExternalSlice;
const initializeStore = @import("./install.zig").initializeStore;
-const logger = @import("bun").logger;
-const Output = @import("bun").Output;
+const logger = @import("root").bun.logger;
+const Output = @import("root").bun.Output;
const Integrity = @import("./integrity.zig").Integrity;
const Bin = @import("./bin.zig").Bin;
-const Environment = @import("bun").Environment;
+const Environment = @import("root").bun.Environment;
const Aligner = @import("./install.zig").Aligner;
-const HTTPClient = @import("bun").HTTP;
+const HTTPClient = @import("root").bun.HTTP;
const json_parser = bun.JSON;
-const default_allocator = @import("bun").default_allocator;
+const default_allocator = @import("root").bun.default_allocator;
const IdentityContext = @import("../identity_context.zig").IdentityContext;
const ArrayIdentityContext = @import("../identity_context.zig").ArrayIdentityContext;
const SlicedString = Semver.SlicedString;
@@ -151,7 +151,7 @@ pub const Registry = struct {
not_found: void,
};
- const Pico = @import("bun").picohttp;
+ const Pico = @import("root").bun.picohttp;
pub fn getPackageMetadata(
allocator: std.mem.Allocator,
response: Pico.Response,
diff --git a/src/install/repository.zig b/src/install/repository.zig
index c63f1294e..c4b68d9be 100644
--- a/src/install/repository.zig
+++ b/src/install/repository.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const Global = bun.Global;
const logger = bun.logger;
const Dependency = @import("./dependency.zig");
diff --git a/src/install/resolvers/folder_resolver.zig b/src/install/resolvers/folder_resolver.zig
index c9cc682aa..90a2a414c 100644
--- a/src/install/resolvers/folder_resolver.zig
+++ b/src/install/resolvers/folder_resolver.zig
@@ -3,18 +3,18 @@ const PackageID = @import("../install.zig").PackageID;
const Lockfile = @import("../install.zig").Lockfile;
const PackageManager = @import("../install.zig").PackageManager;
const Npm = @import("../npm.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const FileSystem = @import("../../fs.zig").FileSystem;
const JSAst = bun.JSAst;
const string = bun.string;
const stringZ = bun.stringZ;
const Features = @import("../install.zig").Features;
const IdentityContext = @import("../../identity_context.zig").IdentityContext;
-const strings = @import("bun").strings;
+const strings = @import("root").bun.strings;
const Resolution = @import("../resolution.zig").Resolution;
const String = @import("../semver.zig").String;
const Semver = @import("../semver.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const Dependency = @import("../dependency.zig");
pub const FolderResolution = union(Tag) {
package_id: PackageID,
diff --git a/src/install/semver.zig b/src/install/semver.zig
index 928fb9227..9fd6b9c8d 100644
--- a/src/install/semver.zig
+++ b/src/install/semver.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/io/io_darwin.zig b/src/io/io_darwin.zig
index e0a48c0e9..c631b5744 100644
--- a/src/io/io_darwin.zig
+++ b/src/io/io_darwin.zig
@@ -16,7 +16,7 @@ const os = struct {
pub const ESPIPE = 29;
};
-const SystemErrno = @import("bun").C.SystemErrno;
+const SystemErrno = @import("root").bun.C.SystemErrno;
pub const Errno = error{
EPERM,
ENOENT,
diff --git a/src/js_ast.zig b/src/js_ast.zig
index e9cb6f2a4..40675805f 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -1,8 +1,8 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const JSXRuntime = @import("options.zig").JSX.Runtime;
const Runtime = @import("runtime.zig").Runtime;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -18,8 +18,8 @@ const RefHashCtx = @import("ast/base.zig").RefHashCtx;
const ObjectPool = @import("./pool.zig").ObjectPool;
const ImportRecord = @import("import_record.zig").ImportRecord;
const allocators = @import("allocators.zig");
-const JSC = @import("bun").JSC;
-const HTTP = @import("bun").HTTP;
+const JSC = @import("root").bun.JSC;
+const HTTP = @import("root").bun.HTTP;
const RefCtx = @import("./ast/base.zig").RefCtx;
const JSONParser = bun.JSON;
const is_bindgen = std.meta.globalOption("bindgen", bool) orelse false;
@@ -5983,7 +5983,7 @@ pub const BunPlugin = struct {
};
pub const Macro = struct {
- const JavaScript = @import("bun").JSC;
+ const JavaScript = @import("root").bun.JSC;
const JSCBase = @import("./bun.js/base.zig");
const Resolver = @import("./resolver/resolver.zig").Resolver;
const isPackagePath = @import("./resolver/resolver.zig").isPackagePath;
diff --git a/src/js_lexer.zig b/src/js_lexer.zig
index 98393080b..8ad3cdbba 100644
--- a/src/js_lexer.zig
+++ b/src/js_lexer.zig
@@ -1,10 +1,10 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const tables = @import("js_lexer_tables.zig");
const build_options = @import("build_options");
const js_ast = bun.JSAst;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/js_lexer/identifier_cache.zig b/src/js_lexer/identifier_cache.zig
index 5f34c9611..402e999f1 100644
--- a/src/js_lexer/identifier_cache.zig
+++ b/src/js_lexer/identifier_cache.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const CachedBitset = extern struct {
range: [2]i32,
diff --git a/src/js_lexer_tables.zig b/src/js_lexer_tables.zig
index 8fe95a754..7ca41ca28 100644
--- a/src/js_lexer_tables.zig
+++ b/src/js_lexer_tables.zig
@@ -1,9 +1,9 @@
const std = @import("std");
const expectString = std.testing.expectEqualStrings;
const expect = std.testing.expect;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const unicode = std.unicode;
-const default_allocator = @import("bun").default_allocator;
+const default_allocator = @import("root").bun.default_allocator;
const string = @import("string_types.zig").string;
const CodePoint = @import("string_types.zig").CodePoint;
const ComptimeStringMap = @import("./comptime_string_map.zig").ComptimeStringMap;
diff --git a/src/js_parser.zig b/src/js_parser.zig
index e950be4f5..9e58e5be5 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -1,5 +1,5 @@
pub const std = @import("std");
-pub const logger = @import("bun").logger;
+pub const logger = @import("root").bun.logger;
pub const js_lexer = bun.js_lexer;
pub const importRecord = @import("./import_record.zig");
pub const js_ast = bun.JSAst;
@@ -11,7 +11,7 @@ pub const RuntimeImports = _runtime.Runtime.Imports;
pub const RuntimeFeatures = _runtime.Runtime.Features;
pub const RuntimeNames = _runtime.Runtime.Names;
pub const fs = @import("./fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -39,7 +39,7 @@ pub const StmtNodeList = js_ast.StmtNodeList;
pub const BindingNodeList = js_ast.BindingNodeList;
const DeclaredSymbol = js_ast.DeclaredSymbol;
const ComptimeStringMap = @import("./comptime_string_map.zig").ComptimeStringMap;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
fn _disabledAssert(_: bool) void {
if (!Environment.allow_assert) @compileLog("assert is missing an if (Environment.allow_assert)");
diff --git a/src/js_printer.zig b/src/js_printer.zig
index de0a978dc..acc778b18 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_lexer = bun.js_lexer;
const importRecord = @import("import_record.zig");
const js_ast = bun.JSAst;
@@ -9,7 +9,7 @@ const runtime = @import("runtime.zig");
const Lock = @import("./lock.zig").Lock;
const Api = @import("./api/schema.zig").Api;
const fs = @import("fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/json_parser.zig b/src/json_parser.zig
index 34ce785b0..fa9af406f 100644
--- a/src/json_parser.zig
+++ b/src/json_parser.zig
@@ -1,12 +1,12 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_lexer = bun.js_lexer;
const importRecord = @import("import_record.zig");
const js_ast = bun.JSAst;
const options = @import("options.zig");
const BabyList = @import("./baby_list.zig").BabyList;
const fs = @import("fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/libarchive/libarchive.zig b/src/libarchive/libarchive.zig
index 5b818a49b..a88f3e328 100644
--- a/src/libarchive/libarchive.zig
+++ b/src/libarchive/libarchive.zig
@@ -1,7 +1,7 @@
// @link "../deps/libarchive.a"
const lib = @import("./libarchive-bindings.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -14,7 +14,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const std = @import("std");
const struct_archive = lib.struct_archive;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub const Seek = enum(c_int) {
set = std.os.SEEK_SET,
current = std.os.SEEK_CUR,
diff --git a/src/linear_fifo.zig b/src/linear_fifo.zig
index faa631958..66d579fdc 100644
--- a/src/linear_fifo.zig
+++ b/src/linear_fifo.zig
@@ -11,7 +11,7 @@ const Allocator = mem.Allocator;
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const LinearFifoBufferType = union(enum) {
/// The buffer is internal to the fifo; it is of the specified size.
diff --git a/src/linker.zig b/src/linker.zig
index cccd37ae7..27a1db2b6 100644
--- a/src/linker.zig
+++ b/src/linker.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,7 +13,7 @@ const Ref = @import("./ast/base.zig").Ref;
const std = @import("std");
const lex = bun.js_lexer;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Options = @import("options.zig");
const js_parser = bun.js_parser;
const json_parser = bun.JSON;
@@ -37,7 +37,7 @@ const ResolverType = Resolver.Resolver;
const ESModule = @import("./resolver/package_json.zig").ESModule;
const Runtime = @import("./runtime.zig").Runtime;
const URL = @import("url.zig").URL;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const PluginRunner = bun.bundler.PluginRunner;
pub const CSSResolveError = error{ResolveError};
diff --git a/src/linux_c.zig b/src/linux_c.zig
index 129161579..0cac5fb39 100644
--- a/src/linux_c.zig
+++ b/src/linux_c.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const SystemErrno = enum(u8) {
SUCCESS = 0,
EPERM = 1,
diff --git a/src/logger.zig b/src/logger.zig
index 5bc8fc7eb..13dd98f96 100644
--- a/src/logger.zig
+++ b/src/logger.zig
@@ -1,8 +1,8 @@
const std = @import("std");
const Api = @import("./api/schema.zig").Api;
-const js = @import("bun").JSC;
+const js = @import("root").bun.JSC;
const ImportKind = @import("./import_record.zig").ImportKind;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -12,7 +12,7 @@ const MutableString = bun.MutableString;
const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const fs = @import("fs.zig");
const unicode = std.unicode;
const Ref = @import("./ast/base.zig").Ref;
diff --git a/src/main_wasm.zig b/src/main_wasm.zig
index ae7339cf5..b1cb14dc5 100644
--- a/src/main_wasm.zig
+++ b/src/main_wasm.zig
@@ -2,8 +2,8 @@ const JSParser = bun.js_parser;
const JSPrinter = bun.js_printer;
const JSAst = bun.JSAst;
const Api = @import("./api/schema.zig").Api;
-const Logger = @import("bun").logger;
-const global = @import("bun");
+const Logger = @import("root").bun.logger;
+const global = @import("root").bun;
const default_allocator = global.default_allocator;
const std = @import("std");
const Define = @import("./defines.zig");
diff --git a/src/mdx/mdx_parser.zig b/src/mdx/mdx_parser.zig
index f8f9096e9..b3dcdb91f 100644
--- a/src/mdx/mdx_parser.zig
+++ b/src/mdx/mdx_parser.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const mdx_lexer = @import("./mdx_lexer.zig");
const Lexer = mdx_lexer.Lexer;
const importRecord = @import("../import_record.zig");
@@ -10,7 +10,7 @@ const ParseStatementOptions = @import("../js_parser/js_parser.zig").ParseStateme
const options = @import("../options.zig");
const fs = @import("../fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/mimalloc_arena.zig b/src/mimalloc_arena.zig
index 37ea2ecc3..1dcf6d5b1 100644
--- a/src/mimalloc_arena.zig
+++ b/src/mimalloc_arena.zig
@@ -7,7 +7,7 @@ const Environment = @import("./env.zig");
const FeatureFlags = @import("./feature_flags.zig");
const Allocator = mem.Allocator;
const assert = std.debug.assert;
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const GlobalArena = struct {
arena: Arena,
diff --git a/src/napi/napi.zig b/src/napi/napi.zig
index 99d7c82fb..1432b4702 100644
--- a/src/napi/napi.zig
+++ b/src/napi/napi.zig
@@ -1,7 +1,7 @@
const std = @import("std");
-const JSC = @import("bun").JSC;
-const strings = @import("bun").strings;
-const bun = @import("bun");
+const JSC = @import("root").bun.JSC;
+const strings = @import("root").bun.strings;
+const bun = @import("root").bun;
const Lock = @import("../lock.zig").Lock;
const JSValue = JSC.JSValue;
const ZigString = JSC.ZigString;
diff --git a/src/network_thread.zig b/src/network_thread.zig
index 11292b057..969269c76 100644
--- a/src/network_thread.zig
+++ b/src/network_thread.zig
@@ -1,15 +1,15 @@
-const ThreadPool = @import("bun").ThreadPool;
+const ThreadPool = @import("root").bun.ThreadPool;
pub const Batch = ThreadPool.Batch;
pub const Task = ThreadPool.Task;
const Node = ThreadPool.Node;
pub const Completion = AsyncIO.Completion;
const std = @import("std");
-pub const AsyncIO = @import("bun").AsyncIO;
-const Output = @import("bun").Output;
+pub const AsyncIO = @import("root").bun.AsyncIO;
+const Output = @import("root").bun.Output;
const IdentityContext = @import("./identity_context.zig").IdentityContext;
const HTTP = @import("./http_client_async.zig");
const NetworkThread = @This();
-const Environment = @import("bun").Environment;
+const Environment = @import("root").bun.Environment;
const Lock = @import("./lock.zig").Lock;
/// Single-thread in this pool
@@ -25,9 +25,9 @@ pub var global: NetworkThread = undefined;
pub var global_loaded: std.atomic.Atomic(u32) = std.atomic.Atomic(u32).init(0);
const log = Output.scoped(.NetworkThread, true);
-const Global = @import("bun").Global;
+const Global = @import("root").bun.Global;
pub fn onStartIOThread(waker: AsyncIO.Waker) void {
- NetworkThread.address_list_cached = NetworkThread.AddressListCache.init(@import("bun").default_allocator);
+ NetworkThread.address_list_cached = NetworkThread.AddressListCache.init(@import("root").bun.default_allocator);
AsyncIO.global = AsyncIO.init(1024, 0, waker) catch |err| {
log: {
if (comptime Environment.isLinux) {
@@ -233,7 +233,7 @@ pub fn init() !void {
const fd = try std.os.eventfd(0, std.os.linux.EFD.CLOEXEC | 0);
global.waker = .{ .fd = fd };
} else if (comptime Environment.isMac) {
- global.waker = try AsyncIO.Waker.init(@import("bun").default_allocator);
+ global.waker = try AsyncIO.Waker.init(@import("root").bun.default_allocator);
} else {
@compileLog("TODO: Waker");
}
diff --git a/src/node_fallbacks.zig b/src/node_fallbacks.zig
index b3753de68..fc0dc3bef 100644
--- a/src/node_fallbacks.zig
+++ b/src/node_fallbacks.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const string = @import("./string_types.zig").string;
const PackageJSON = @import("./resolver/package_json.zig").PackageJSON;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Fs = @import("./fs.zig");
const ComptimeStringMap = @import("./comptime_string_map.zig").ComptimeStringMap;
diff --git a/src/node_module_bundle.zig b/src/node_module_bundle.zig
index 4506d9070..26e755257 100644
--- a/src/node_module_bundle.zig
+++ b/src/node_module_bundle.zig
@@ -2,7 +2,7 @@ const schema = @import("./api/schema.zig");
const Api = schema.Api;
const std = @import("std");
const Fs = @import("./fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/open.zig b/src/open.zig
index 853b51abd..1e1fa317b 100644
--- a/src/open.zig
+++ b/src/open.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/options.zig b/src/options.zig
index 1e296a4fb..4d03e8abf 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -1,7 +1,7 @@
/// This file is mostly the API schema but with all the options normalized.
/// Normalization is necessary because most fields in the API schema are optional
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const Fs = @import("fs.zig");
const resolver = @import("./resolver/resolver.zig");
@@ -12,7 +12,7 @@ const resolve_path = @import("./resolver/resolve_path.zig");
const NodeModuleBundle = @import("./node_module_bundle.zig").NodeModuleBundle;
const URL = @import("./url.zig").URL;
const ConditionsMap = @import("./resolver/package_json.zig").ESModule.ConditionsMap;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -24,7 +24,7 @@ const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
const StoredFileDescriptorType = bun.StoredFileDescriptorType;
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
const Runtime = @import("./runtime.zig").Runtime;
const Analytics = @import("./analytics/analytics_thread.zig");
const MacroRemap = @import("./resolver/package_json.zig").MacroMap;
diff --git a/src/output.zig b/src/output.zig
index 1f1a500a6..4889111ab 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -1,14 +1,14 @@
const Output = @This();
-const bun = @import("bun");
+const bun = @import("root").bun;
const std = @import("std");
const Environment = @import("./env.zig");
-const string = @import("bun").string;
-const root = @import("bun");
-const strings = @import("bun").strings;
-const StringTypes = @import("bun").StringTypes;
-const Global = @import("bun").Global;
-const ComptimeStringMap = @import("bun").ComptimeStringMap;
-const use_mimalloc = @import("bun").use_mimalloc;
+const string = @import("root").bun.string;
+const root = @import("root").bun;
+const strings = @import("root").bun.strings;
+const StringTypes = @import("root").bun.StringTypes;
+const Global = @import("root").bun.Global;
+const ComptimeStringMap = @import("root").bun.ComptimeStringMap;
+const use_mimalloc = @import("root").bun.use_mimalloc;
const SystemTimer = @import("./system_timer.zig").Timer;
@@ -455,7 +455,7 @@ pub const color_map = ComptimeStringMap(string, .{
});
const RESET: string = "\x1b[0m";
pub fn prettyFmt(comptime fmt: string, comptime is_enabled: bool) string {
- if (comptime @import("bun").fast_debug_build_mode)
+ if (comptime @import("root").bun.fast_debug_build_mode)
return fmt;
comptime var new_fmt: [fmt.len * 4]u8 = undefined;
@@ -548,7 +548,7 @@ pub noinline fn prettyWithPrinter(comptime fmt: string, args: anytype, comptime
}
pub noinline fn prettyWithPrinterFn(comptime fmt: string, args: anytype, comptime printFn: anytype, ctx: anytype) void {
- if (comptime @import("bun").fast_debug_build_mode)
+ if (comptime @import("root").bun.fast_debug_build_mode)
return printFn(ctx, comptime prettyFmt(fmt, false), args);
if (enable_ansi_colors) {
@@ -616,7 +616,7 @@ pub noinline fn printError(comptime fmt: string, args: anytype) void {
}
pub const DebugTimer = struct {
- timer: @import("bun").DebugOnly(std.time.Timer) = undefined,
+ timer: @import("root").bun.DebugOnly(std.time.Timer) = undefined,
pub fn start() DebugTimer {
if (comptime Environment.isDebug) {
diff --git a/src/panic_handler.zig b/src/panic_handler.zig
index 4e2ca05f9..761c25c3a 100644
--- a/src/panic_handler.zig
+++ b/src/panic_handler.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const CLI = @import("./cli.zig").Cli;
const Features = @import("./analytics/analytics_thread.zig").Features;
-const HTTP = @import("bun").HTTP.AsyncHTTP;
+const HTTP = @import("root").bun.HTTP.AsyncHTTP;
const Report = @import("./report.zig");
pub fn NewPanicHandler(comptime panic_func: fn ([]const u8, ?*std.builtin.StackTrace, ?usize) noreturn) type {
diff --git a/src/renamer.zig b/src/renamer.zig
index 7fea2219f..777b3beb5 100644
--- a/src/renamer.zig
+++ b/src/renamer.zig
@@ -1,5 +1,5 @@
const js_ast = bun.JSAst;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -11,7 +11,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const std = @import("std");
const Ref = @import("./ast/base.zig").Ref;
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const JSLexer = @import("./js_lexer.zig");
pub const NoOpRenamer = struct {
diff --git a/src/report.zig b/src/report.zig
index 192f0bab7..92f051427 100644
--- a/src/report.zig
+++ b/src/report.zig
@@ -1,6 +1,6 @@
const std = @import("std");
-const logger = @import("bun").logger;
-const bun = @import("bun");
+const logger = @import("root").bun.logger;
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,7 +13,7 @@ const C = bun.C;
const CLI = @import("./cli.zig").Cli;
const Features = @import("./analytics/analytics_thread.zig").Features;
const Platform = @import("./analytics/analytics_thread.zig").GenerateHeader.GeneratePlatform;
-const HTTP = @import("bun").HTTP.AsyncHTTP;
+const HTTP = @import("root").bun.HTTP.AsyncHTTP;
const CrashReporter = @import("./crash_reporter.zig");
const Report = @This();
@@ -230,7 +230,7 @@ pub fn fatal(err_: ?anyerror, msg_: ?string) void {
// It only is a real crash report if it's not coming from Zig
- if (comptime !@import("bun").JSC.is_bindgen) {
+ if (comptime !@import("root").bun.JSC.is_bindgen) {
std.mem.doNotOptimizeAway(&Bun__crashReportWrite);
Bun__crashReportDumpStackTrace(&crash_report_writer);
}
@@ -274,7 +274,7 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
.{ @errorName(name), bun.fmt.hexIntUpper(addr) },
);
printMetadata();
- if (comptime !@import("bun").JSC.is_bindgen) {
+ if (comptime !@import("root").bun.JSC.is_bindgen) {
std.mem.doNotOptimizeAway(&Bun__crashReportWrite);
Bun__crashReportDumpStackTrace(&crash_report_writer);
}
diff --git a/src/resolver/data_url.zig b/src/resolver/data_url.zig
index 0ce5b511d..dd31605d9 100644
--- a/src/resolver/data_url.zig
+++ b/src/resolver/data_url.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/resolver/dir_info.zig b/src/resolver/dir_info.zig
index f81cd85c1..3ae75d0e7 100644
--- a/src/resolver/dir_info.zig
+++ b/src/resolver/dir_info.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const std = @import("std");
const string = bun.string;
const Output = bun.Output;
diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig
index 2681cbb5e..0788b7467 100644
--- a/src/resolver/package_json.zig
+++ b/src/resolver/package_json.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -13,7 +13,7 @@ const Api = @import("../api/schema.zig").Api;
const std = @import("std");
const options = @import("../options.zig");
const cache = @import("../cache.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_ast = bun.JSAst;
const fs = @import("../fs.zig");
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig
index f3c43b554..da21f3ec1 100644
--- a/src/resolver/resolve_path.zig
+++ b/src/resolver/resolve_path.zig
@@ -3,7 +3,7 @@ const std = @import("std");
const strings = @import("../string_immutable.zig");
const FeatureFlags = @import("../feature_flags.zig");
const default_allocator = @import("../memory_allocator.zig").c_allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Fs = @import("../fs.zig");
threadlocal var parser_join_input_buffer: [4096]u8 = undefined;
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index 0d24d2e39..4845de213 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -12,7 +12,7 @@ const default_allocator = bun.default_allocator;
const StoredFileDescriptorType = bun.StoredFileDescriptorType;
const C = bun.C;
const ast = @import("../import_record.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const options = @import("../options.zig");
const Fs = @import("../fs.zig");
const std = @import("std");
diff --git a/src/resolver/tsconfig_json.zig b/src/resolver/tsconfig_json.zig
index 7ce1fa358..7121e8741 100644
--- a/src/resolver/tsconfig_json.zig
+++ b/src/resolver/tsconfig_json.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -10,7 +10,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const std = @import("std");
const options = @import("../options.zig");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const cache = @import("../cache.zig");
const js_ast = bun.JSAst;
const js_lexer = bun.js_lexer;
diff --git a/src/router.zig b/src/router.zig
index f4ea731d3..926e8ea7e 100644
--- a/src/router.zig
+++ b/src/router.zig
@@ -7,7 +7,7 @@ const Router = @This();
const Api = @import("./api/schema.zig").Api;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
@@ -932,7 +932,7 @@ const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const expectEqualStrings = std.testing.expectEqualStrings;
const expectStr = std.testing.expectEqualStrings;
-const Logger = @import("bun").logger;
+const Logger = @import("root").bun.logger;
pub const Test = struct {
pub fn makeRoutes(comptime testName: string, data: anytype) !Routes {
diff --git a/src/runtime.zig b/src/runtime.zig
index ef642f903..fe95ba2ba 100644
--- a/src/runtime.zig
+++ b/src/runtime.zig
@@ -1,5 +1,5 @@
const options = @import("./options.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/sha.zig b/src/sha.zig
index 214ca0445..64539eff0 100644
--- a/src/sha.zig
+++ b/src/sha.zig
@@ -1,4 +1,4 @@
-const BoringSSL = @import("bun").BoringSSL;
+const BoringSSL = @import("root").bun.BoringSSL;
const std = @import("std");
pub const bun = @import("./bun.zig");
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index 721c8caf6..b9d19b40d 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -4,10 +4,10 @@ pub const VLQ_BASE_MASK: u32 = VLQ_BASE - 1;
pub const VLQ_CONTINUATION_BIT: u32 = VLQ_BASE;
pub const VLQ_CONTINUATION_MASK: u32 = 1 << VLQ_CONTINUATION_BIT;
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const JSAst = bun.JSAst;
const BabyList = JSAst.BabyList;
-const Logger = @import("bun").logger;
+const Logger = @import("root").bun.logger;
const strings = bun.strings;
const MutableString = bun.MutableString;
const Joiner = @import("../string_joiner.zig");
diff --git a/src/string_builder.zig b/src/string_builder.zig
index 1dcf7b494..abed901dd 100644
--- a/src/string_builder.zig
+++ b/src/string_builder.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const Environment = bun.Environment;
const string = @import("string_types.zig").string;
const StringBuilder = @This();
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index bc0b59ea0..15e0fc032 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -4,7 +4,7 @@ const Environment = @import("./env.zig");
const string = bun.string;
const stringZ = bun.stringZ;
const CodePoint = bun.CodePoint;
-const bun = @import("bun");
+const bun = @import("root").bun;
pub const joiner = @import("./string_joiner.zig");
const log = bun.Output.scoped(.STR, true);
@@ -1877,7 +1877,7 @@ pub fn elementLengthLatin1IntoUTF8(comptime Type: type, latin1_: Type) usize {
return latin1_.len + total_non_ascii_count;
}
-const JSC = @import("bun").JSC;
+const JSC = @import("root").bun.JSC;
pub fn copyLatin1IntoUTF16(comptime Buffer: type, buf_: Buffer, comptime Type: type, latin1_: Type) EncodeIntoResult {
var buf = buf_;
diff --git a/src/string_joiner.zig b/src/string_joiner.zig
index 373d24633..884dce2ef 100644
--- a/src/string_joiner.zig
+++ b/src/string_joiner.zig
@@ -1,7 +1,7 @@
/// Rope-like data structure for joining many small strings into one big string.
const std = @import("std");
const default_allocator = bun.default_allocator;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Allocator = std.mem.Allocator;
const ObjectPool = @import("./pool.zig").ObjectPool;
diff --git a/src/string_mutable.zig b/src/string_mutable.zig
index 3a6918b5c..7f81b5a74 100644
--- a/src/string_mutable.zig
+++ b/src/string_mutable.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const expect = std.testing.expect;
-const bun = @import("bun");
+const bun = @import("root").bun;
const strings = bun.strings;
const js_lexer = bun.js_lexer;
@@ -33,7 +33,7 @@ pub const MutableString = struct {
}
pub fn owns(this: *const MutableString, slice: []const u8) bool {
- return @import("bun").isSliceInBuffer(slice, this.list.items.ptr[0..this.list.capacity]);
+ return @import("root").bun.isSliceInBuffer(slice, this.list.items.ptr[0..this.list.capacity]);
}
pub fn growIfNeeded(self: *MutableString, amount: usize) !void {
diff --git a/src/string_types.zig b/src/string_types.zig
index 0378ffbe6..5063eada6 100644
--- a/src/string_types.zig
+++ b/src/string_types.zig
@@ -3,7 +3,7 @@ pub const string = []const u8;
pub const stringZ = [:0]const u8;
pub const stringMutable = []u8;
pub const CodePoint = i32;
-const bun = @import("bun");
+const bun = @import("root").bun;
// macOS sets file path limit to 1024
// Since a pointer on x64 is 64 bits and only 46 bits are used
// We can safely store the entire path slice in a single u64.
@@ -15,7 +15,7 @@ pub const PathString = packed struct {
ptr: PointerIntType = 0,
len: PathInt = 0,
- const JSC = @import("bun").JSC;
+ const JSC = @import("root").bun.JSC;
pub fn fromJS(value: JSC.JSValue, global: *JSC.JSGlobalObject, exception: JSC.C.ExceptionRef) PathString {
if (!value.jsType().isStringLike()) {
JSC.JSError(JSC.getAllocator(global), "Only path strings are supported for now", .{}, global, exception);
diff --git a/src/sync.zig b/src/sync.zig
index b51b1116f..23cde775a 100644
--- a/src/sync.zig
+++ b/src/sync.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const system = std.system;
-const bun = @import("bun");
+const bun = @import("root").bun;
// https://gist.github.com/kprotty/0d2dc3da4840341d6ff361b27bdac7dc
pub const ThreadPool = struct {
diff --git a/src/tagged_pointer.zig b/src/tagged_pointer.zig
index 6a8f6defa..2cf3c41f5 100644
--- a/src/tagged_pointer.zig
+++ b/src/tagged_pointer.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/thread_pool.zig b/src/thread_pool.zig
index da402407e..f287dd866 100644
--- a/src/thread_pool.zig
+++ b/src/thread_pool.zig
@@ -2,7 +2,7 @@
// https://github.com/kprotty/zap/blob/blog/src/thread_pool.zig
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const ThreadPool = @This();
const Futex = @import("./futex.zig");
@@ -614,7 +614,7 @@ fn join(self: *ThreadPool) void {
thread.join_event.notify();
}
-const Output = @import("bun").Output;
+const Output = @import("root").bun.Output;
pub const Thread = struct {
next: ?*Thread = null,
diff --git a/src/toml/toml_lexer.zig b/src/toml/toml_lexer.zig
index bc62beeb7..1e739822c 100644
--- a/src/toml/toml_lexer.zig
+++ b/src/toml/toml_lexer.zig
@@ -1,8 +1,8 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const js_ast = bun.JSAst;
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/toml/toml_parser.zig b/src/toml/toml_parser.zig
index b7553b04e..34220cbe0 100644
--- a/src/toml/toml_parser.zig
+++ b/src/toml/toml_parser.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const logger = @import("bun").logger;
+const logger = @import("root").bun.logger;
const toml_lexer = @import("./toml_lexer.zig");
const Lexer = toml_lexer.Lexer;
const importRecord = @import("../import_record.zig");
@@ -7,7 +7,7 @@ const js_ast = bun.JSAst;
const options = @import("../options.zig");
const fs = @import("../fs.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/url.zig b/src/url.zig
index fae2e84a4..a2d67d93d 100644
--- a/src/url.zig
+++ b/src/url.zig
@@ -1,7 +1,7 @@
const std = @import("std");
const Api = @import("./api/schema.zig").Api;
const resolve_path = @import("./resolver/resolve_path.zig");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/util.zig b/src/util.zig
index 8e06df9a1..fbc98d666 100644
--- a/src/util.zig
+++ b/src/util.zig
@@ -1,6 +1,6 @@
// Things that maybe should go in Zig standard library at some point
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
pub fn Key(comptime Map: type) type {
return FieldType(Map.KV, "key").?;
diff --git a/src/watcher.zig b/src/watcher.zig
index b993a9a83..466463805 100644
--- a/src/watcher.zig
+++ b/src/watcher.zig
@@ -1,6 +1,6 @@
const Fs = @import("./fs.zig");
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/which.zig b/src/which.zig
index 55dd7bfce..1cef93a22 100644
--- a/src/which.zig
+++ b/src/which.zig
@@ -1,5 +1,5 @@
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
fn isValid(buf: *[bun.MAX_PATH_BYTES]u8, segment: []const u8, bin: []const u8) ?u16 {
bun.copy(u8, buf, segment);
buf[segment.len] = std.fs.path.sep;
diff --git a/src/which_npm_client.zig b/src/which_npm_client.zig
index d6791dcec..7e90f12d3 100644
--- a/src/which_npm_client.zig
+++ b/src/which_npm_client.zig
@@ -1,4 +1,4 @@
-const bun = @import("bun");
+const bun = @import("root").bun;
const string = bun.string;
const Output = bun.Output;
const Global = bun.Global;
diff --git a/src/work_pool.zig b/src/work_pool.zig
index d67bc9544..f23becdfc 100644
--- a/src/work_pool.zig
+++ b/src/work_pool.zig
@@ -1,4 +1,4 @@
-const ThreadPool = @import("bun").ThreadPool;
+const ThreadPool = @import("root").bun.ThreadPool;
const std = @import("std");
pub const Batch = ThreadPool.Batch;
diff --git a/src/zlib.zig b/src/zlib.zig
index 5d94b02c5..4a3901a14 100644
--- a/src/zlib.zig
+++ b/src/zlib.zig
@@ -1,7 +1,7 @@
// @link "deps/zlib/libz.a"
const std = @import("std");
-const bun = @import("bun");
+const bun = @import("root").bun;
test "Zlib Read" {
const expected_text = @embedFile("./zlib.test.txt");