aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-12-28 00:51:22 -0800
committerGravatar GitHub <noreply@github.com> 2022-12-28 00:51:22 -0800
commitc0dd2841362b67fdb5ede262b19688004a4eb9a4 (patch)
treea3cd6b353c25c30d66489de61b394af7d5568fed
parent504972fa5deb92f2d0510d42f11b085351915a32 (diff)
downloadbun-c0dd2841362b67fdb5ede262b19688004a4eb9a4.tar.gz
bun-c0dd2841362b67fdb5ede262b19688004a4eb9a4.tar.zst
bun-c0dd2841362b67fdb5ede262b19688004a4eb9a4.zip
Upgrade to latest Zig (#1610)
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
-rw-r--r--.github/workflows/bun-linux-build.yml4
-rw-r--r--.github/workflows/bun-mac-aarch64.yml14
-rw-r--r--.github/workflows/bun-mac-x64-baseline.yml14
-rw-r--r--.github/workflows/bun-mac-x64.yml14
-rw-r--r--Dockerfile41
-rw-r--r--Dockerfile.devcontainer2
-rw-r--r--Makefile20
-rw-r--r--README.md16
-rw-r--r--build.zig114
-rwxr-xr-xbun.lockbbin77408 -> 77408 bytes
-rw-r--r--misctools/headers-cleaner.js15
-rw-r--r--misctools/http_bench.zig4
-rw-r--r--package.json2
-rw-r--r--root.zig16
-rw-r--r--src/__global.zig6
-rw-r--r--src/allocators.zig8
-rw-r--r--src/allocators/mimalloc.zig18
-rw-r--r--src/analytics/analytics_schema.zig8
-rw-r--r--src/api/demo/schema.zig2
-rw-r--r--src/api/schema.zig8
-rw-r--r--src/baby_list.zig2
-rw-r--r--src/base64/base64.zig4
-rw-r--r--src/bindgen.zig4
-rw-r--r--src/build-id (renamed from build-id)0
-rw-r--r--src/bun.js/api/FFI.h1
-rw-r--r--src/bun.js/api/bun.zig295
-rw-r--r--src/bun.js/api/bun/socket.zig16
-rw-r--r--src/bun.js/api/bun/spawn.zig4
-rw-r--r--src/bun.js/api/bun/subprocess.zig25
-rw-r--r--src/bun.js/api/ffi.zig111
-rw-r--r--src/bun.js/api/filesystem_router.zig10
-rw-r--r--src/bun.js/api/html_rewriter.zig8
-rw-r--r--src/bun.js/api/server.zig87
-rw-r--r--src/bun.js/api/transpiler.zig8
-rw-r--r--src/bun.js/base.zig385
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h4
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h4
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h14
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h14
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses.cpp2302
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses.h106
-rw-r--r--src/bun.js/bindings/bindings-generator.zig9
-rw-r--r--src/bun.js/bindings/bindings.zig206
-rw-r--r--src/bun.js/bindings/c-bindings.cpp13
-rw-r--r--src/bun.js/bindings/exports.zig88
-rw-r--r--src/bun.js/bindings/generated_classes.zig632
-rw-r--r--src/bun.js/bindings/generated_classes_list.zig2
-rw-r--r--src/bun.js/bindings/header-gen.zig122
-rw-r--r--src/bun.js/bindings/headers-cpp.h2
-rw-r--r--src/bun.js/bindings/headers.h20
-rw-r--r--src/bun.js/bindings/headers.zig368
-rw-r--r--src/bun.js/bindings/shimmer.zig12
-rw-r--r--src/bun.js/bindings/sizes.zig4
-rw-r--r--src/bun.js/bindings/static_export.zig2
-rw-r--r--src/bun.js/event_loop.zig10
-rw-r--r--src/bun.js/http.exports.js34
-rw-r--r--src/bun.js/javascript.zig237
-rw-r--r--src/bun.js/javascript_core_c_api.zig84
-rw-r--r--src/bun.js/module_loader.zig37
-rw-r--r--src/bun.js/node/buffer.zig4
-rw-r--r--src/bun.js/node/dir_iterator.zig4
-rw-r--r--src/bun.js/node/node.classes.ts156
-rw-r--r--src/bun.js/node/node_fs.zig259
-rw-r--r--src/bun.js/node/node_fs_binding.zig504
-rw-r--r--src/bun.js/node/node_os.zig2
-rw-r--r--src/bun.js/node/syscall.zig16
-rw-r--r--src/bun.js/node/types.zig230
-rw-r--r--src/bun.js/rare_data.zig4
-rw-r--r--src/bun.js/scripts/generate-classes.ts3
-rw-r--r--src/bun.js/test/jest.zig34
-rw-r--r--src/bun.js/unbounded_queue.zig6
-rw-r--r--src/bun.js/webcore.zig17
-rw-r--r--src/bun.js/webcore/encoding.zig52
-rw-r--r--src/bun.js/webcore/response.zig144
-rw-r--r--src/bun.js/webcore/streams.zig130
-rw-r--r--src/bun.zig99
-rw-r--r--src/bun_js.zig1
-rw-r--r--src/bun_redirect.zig2
-rw-r--r--src/bundler.zig6
-rw-r--r--src/bundler/entry_points.zig5
-rw-r--r--src/bundler/generate_node_modules_bundle.zig35
-rw-r--r--src/c.zig38
-rw-r--r--src/cli.zig5
-rw-r--r--src/cli/add_completions.zig2
-rw-r--r--src/cli/bun_command.zig6
-rw-r--r--src/cli/bunx_command.zig3
-rw-r--r--src/cli/colon_list_type.zig4
-rw-r--r--src/cli/create_command.zig34
-rw-r--r--src/cli/init_command.zig2
-rw-r--r--src/cli/install_completions_command.zig43
-rw-r--r--src/cli/package_manager_command.zig2
-rw-r--r--src/cli/run_command.zig6
-rw-r--r--src/cli/shell_completions.zig6
-rw-r--r--src/cli/test_command.zig8
-rw-r--r--src/cli/upgrade_command.zig22
-rw-r--r--src/comptime_string_map.zig4
-rw-r--r--src/copy_file.zig2
-rw-r--r--src/crash_reporter.zig2
-rw-r--r--src/css_scanner.zig2
-rw-r--r--src/darwin_c.zig17
-rw-r--r--src/defines.zig6
-rw-r--r--src/deps/boringssl.translated.zig546
-rw-r--r--src/deps/lol-html.zig26
-rw-r--r--src/deps/picohttp.zig2
m---------src/deps/uws0
-rw-r--r--src/deps/uws.zig165
-rw-r--r--src/deps/zig-clap/clap.zig18
-rw-r--r--src/deps/zig-clap/clap/args.zig2
-rw-r--r--src/deps/zig-clap/clap/comptime.zig8
-rw-r--r--src/deps/zig-datetime/src/datetime.zig2
m---------src/deps/zlib0
-rw-r--r--src/env.zig4
-rw-r--r--src/env_loader.zig12
-rw-r--r--src/fs.zig43
-rw-r--r--src/http.zig63
-rw-r--r--src/http/mime_type.zig4552
-rw-r--r--src/http/url_path.zig10
-rw-r--r--src/http/websocket.zig2
-rw-r--r--src/http/websocket_http_client.zig33
-rw-r--r--src/http_client_async.zig41
-rw-r--r--src/install/bin.zig24
-rw-r--r--src/install/bit_set.zig28
-rw-r--r--src/install/dependency.zig28
-rw-r--r--src/install/extract_tarball.zig12
-rw-r--r--src/install/install.zig326
-rw-r--r--src/install/integrity.zig8
-rw-r--r--src/install/lockfile.zig30
-rw-r--r--src/install/npm.zig57
-rw-r--r--src/install/resolution.zig6
-rw-r--r--src/install/resolvers/folder_resolver.zig2
-rw-r--r--src/install/semver.zig8
-rw-r--r--src/install/versioned_url.zig46
-rw-r--r--src/io/io_darwin.zig32
-rw-r--r--src/io/io_linux.zig52
-rw-r--r--src/js_ast.zig139
-rw-r--r--src/js_lexer.zig8
-rw-r--r--src/js_lexer/identifier_cache.zig8
-rw-r--r--src/js_parser.zig824
-rw-r--r--src/js_printer.zig66
-rw-r--r--src/json_parser.zig30
-rw-r--r--src/libarchive/libarchive-bindings.zig46
-rw-r--r--src/libarchive/libarchive.zig28
-rw-r--r--src/linker.zig62
-rw-r--r--src/linux_c.zig13
-rw-r--r--src/lock.zig2
-rw-r--r--src/logger.zig10
-rw-r--r--src/main.zig12
-rw-r--r--src/main_wasm.zig2
-rw-r--r--src/mdx/mdx_parser.zig6
-rw-r--r--src/memory_allocator.zig172
-rw-r--r--src/meta.zig2
-rw-r--r--src/mimalloc_arena.zig128
-rw-r--r--src/napi/napi.zig244
-rw-r--r--src/network_thread.zig2
-rw-r--r--src/node_fallbacks.zig46
-rw-r--r--src/node_module_bundle.zig5
-rw-r--r--src/options.zig31
-rw-r--r--src/output.zig14
-rw-r--r--src/panic_handler.zig6
-rw-r--r--src/ref_count.zig4
-rw-r--r--src/report.zig15
-rw-r--r--src/resolver/package_json.zig27
-rw-r--r--src/resolver/resolve_path.zig28
-rw-r--r--src/resolver/resolver.zig72
-rw-r--r--src/router.zig24
-rw-r--r--src/runtime.zig33
-rw-r--r--src/sha.zig6
-rw-r--r--src/sourcemap/sourcemap.zig12
-rw-r--r--src/sourcemap/vlq_bench.zig2
-rw-r--r--src/string_immutable.zig128
-rw-r--r--src/string_joiner.zig2
-rw-r--r--src/string_mutable.zig6
-rw-r--r--src/string_types.zig2
-rw-r--r--src/sync.zig11
-rw-r--r--src/tagged_pointer.zig14
-rw-r--r--src/tcc.zig6
-rw-r--r--src/thread_pool.zig4
-rw-r--r--src/toml/toml_lexer.zig2
-rw-r--r--src/url.zig78
-rw-r--r--src/walker_skippable.zig8
-rw-r--r--src/watcher.zig8
-rw-r--r--src/work_pool.zig2
-rw-r--r--src/zlib.zig4
-rw-r--r--test/bun.js/body-stream.test.ts9
-rw-r--r--test/bun.js/ffi.test.js507
-rw-r--r--test/bun.js/inline.macro.js10
-rw-r--r--test/bun.js/node-timers.test.ts15
-rw-r--r--test/bun.js/serve.test.ts880
188 files changed, 10257 insertions, 7295 deletions
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml
index 2efdf9780..941645c49 100644
--- a/.github/workflows/bun-linux-build.yml
+++ b/.github/workflows/bun-linux-build.yml
@@ -41,6 +41,7 @@ jobs:
runner: linux-amd64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec17/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
+ build_machine_arch: x86_64
- cpu: westmere
tag: linux-x64-baseline
arch: x86_64
@@ -48,6 +49,7 @@ jobs:
runner: linux-amd64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec17/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
+ build_machine_arch: x86_64
- cpu: native
tag: linux-aarch64
arch: aarch64
@@ -55,6 +57,7 @@ jobs:
runner: linux-arm64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec17/bun-webkit-linux-arm64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-arm64-lto"
+ build_machine_arch: aarch64
steps:
- uses: actions/checkout@v3
@@ -85,6 +88,7 @@ jobs:
build-args: |
ARCH=${{matrix.arch}}
BUILDARCH=${{matrix.build_arch}}
+ BUILD_MACHINE_ARCH=${{matrix.build_machine_arch}}
CPU_TARGET=${{matrix.cpu}}
WEBKIT_URL=${{matrix.webkit_url}}
GIT_SHA=${{github.sha}}
diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml
index 14b3cffca..00c15847c 100644
--- a/.github/workflows/bun-mac-aarch64.yml
+++ b/.github/workflows/bun-mac-aarch64.yml
@@ -68,6 +68,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
+ BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -85,6 +86,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
+ BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -163,11 +165,11 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
@@ -280,10 +282,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml
index ad344831d..96958e2bb 100644
--- a/.github/workflows/bun-mac-x64-baseline.yml
+++ b/.github/workflows/bun-mac-x64-baseline.yml
@@ -68,6 +68,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
+ BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -85,6 +86,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
+ BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -163,11 +165,11 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: ccache (dependencies)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.dependencies
@@ -281,10 +283,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install ccache rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: ccache (link)
uses: hendrikmuhs/ccache-action@v1.2
with:
diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml
index 1b02c4efa..547ff4629 100644
--- a/.github/workflows/bun-mac-x64.yml
+++ b/.github/workflows/bun-mac-x64.yml
@@ -68,6 +68,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
+ BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -85,6 +86,7 @@ jobs:
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
+ BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
@@ -163,10 +165,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: Download WebKit
if: matrix.compile_obj
env:
@@ -283,10 +285,10 @@ jobs:
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
- brew install rust ccache llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
+ brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
- echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
- brew link --overwrite llvm@13
+ echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
+ brew link --overwrite llvm@15
- name: Download WebKit
env:
CPU_TARGET: ${{ matrix.cpu }}
diff --git a/Dockerfile b/Dockerfile
index dce2766f1..23a8e1222 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,14 +7,18 @@ ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
ARG CPU_TARGET=native
ARG ARCH=x86_64
+ARG BUILD_MACHINE_ARCH=x86_64
ARG TRIPLET=${ARCH}-linux-gnu
ARG BUILDARCH=amd64
ARG WEBKIT_TAG=jul27-2
ARG ZIG_TAG=jul1
+ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
-ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
-ARG ZIG_URL="https://github.com/oven-sh/zig/releases/download/$ZIG_TAG/zig-linux-$BUILDARCH.zip"
+ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
+ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
+ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
+ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
ARG GIT_SHA=""
ARG BUN_BASE_VERSION=0.4
@@ -24,7 +28,7 @@ RUN install_packages ca-certificates curl wget lsb-release software-properties-c
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
- ./llvm.sh 13
+ ./llvm.sh 15
RUN install_packages \
cmake \
@@ -42,10 +46,11 @@ RUN install_packages \
rsync \
ruby \
unzip \
+ xz-utils \
bash tar gzip ccache
-ENV CXX=clang++-13
-ENV CC=clang-13
+ENV CXX=clang++-15
+ENV CC=clang-15
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
install_packages nodejs && \
@@ -62,13 +67,15 @@ ARG BUILDARCH
ARG ZIG_PATH
ARG WEBKIT_URL
ARG ZIG_URL
+ARG ZIG_FOLDERNAME
+ARG ZIG_FILENAME
ENV WEBKIT_OUT_DIR=${WEBKIT_DIR}
ENV BUILDARCH=${BUILDARCH}
-ENV AR=/usr/bin/llvm-ar-13
+ENV AR=/usr/bin/llvm-ar-15
ENV ZIG "${ZIG_PATH}/zig"
ENV PATH="$ZIG/bin:$PATH"
-ENV LD=lld-13
+ENV LD=lld-15
RUN mkdir -p $BUN_DIR $BUN_DEPS_OUT_DIR
@@ -77,8 +84,8 @@ FROM bun-base as bun-base-with-zig-and-webkit
WORKDIR $GITHUB_WORKSPACE
ADD $ZIG_URL .
-RUN unzip -q zig-linux-$BUILDARCH.zip && \
- rm zig-linux-$BUILDARCH.zip;
+RUN tar xf ${ZIG_FILENAME} && \
+ rm ${ZIG_FILENAME} && mv ${ZIG_FOLDERNAME} zig;
@@ -123,7 +130,7 @@ COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
ENV CCACHE_DIR=/ccache
-RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-13) && cd ${BUN_DIR} && \
+RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-15) && cd ${BUN_DIR} && \
make lolhtml && rm -rf src/deps/lol-html Makefile
FROM bun-base as mimalloc
@@ -344,11 +351,12 @@ ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
+COPY ./root.zig ${BUN_DIR}/root.zig
COPY ./src ${BUN_DIR}/src
COPY ./build.zig ${BUN_DIR}/build.zig
COPY ./completions ${BUN_DIR}/completions
COPY ./packages ${BUN_DIR}/packages
-COPY ./build-id ${BUN_DIR}/build-id
+COPY ./src/build-id ${BUN_DIR}/src/build-id
COPY ./package.json ${BUN_DIR}/package.json
COPY ./misctools ${BUN_DIR}/misctools
COPY Makefile ${BUN_DIR}/Makefile
@@ -386,14 +394,14 @@ ENV GIT_SHA=${GIT_SHA}
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
-COPY ./build-id ${BUN_DIR}/build-id
+COPY ./src/build-id ${BUN_DIR}/src/build-id
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
mkdir -p $BUN_RELEASE_DIR && \
- OUTPUT_DIR=/tmp $ZIG_PATH/zig build obj -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
- cp /tmp/bun.o /tmp/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/build-id).o && cd / && rm -rf $BUN_DIR
+ OUTPUT_DIR=/tmp/bun-${TRIPLET}-${GIT_SHA} $ZIG_PATH/zig build obj -Doutput-dir=/tmp/bun-${TRIPLET}-${GIT_SHA} -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
+ cp /tmp/bun-${TRIPLET}-${GIT_SHA}/bun.o /tmp/bun-${TRIPLET}-${GIT_SHA}/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/src/build-id).o && cd / && rm -rf $BUN_DIR
FROM scratch as build_release_obj
@@ -404,12 +412,13 @@ ARG ZIG_PATH
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
+ARG GIT_SHA
+ARG TRIPLET
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
-
-COPY --from=compile_release_obj /tmp/*.o /
+COPY --from=compile_release_obj /tmp/bun-${TRIPLET}-${GIT_SHA}/*.o /
FROM prepare_release as compile_cpp
diff --git a/Dockerfile.devcontainer b/Dockerfile.devcontainer
index 2677fc4ff..9dfe9b7aa 100644
--- a/Dockerfile.devcontainer
+++ b/Dockerfile.devcontainer
@@ -1,12 +1,14 @@
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG BUILDARCH=amd64
+ARG ARCH=x86_64
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
ARG BUN_PACKAGES_DIR=${BUN_DIR}/packages
+ARG ZIG_URL="https://ziglang.org/builds/zig-${ARCH}-${ZIG_VERSION}.zip"
FROM --platform=linux/${BUILDARCH} ubuntu:22.04 as bun.devcontainer
diff --git a/Makefile b/Makefile
index f23f0ad01..cb84d859f 100644
--- a/Makefile
+++ b/Makefile
@@ -54,12 +54,12 @@ DEBUG_PACKAGE_DIR = $(PACKAGES_REALPATH)/debug-$(PACKAGE_NAME)
RELEASE_BUN = $(PACKAGE_DIR)/bun
DEBUG_BIN = $(DEBUG_PACKAGE_DIR)/
DEBUG_BUN = $(DEBUG_BIN)/bun-debug
-BUILD_ID = $(shell cat ./build-id)
+BUILD_ID = $(shell cat ./src/build-id)
PACKAGE_JSON_VERSION = $(BUN_BASE_VERSION).$(BUILD_ID)
BUN_BUILD_TAG = bun-v$(PACKAGE_JSON_VERSION)
BUN_RELEASE_BIN = $(PACKAGE_DIR)/bun
PRETTIER ?= $(shell which prettier || echo "./node_modules/.bin/prettier")
-DSYMUTIL ?= $(shell which dsymutil || which dsymutil-13)
+DSYMUTIL ?= $(shell which dsymutil || which dsymutil-15)
WEBKIT_DIR ?= $(realpath src/bun.js/WebKit)
WEBKIT_RELEASE_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Release
WEBKIT_DEBUG_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Debug
@@ -74,8 +74,8 @@ ZIG ?= $(shell which zig || echo -e "error: Missing zig. Please make sure zig is
# This is easier to happen than you'd expect.
# Using realpath here causes issues because clang uses clang++ as a symlink
# so if that's resolved, it won't build for C++
-REAL_CC = $(shell which clang-13 || which clang)
-REAL_CXX = $(shell which clang++-13 || which clang++)
+REAL_CC = $(shell which clang-15 || which clang)
+REAL_CXX = $(shell which clang++-15 || which clang++)
CC = $(REAL_CC)
CXX = $(REAL_CXX)
@@ -99,14 +99,14 @@ CC_WITH_CCACHE = $(CCACHE_PATH) $(CC)
ifeq ($(OS_NAME),darwin)
# Find LLVM
ifeq ($(wildcard $(LLVM_PREFIX)),)
- LLVM_PREFIX = $(shell brew --prefix llvm@13)
+ LLVM_PREFIX = $(shell brew --prefix llvm@15)
endif
ifeq ($(wildcard $(LLVM_PREFIX)),)
LLVM_PREFIX = $(shell brew --prefix llvm)
endif
ifeq ($(wildcard $(LLVM_PREFIX)),)
# This is kinda ugly, but I can't find a better way to error :(
- LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@13' or set LLVM_PREFIX=/path/to/llvm")
+ LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@15' or set LLVM_PREFIX=/path/to/llvm")
endif
LDFLAGS += -L$(LLVM_PREFIX)/lib
@@ -160,7 +160,7 @@ endif
ifeq ($(OS_NAME),linux)
LIBICONV_PATH =
-AR = $(shell which llvm-ar-13 || which llvm-ar || which ar)
+AR = $(shell which llvm-ar-15 || which llvm-ar || which ar)
endif
OPTIMIZATION_LEVEL=-O3 $(MARCH_NATIVE)
@@ -250,7 +250,7 @@ STRIP=/usr/bin/strip
endif
ifeq ($(OS_NAME),linux)
-STRIP=$(shell which llvm-strip || which llvm-strip-13 || which strip || echo "Missing strip")
+STRIP=$(shell which llvm-strip || which llvm-strip-15 || which strip || echo "Missing strip")
endif
@@ -622,7 +622,7 @@ endif
.PHONY: require
require:
@echo "Checking if the required utilities are available..."
- @if [ $(CLANG_VERSION) -lt "13" ]; then echo -e "ERROR: clang version >=13 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@13"; exit 1; fi
+ @if [ $(CLANG_VERSION) -lt "15" ]; then echo -e "ERROR: clang version >=15 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@15"; exit 1; fi
@cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1)
@esbuild --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
@$(NPM_CLIENT) --version >/dev/null 2>&1 || (echo -e "ERROR: NPM client (bun or npm) is required."; exit 1)
@@ -1420,6 +1420,7 @@ bun-link-lld-debug:
$(DEBUG_BIN)/bun-debug.o \
-W \
-o $(DEBUG_BIN)/bun-debug
+ rm -f $(DEBUG_BIN)/bun-debug.o.o 2> /dev/null # workaround for https://github.com/ziglang/zig/issues/14080
bun-link-lld-debug-no-jsc:
$(CXX) $(BUN_LLD_FLAGS_WITHOUT_JSC) $(SYMBOLS) \
@@ -1448,6 +1449,7 @@ bun-link-lld-release:
$(OPTIMIZATION_LEVEL) $(RELEASE_FLAGS)
rm -rf $(BUN_RELEASE_BIN).dSYM
cp $(BUN_RELEASE_BIN) $(BUN_RELEASE_BIN)-profile
+ rm -f $(BUN_RELEASE_BIN).o.o # workaround for https://github.com/ziglang/zig/issues/14080
bun-release-copy-obj:
cp $(BUN_RELEASE_BIN).o $(BUN_DEPLOY_DIR).o
diff --git a/README.md b/README.md
index a626ca370..63ea5b584 100644
--- a/README.md
+++ b/README.md
@@ -5048,15 +5048,15 @@ It is very similar to my own development environment (except I use macOS)
### MacOS
-Install LLVM 13 and homebrew dependencies:
+Install LLVM 15 and homebrew dependencies:
```bash
-brew install llvm@13 coreutils libtool cmake libiconv automake ninja gnu-sed pkg-config esbuild go rust
+brew install llvm@15 coreutils libtool cmake libiconv automake ninja gnu-sed pkg-config esbuild go rust
```
-bun (& the version of Zig) need LLVM 13 and Clang 13 (clang is part of LLVM). Weird build & runtime errors will happen otherwise.
+bun (& the version of Zig) need LLVM 15 and Clang 13 (clang is part of LLVM). Weird build & runtime errors will happen otherwise.
-Make sure LLVM 13 is in your `$PATH`:
+Make sure LLVM 15 is in your `$PATH`:
```bash
which clang-13
@@ -5065,12 +5065,12 @@ which clang-13
If it is not, you will have to run this to link it:
```bash
-export PATH="$(brew --prefix llvm@13)/bin:$HOME/.bun-tools/zig:$PATH"
-export LDFLAGS="$LDFLAGS -L$(brew --prefix llvm@13)/lib"
-export CPPFLAGS="$CPPFLAGS -I$(brew --prefix llvm@13)/include"
+export PATH="$(brew --prefix llvm@15)/bin:$HOME/.bun-tools/zig:$PATH"
+export LDFLAGS="$LDFLAGS -L$(brew --prefix llvm@15)/lib"
+export CPPFLAGS="$CPPFLAGS -I$(brew --prefix llvm@15)/include"
```
-On fish that looks like `fish_add_path (brew --prefix llvm@13)/bin`
+On fish that looks like `fish_add_path (brew --prefix llvm@15)/bin`
#### Install Zig (macOS)
diff --git a/build.zig b/build.zig
index 3049a092b..195570c1c 100644
--- a/build.zig
+++ b/build.zig
@@ -1,18 +1,21 @@
const std = @import("std");
-const resolve_path = @import("./src/resolver/resolve_path.zig");
fn pkgPath(comptime out: []const u8) std.build.FileSource {
- const outpath = comptime std.fs.path.dirname(@src().file).? ++ std.fs.path.sep_str ++ out;
- return .{ .path = outpath };
+ if (comptime std.fs.path.dirname(@src().file)) |base| {
+ const outpath = comptime base ++ std.fs.path.sep_str ++ out;
+ return .{ .path = outpath };
+ } else {
+ return .{ .path = out };
+ }
}
pub fn addPicoHTTP(step: *std.build.LibExeObjStep, comptime with_obj: bool) void {
- step.addIncludeDir("src/deps");
+ step.addIncludePath("src/deps");
if (with_obj) {
step.addObjectFile("src/deps/picohttpparser.o");
}
- step.addIncludeDir("src/deps");
+ step.addIncludePath("src/deps");
if (with_obj) {
step.addObjectFile(panicIfNotFound("src/deps/picohttpparser.o"));
@@ -80,10 +83,8 @@ fn addInternalPackages(step: *std.build.LibExeObjStep, _: std.mem.Allocator, tar
javascript_core_stub
else
javascript_core_real;
- io.dependencies = &[_]std.build.Pkg{bun};
- javascript_core.dependencies = &[_]std.build.Pkg{bun};
+ javascript_core.dependencies = &[_]std.build.Pkg{};
step.addPackage(io);
- step.addPackage(javascript_core);
step.addPackage(bun);
}
@@ -93,6 +94,7 @@ const BunBuildOptions = struct {
baseline: bool = false,
bindgen: bool = false,
sizegen: bool = false,
+ base_path: [:0]const u8 = "",
pub fn step(this: BunBuildOptions, b: anytype) *std.build.OptionsStep {
var opts = b.addOptions();
@@ -101,6 +103,7 @@ const BunBuildOptions = struct {
opts.addOption(@TypeOf(this.baseline), "baseline", this.baseline);
opts.addOption(@TypeOf(this.bindgen), "bindgen", this.bindgen);
opts.addOption(@TypeOf(this.sizegen), "sizegen", this.sizegen);
+ opts.addOption(@TypeOf(this.base_path), "base_path", this.base_path);
return opts;
}
};
@@ -115,6 +118,18 @@ fn panicIfNotFound(comptime filepath: []const u8) []const u8 {
return filepath;
}
+const fmt = struct {
+ pub usingnamespace @import("std").fmt;
+
+ pub fn hexInt(value: anytype) @TypeOf(std.fmt.fmtSliceHexLower("")) {
+ return std.fmt.fmtSliceHexLower(std.mem.asBytes(&value));
+ }
+
+ pub fn hexIntUp(value: anytype) @TypeOf(std.fmt.fmtSliceHexUpper("")) {
+ return std.fmt.fmtSliceHexUpper(std.mem.asBytes(&value));
+ }
+};
+
fn updateRuntime() anyerror!void {
var runtime_out_file = try std.fs.cwd().openFile("src/runtime.out.js", .{ .mode = .read_only });
const runtime_hash = std.hash.Wyhash.hash(
@@ -123,7 +138,7 @@ fn updateRuntime() anyerror!void {
);
const runtime_version_file = std.fs.cwd().createFile("src/runtime.version", .{ .truncate = true }) catch std.debug.panic("Failed to create src/runtime.version", .{});
defer runtime_version_file.close();
- runtime_version_file.writer().print("{x}", .{runtime_hash}) catch unreachable;
+ runtime_version_file.writer().print("{any}", .{fmt.hexInt(runtime_hash)}) catch unreachable;
var fallback_out_file = try std.fs.cwd().openFile("src/fallback.out.js", .{ .mode = .read_only });
const fallback_hash = std.hash.Wyhash.hash(
0,
@@ -132,7 +147,7 @@ fn updateRuntime() anyerror!void {
const fallback_version_file = std.fs.cwd().createFile("src/fallback.version", .{ .truncate = true }) catch std.debug.panic("Failed to create src/fallback.version", .{});
- fallback_version_file.writer().print("{x}", .{fallback_hash}) catch unreachable;
+ fallback_version_file.writer().print("{any}", .{fmt.hexInt(fallback_hash)}) catch unreachable;
fallback_version_file.close();
}
@@ -155,7 +170,6 @@ pub fn build(b: *std.build.Builder) !void {
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
mode = b.standardReleaseOptions();
- var exe: *std.build.LibExeObjStep = undefined;
var output_dir_buf = std.mem.zeroes([4096]u8);
var bin_label = if (mode == std.builtin.Mode.Debug) "packages/debug-bun-" else "packages/bun-";
@@ -192,8 +206,8 @@ pub fn build(b: *std.build.Builder) !void {
var triplet = triplet_buf[0 .. osname.len + cpuArchName.len + 1];
- if (std.os.getenv("OUTPUT_DIR")) |output_dir_| {
- output_dir = output_dir_;
+ if (b.option([]const u8, "output-dir", "target to install to") orelse std.os.getenv("OUTPUT_DIR")) |output_dir_| {
+ output_dir = b.pathFromRoot(output_dir_);
} else {
const output_dir_base = try std.fmt.bufPrint(&output_dir_buf, "{s}{s}", .{ bin_label, triplet });
output_dir = b.pathFromRoot(output_dir_base);
@@ -201,21 +215,13 @@ pub fn build(b: *std.build.Builder) !void {
std.fs.cwd().makePath(output_dir) catch {};
const bun_executable_name = if (mode == std.builtin.Mode.Debug) "bun-debug" else "bun";
- exe = b.addExecutable(bun_executable_name, if (target.getOsTag() == std.Target.Os.Tag.freestanding)
+ const root_src = if (target.getOsTag() == std.Target.Os.Tag.freestanding)
"src/main_wasm.zig"
else
- "src/main.zig");
- // exe.setLibCFile("libc.txt");
- exe.linkLibC();
- // exe.linkLibCpp();
+ "root.zig";
- exe.setOutputDir(output_dir);
updateRuntime() catch {};
- exe.setTarget(target);
- exe.setBuildMode(mode);
- b.install_path = output_dir;
-
const min_version: std.builtin.Version = if (target.getOsTag() != .freestanding)
target.getOsVersionMin().semver
else .{ .major = 0, .minor = 0, .patch = 0 };
@@ -224,20 +230,9 @@ pub fn build(b: *std.build.Builder) !void {
target.getOsVersionMax().semver
else .{ .major = 0, .minor = 0, .patch = 0 };
- // exe.want_lto = true;
- defer b.default_step.dependOn(&b.addLog("Output: {s}/{s}\n", .{ output_dir, bun_executable_name }).step);
- defer b.default_step.dependOn(&b.addLog(
- "Build {s} v{} - v{}\n",
- .{
- triplet,
- min_version,
- max_version,
- },
- ).step);
-
var obj_step = b.step("obj", "Build bun as a .o file");
- var obj = b.addObject(bun_executable_name, exe.root_src.?.path);
-
+ obj_step.dependOn(&b.addLog("Output: {s}/{s}\n", .{ output_dir, bun_executable_name }).step);
+ var obj = b.addObject(bun_executable_name, root_src);
var default_build_options: BunBuildOptions = brk: {
const is_baseline = arch.isX86() and (target.cpu_model == .baseline or
!std.Target.x86.featureSetHas(target.getCpuFeatures(), .avx2));
@@ -272,6 +267,7 @@ pub fn build(b: *std.build.Builder) !void {
.sha = git_sha,
.baseline = is_baseline,
.bindgen = false,
+ .base_path = try b.allocator.dupeZ(u8, b.pathFromRoot(".")),
};
};
@@ -308,9 +304,8 @@ pub fn build(b: *std.build.Builder) !void {
).step);
}
- obj_step.dependOn(&obj.step);
+ defer obj_step.dependOn(&obj.step);
- obj.setOutputDir(output_dir);
obj.setBuildMode(mode);
var actual_build_options = default_build_options;
@@ -327,8 +322,6 @@ pub fn build(b: *std.build.Builder) !void {
obj.bundle_compiler_rt = true;
obj.omit_frame_pointer = mode != .Debug;
- b.default_step.dependOn(&obj.step);
-
if (target.getOsTag() == .linux) {
// obj.want_lto = tar;
obj.link_emit_relocs = true;
@@ -344,7 +337,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("headers-obj", "Build JavaScriptCore headers");
var headers_obj: *std.build.LibExeObjStep = b.addObject("headers", "src/bindgen.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
var headers_build_options = default_build_options;
headers_build_options.bindgen = true;
headers_obj.addOptions("build_options", default_build_options.step(b));
@@ -359,14 +352,14 @@ pub fn build(b: *std.build.Builder) !void {
// wasm_step.link_function_sections = true;
// wasm_step.link_emit_relocs = true;
// wasm_step.single_threaded = true;
- try configureObjectStep(b, wasm_step, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, wasm_step, @TypeOf(target), target, obj.main_pkg_path.?);
}
{
const headers_step = b.step("httpbench-obj", "Build HTTPBench tool (object files)");
var headers_obj: *std.build.LibExeObjStep = b.addObject("httpbench", "misctools/http_bench.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -374,7 +367,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("machbench-obj", "Build Machbench tool (object files)");
var headers_obj: *std.build.LibExeObjStep = b.addObject("machbench", "misctools/machbench.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -382,7 +375,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("fetch-obj", "Build fetch (object files)");
var headers_obj: *std.build.LibExeObjStep = b.addObject("fetch", "misctools/fetch.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -390,7 +383,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("string-bench", "Build string bench");
var headers_obj: *std.build.LibExeObjStep = b.addExecutable("string-bench", "src/bench/string-handling.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -398,7 +391,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("sha-bench-obj", "Build sha bench");
var headers_obj: *std.build.LibExeObjStep = b.addObject("sha", "src/sha.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -406,7 +399,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("vlq-bench", "Build vlq bench");
var headers_obj: *std.build.LibExeObjStep = b.addExecutable("vlq-bench", "src/sourcemap/vlq_bench.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -414,7 +407,7 @@ pub fn build(b: *std.build.Builder) !void {
const headers_step = b.step("tgz-obj", "Build tgz (object files)");
var headers_obj: *std.build.LibExeObjStep = b.addObject("tgz", "misctools/tgz.zig");
defer headers_step.dependOn(&headers_obj.step);
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
headers_obj.addOptions("build_options", default_build_options.step(b));
}
@@ -432,7 +425,7 @@ pub fn build(b: *std.build.Builder) !void {
if (std.fs.path.dirname(test_bin)) |dir| headers_obj.setOutputDir(dir);
}
- try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?);
try linkObjectFiles(b, headers_obj, target);
{
@@ -451,7 +444,7 @@ pub fn build(b: *std.build.Builder) !void {
test_.setMainPkgPath(obj.main_pkg_path.?);
test_.setTarget(target);
- try configureObjectStep(b, test_, target, obj.main_pkg_path.?);
+ try configureObjectStep(b, test_, @TypeOf(target), target, obj.main_pkg_path.?);
try linkObjectFiles(b, test_, target);
test_.addOptions("build_options", default_build_options.step(b));
@@ -467,9 +460,11 @@ pub fn build(b: *std.build.Builder) !void {
headers_step.dependOn(&after.step);
}
}
+ obj.setOutputDir(output_dir);
+ b.default_step.dependOn(obj_step);
}
-pub var original_make_fn: ?fn (step: *std.build.Step) anyerror!void = null;
+pub var original_make_fn: ?*const fn (step: *std.build.Step) anyerror!void = null;
// Due to limitations in std.build.Builder
// we cannot use this with debugging
@@ -514,13 +509,13 @@ pub fn linkObjectFiles(b: *std.build.Builder, obj: *std.build.LibExeObjStep, tar
});
for (dirs_to_search.slice()) |deps_path| {
- var deps_dir = std.fs.cwd().openDir(deps_path, .{ .iterate = true }) catch continue;
+ var deps_dir = std.fs.cwd().openIterableDir(deps_path, .{}) catch continue;
var iterator = deps_dir.iterate();
- obj.addIncludeDir(deps_path);
- obj.addLibPath(deps_path);
+ obj.addIncludePath(deps_path);
+ obj.addLibraryPath(deps_path);
while (iterator.next() catch null) |entr| {
- const entry: std.fs.Dir.Entry = entr;
+ const entry: std.fs.IterableDir.Entry = entr;
if (files_we_care_about.get(entry.name)) |obj_name| {
var has_added = try added.getOrPut(std.hash.Wyhash.hash(0, obj_name));
if (!has_added.found_existing) {
@@ -532,7 +527,7 @@ pub fn linkObjectFiles(b: *std.build.Builder, obj: *std.build.LibExeObjStep, tar
}
}
-pub fn configureObjectStep(_: *std.build.Builder, obj: *std.build.LibExeObjStep, target: anytype, main_pkg_path: []const u8) !void {
+pub fn configureObjectStep(_: *std.build.Builder, obj: *std.build.LibExeObjStep, comptime Target: type, target: Target, main_pkg_path: []const u8) !void {
obj.setMainPkgPath(main_pkg_path);
obj.setTarget(target);
@@ -541,10 +536,13 @@ pub fn configureObjectStep(_: *std.build.Builder, obj: *std.build.LibExeObjStep,
addPicoHTTP(obj, false);
obj.strip = false;
+
obj.setOutputDir(output_dir);
obj.setBuildMode(mode);
+ obj.bundle_compiler_rt = true;
+
if (target.getOsTag() != .freestanding) obj.linkLibC();
- if (target.getOsTag() != .freestanding) obj.bundle_compiler_rt = true;
+ if (target.getOsTag() != .freestanding) obj.bundle_compiler_rt = false;
if (target.getOsTag() == .linux) {
// obj.want_lto = tar;
diff --git a/bun.lockb b/bun.lockb
index 78764f777..bfa5bce68 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/misctools/headers-cleaner.js b/misctools/headers-cleaner.js
index 850cc3196..0f003cc5c 100644
--- a/misctools/headers-cleaner.js
+++ b/misctools/headers-cleaner.js
@@ -33,6 +33,17 @@ input = keep + input.slice(first_extern_line, last_extern_fn_line);
input = input.replaceAll("*WebCore__", "*bindings.");
input = input.replaceAll("*JSC__", "*bindings.");
input = input.replaceAll("[*c] JSC__", "[*c]bindings.");
+input = input.replaceAll("[*c]JSC__", "[*c]bindings.");
+input = input.replaceAll(
+ "[*c]bindings.JSGlobalObject",
+ "*bindings.JSGlobalObject",
+);
+input = input.replaceAll("[*c]bindings.JSPromise", "?*bindings.JSPromise");
+input = input.replaceAll(
+ "[*c]const bindings.JSPromise",
+ "?*const bindings.JSPromise",
+);
+
input = input.replaceAll("[*c] const JSC__", "[*c]const bindings.");
input = input.replaceAll(
"[*c]Inspector__ScriptArguments",
@@ -43,6 +54,10 @@ input = input
.replaceAll("VirtualMachine", "bindings.VirtualMachine")
.replaceAll("bindings.bindings.VirtualMachine", "bindings.VirtualMachine");
+input = input.replaceAll("?*JSC__JSGlobalObject", "*bindings.JSGlobalObject");
+input = input.replaceAll("?*bindings.CallFrame", "*bindings.CallFrame");
+input = input.replaceAll("[*c]bindings.VM", "*bindings.VM");
+
const hardcode = {
"[*c][*c]JSC__Exception": "*?*JSC__Exception ",
"[*c]?*anyopaque": "[*c]*anyopaque",
diff --git a/misctools/http_bench.zig b/misctools/http_bench.zig
index 4985d8e84..84fa29600 100644
--- a/misctools/http_bench.zig
+++ b/misctools/http_bench.zig
@@ -252,8 +252,8 @@ pub fn main() anyerror!void {
fail_count += 1;
}
- max_duration = @maximum(max_duration, http.elapsed);
- min_duration = @minimum(min_duration, http.elapsed);
+ max_duration = @max(max_duration, http.elapsed);
+ min_duration = @min(min_duration, http.elapsed);
switch (resp.status_code) {
200, 202, 302 => {
diff --git a/package.json b/package.json
index fc5d5eabc..4ec3c8ac2 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"dependencies": {
"express": "^4.18.2",
"mitata": "^0.1.3",
- "peechy": "0.4.32",
+ "peechy": "latest",
"react": "next",
"react-dom": "next"
},
diff --git a/root.zig b/root.zig
new file mode 100644
index 000000000..607511882
--- /dev/null
+++ b/root.zig
@@ -0,0 +1,16 @@
+pub usingnamespace @import("src/main.zig");
+pub const content = struct {
+ pub const error_js_path = "packages/bun-error/dist/index.js";
+ pub const error_js = @embedFile(error_js_path);
+
+ pub const error_css_path = "packages/bun-error/dist/bun-error.css";
+ pub const error_css_path_dev = "packages/bun-error/bun-error.css";
+
+ pub const error_css = @embedFile(error_css_path);
+};
+
+pub const completions = struct {
+ pub const bash = @embedFile("./completions/bun.bash");
+ pub const zsh = @embedFile("./completions/bun.zsh");
+ pub const fish = @embedFile("./completions/bun.fish");
+};
diff --git a/src/__global.zig b/src/__global.zig
index 22b676403..b11b1ac22 100644
--- a/src/__global.zig
+++ b/src/__global.zig
@@ -8,7 +8,7 @@ const Mimalloc = @import("bun").Mimalloc;
const BASE_VERSION = "0.4";
-pub const build_id = std.fmt.parseInt(u64, std.mem.trim(u8, @embedFile("../build-id"), "\n \r\t"), 10) catch unreachable;
+pub const build_id = std.fmt.parseInt(u64, std.mem.trim(u8, @embedFile("./build-id"), "\n \r\t"), 10) catch unreachable;
pub const package_json_version = if (Environment.isDebug)
std.fmt.comptimePrint(BASE_VERSION ++ ".{d}_debug", .{build_id})
else
@@ -17,9 +17,9 @@ else
pub const package_json_version_with_sha = if (Environment.git_sha.len == 0)
package_json_version
else if (Environment.isDebug)
- std.fmt.comptimePrint(BASE_VERSION ++ ".{d}_debug ({s})", .{ build_id, Environment.git_sha[0..@minimum(Environment.git_sha.len, 8)] })
+ std.fmt.comptimePrint(BASE_VERSION ++ ".{d}_debug ({s})", .{ build_id, Environment.git_sha[0..@min(Environment.git_sha.len, 8)] })
else
- std.fmt.comptimePrint(BASE_VERSION ++ ".{d} ({s})", .{ build_id, Environment.git_sha[0..@minimum(Environment.git_sha.len, 8)] });
+ std.fmt.comptimePrint(BASE_VERSION ++ ".{d} ({s})", .{ build_id, Environment.git_sha[0..@min(Environment.git_sha.len, 8)] });
pub const os_name = if (Environment.isWindows)
"win32"
diff --git a/src/allocators.zig b/src/allocators.zig
index 4d300c0eb..e7890eb98 100644
--- a/src/allocators.zig
+++ b/src/allocators.zig
@@ -318,7 +318,7 @@ pub fn BSSStringList(comptime _count: usize, comptime _item_length: usize) type
}
pub fn appendMutable(self: *Self, comptime AppendType: type, _value: AppendType) ![]u8 {
- const appended = try @call(.{ .modifier = .always_inline }, append, .{ self, AppendType, _value });
+ const appended = try @call(.always_inline, append, .{ self, AppendType, _value });
return constStrToU8(appended);
}
@@ -451,7 +451,7 @@ pub fn BSSStringList(comptime _count: usize, comptime _item_length: usize) type
};
}
-pub fn BSSMap(comptime ValueType: type, comptime count: anytype, store_keys: bool, estimated_key_length: usize, remove_trailing_slashes: bool) type {
+pub fn BSSMap(comptime ValueType: type, comptime count: anytype, comptime store_keys: bool, comptime estimated_key_length: usize, comptime remove_trailing_slashes: bool) type {
const max_index = count - 1;
const BSSMapType = struct {
const Allocator = std.mem.Allocator;
@@ -634,11 +634,11 @@ pub fn BSSMap(comptime ValueType: type, comptime count: anytype, store_keys: boo
return try self.map.getOrPut(key);
}
pub fn get(self: *Self, key: []const u8) ?*ValueType {
- return @call(.{ .modifier = .always_inline }, BSSMapType.get, .{ self.map, key });
+ return @call(.always_inline, BSSMapType.get, .{ self.map, key });
}
pub fn atIndex(self: *Self, index: IndexType) ?*ValueType {
- return @call(.{ .modifier = .always_inline }, BSSMapType.atIndex, .{ self.map, index });
+ return @call(.always_inline, BSSMapType.atIndex, .{ self.map, index });
}
pub fn keyAtIndex(_: *Self, index: IndexType) ?[]const u8 {
diff --git a/src/allocators/mimalloc.zig b/src/allocators/mimalloc.zig
index 5d8d7f2e3..fbefe6c95 100644
--- a/src/allocators/mimalloc.zig
+++ b/src/allocators/mimalloc.zig
@@ -14,11 +14,11 @@ pub extern fn mi_reallocn(p: ?*anyopaque, count: usize, size: usize) ?*anyopaque
pub extern fn mi_reallocf(p: ?*anyopaque, newsize: usize) ?*anyopaque;
pub extern fn mi_usable_size(p: ?*const anyopaque) usize;
pub extern fn mi_good_size(size: usize) usize;
-pub const mi_deferred_free_fun = fn (bool, c_ulonglong, ?*anyopaque) callconv(.C) void;
+pub const mi_deferred_free_fun = *const fn (bool, c_ulonglong, ?*anyopaque) callconv(.C) void;
pub extern fn mi_register_deferred_free(deferred_free: ?mi_deferred_free_fun, arg: ?*anyopaque) void;
-pub const mi_output_fun = fn ([*:0]const u8, ?*anyopaque) callconv(.C) void;
+pub const mi_output_fun = *const fn ([*:0]const u8, ?*anyopaque) callconv(.C) void;
pub extern fn mi_register_output(out: ?mi_output_fun, arg: ?*anyopaque) void;
-pub const mi_error_fun = fn (c_int, ?*anyopaque) callconv(.C) void;
+pub const mi_error_fun = *const fn (c_int, ?*anyopaque) callconv(.C) void;
pub extern fn mi_register_error(fun: ?mi_error_fun, arg: ?*anyopaque) void;
pub extern fn mi_collect(force: bool) void;
pub extern fn mi_version() c_int;
@@ -118,7 +118,7 @@ pub const struct_mi_heap_area_s = extern struct {
full_block_size: usize,
};
pub const mi_heap_area_t = struct_mi_heap_area_s;
-pub const mi_block_visit_fun = fn (?*const Heap, [*c]const mi_heap_area_t, ?*anyopaque, usize, ?*anyopaque) callconv(.C) bool;
+pub const mi_block_visit_fun = *const fn (?*const Heap, [*c]const mi_heap_area_t, ?*anyopaque, usize, ?*anyopaque) callconv(.C) bool;
pub extern fn mi_heap_visit_blocks(heap: ?*const Heap, visit_all_blocks: bool, visitor: ?mi_block_visit_fun, arg: ?*anyopaque) bool;
pub extern fn mi_is_in_heap_region(p: ?*const anyopaque) bool;
pub extern fn mi_is_redirected() bool;
@@ -201,3 +201,13 @@ pub extern fn mi_new_reallocn(p: ?*anyopaque, newcount: usize, size: usize) ?*an
pub const MI_SMALL_WSIZE_MAX = @as(c_int, 128);
pub const MI_SMALL_SIZE_MAX = MI_SMALL_WSIZE_MAX * @import("std").zig.c_translation.sizeof(?*anyopaque);
pub const MI_ALIGNMENT_MAX = (@as(c_int, 16) * @as(c_int, 1024)) * @as(c_ulong, 1024);
+
+const std = @import("std");
+pub fn canUseAlignedAlloc(len: usize, alignment: usize) bool {
+ return alignment > 0 and std.math.isPowerOfTwo(alignment) and !mi_malloc_satisfies_alignment(alignment, len);
+}
+const MI_MAX_ALIGN_SIZE = 16;
+inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool {
+ return (alignment == @sizeOf(*anyopaque) or
+ (alignment == MI_MAX_ALIGN_SIZE and size >= (MI_MAX_ALIGN_SIZE / 2)));
+}
diff --git a/src/analytics/analytics_schema.zig b/src/analytics/analytics_schema.zig
index b9d074249..825735331 100644
--- a/src/analytics/analytics_schema.zig
+++ b/src/analytics/analytics_schema.zig
@@ -17,7 +17,7 @@ pub const Reader = struct {
}
pub fn read(this: *Self, count: usize) ![]u8 {
- const read_count = @minimum(count, this.remain.len);
+ const read_count = @min(count, this.remain.len);
if (read_count < count) {
return error.EOF;
}
@@ -58,7 +58,7 @@ pub const Reader = struct {
return E.InvalidValue;
}
- pub inline fn readArray(this: *Self, comptime T: type) ![]const T {
+ pub fn readArray(this: *Self, comptime T: type) ![]const T {
const length = try this.readInt(u32);
if (length == 0) {
return &([_]T{});
@@ -156,7 +156,7 @@ pub const Reader = struct {
.Packed => {
const sizeof = @sizeOf(T);
var slice = try this.read(sizeof);
- return @ptrCast(*T, slice[0..sizeof]).*;
+ return @ptrCast(*align(1) T, slice[0..sizeof]).*;
},
else => {},
}
@@ -263,7 +263,7 @@ pub fn Writer(comptime WritableStream: type) type {
}
}
- pub inline fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
+ pub fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
try this.writeInt(@truncate(u32, slice.len));
switch (T) {
diff --git a/src/api/demo/schema.zig b/src/api/demo/schema.zig
index 61d6b82d1..e4871b902 100644
--- a/src/api/demo/schema.zig
+++ b/src/api/demo/schema.zig
@@ -17,7 +17,7 @@ pub const Reader = struct {
}
pub fn read(this: *Self, count: usize) ![]u8 {
- const read_count = @minimum(count, this.remain.len);
+ const read_count = @min(count, this.remain.len);
if (read_count < count) {
return error.EOF;
}
diff --git a/src/api/schema.zig b/src/api/schema.zig
index e16c4ed79..db2cdee49 100644
--- a/src/api/schema.zig
+++ b/src/api/schema.zig
@@ -17,7 +17,7 @@ pub const Reader = struct {
}
pub fn read(this: *Self, count: usize) ![]u8 {
- const read_count = @minimum(count, this.remain.len);
+ const read_count = @min(count, this.remain.len);
if (read_count < count) {
return error.EOF;
}
@@ -58,7 +58,7 @@ pub const Reader = struct {
return E.InvalidValue;
}
- pub inline fn readArray(this: *Self, comptime T: type) ![]const T {
+ pub fn readArray(this: *Self, comptime T: type) ![]const T {
const length = try this.readInt(u32);
if (length == 0) {
return &([_]T{});
@@ -156,7 +156,7 @@ pub const Reader = struct {
.Packed => {
const sizeof = @sizeOf(T);
var slice = try this.read(sizeof);
- return @ptrCast(*T, slice[0..sizeof]).*;
+ return @ptrCast(*align(1) T, slice[0..sizeof]).*;
},
else => {},
}
@@ -263,7 +263,7 @@ pub fn Writer(comptime WritableStream: type) type {
}
}
- pub inline fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
+ pub fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
try this.writeInt(@truncate(u32, slice.len));
switch (T) {
diff --git a/src/baby_list.zig b/src/baby_list.zig
index 9f1580294..cb01c0dca 100644
--- a/src/baby_list.zig
+++ b/src/baby_list.zig
@@ -91,7 +91,7 @@ pub fn BabyList(comptime Type: type) type {
}
pub fn one(allocator: std.mem.Allocator, value: Type) !ListType {
- var items = try allocator.allocAdvanced(Type, @alignOf(Type), 1, .exact);
+ var items = try allocator.alloc(Type, 1);
items[0] = value;
return ListType{
.ptr = @ptrCast([*]Type, items.ptr),
diff --git a/src/base64/base64.zig b/src/base64/base64.zig
index 963096a26..be0086c46 100644
--- a/src/base64/base64.zig
+++ b/src/base64/base64.zig
@@ -12,7 +12,7 @@ pub fn decode(destination: []u8, source: []const u8) DecodeResult {
'\n',
'\r',
'\t',
- std.ascii.control_code.VT,
+ std.ascii.control_code.vt,
}).decode(destination, source, &wrote) catch {
return .{
.written = wrote,
@@ -58,7 +58,7 @@ pub fn encodeLen(source: anytype) usize {
pub const urlsafe = zig_base64.Base64DecoderWithIgnore.init(
zig_base64.url_safe_alphabet_chars,
null,
- "= \t\r\n" ++ [_]u8{ std.ascii.control_code.VT, std.ascii.control_code.FF },
+ "= \t\r\n" ++ [_]u8{ std.ascii.control_code.vt, std.ascii.control_code.ff },
);
pub const urlsafeEncoder = zig_base64.url_safe_no_pad.Encoder;
diff --git a/src/bindgen.zig b/src/bindgen.zig
index 718d68cfe..252ce4e9e 100644
--- a/src/bindgen.zig
+++ b/src/bindgen.zig
@@ -3,5 +3,5 @@ pub const bindgen = true;
pub const main = @import("./bun.js/bindings/bindings-generator.zig").main;
pub export fn PLCrashReportHandler(_: ?*anyopaque) void {}
pub export fn mkdirp(_: ?*anyopaque) void {}
-
-pub usingnamespace @import("./bun.zig");
+pub const build_options = @import("build_options");
+pub const bun = @import("./bun.zig");
diff --git a/build-id b/src/build-id
index c22708346..c22708346 100644
--- a/build-id
+++ b/src/build-id
diff --git a/src/bun.js/api/FFI.h b/src/bun.js/api/FFI.h
index c218dc69a..8d450b65e 100644
--- a/src/bun.js/api/FFI.h
+++ b/src/bun.js/api/FFI.h
@@ -101,6 +101,7 @@ typedef void* JSContext;
#ifdef IS_CALLBACK
+void* callback_ctx;
ZIG_REPR_TYPE FFI_Callback_call(void* ctx, size_t argCount, ZIG_REPR_TYPE* args);
// We wrap
static EncodedJSValue _FFI_Callback_call(void* ctx, size_t argCount, ZIG_REPR_TYPE* args) __attribute__((__always_inline__));
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig
index eb235da2f..ee2763d92 100644
--- a/src/bun.js/api/bun.zig
+++ b/src/bun.js/api/bun.zig
@@ -95,7 +95,7 @@ pub fn onImportCSS(
) void {
if (!css_imports_buf_loaded) {
css_imports_buf = std.ArrayList(u8).initCapacity(
- VirtualMachine.vm.allocator,
+ VirtualMachine.get().allocator,
import_record.path.text.len,
) catch unreachable;
css_imports_buf_loaded = true;
@@ -272,7 +272,7 @@ pub fn inspect(
// // when it's a big thing, we will manage it
// {
// writer.context.flush() catch {};
- // var slice = writer.context.context.toOwnedSlice();
+ // var slice =try writer.context.context.toOwnedSlice();
// var zig_str = ZigString.init(slice).withEncoding();
// if (!zig_str.isUTF8()) {
@@ -310,7 +310,7 @@ pub fn registerMacro(
return js.JSValueMakeUndefined(ctx);
}
- var get_or_put_result = VirtualMachine.vm.macros.getOrPut(id) catch unreachable;
+ var get_or_put_result = VirtualMachine.get().macros.getOrPut(id) catch unreachable;
if (get_or_put_result.found_existing) {
js.JSValueUnprotect(ctx, get_or_put_result.value_ptr.*);
}
@@ -328,7 +328,7 @@ pub fn getCWD(
_: js.JSStringRef,
_: js.ExceptionRef,
) js.JSValueRef {
- return ZigString.init(VirtualMachine.vm.bundler.fs.top_level_dir).toValue(ctx.ptr()).asRef();
+ return ZigString.init(VirtualMachine.get().bundler.fs.top_level_dir).toValue(ctx.ptr()).asRef();
}
pub fn getOrigin(
@@ -338,7 +338,7 @@ pub fn getOrigin(
_: js.JSStringRef,
_: js.ExceptionRef,
) js.JSValueRef {
- return ZigString.init(VirtualMachine.vm.origin.origin).toValue(ctx.ptr()).asRef();
+ return ZigString.init(VirtualMachine.get().origin.origin).toValue(ctx.ptr()).asRef();
}
pub fn getStdin(
@@ -350,7 +350,7 @@ pub fn getStdin(
) js.JSValueRef {
var existing = ctx.ptr().getCachedObject(ZigString.static("BunSTDIN"));
if (existing.isEmpty()) {
- var rare_data = JSC.VirtualMachine.vm.rareData();
+ var rare_data = JSC.VirtualMachine.get().rareData();
var store = rare_data.stdin();
var blob = bun.default_allocator.create(JSC.WebCore.Blob) catch unreachable;
blob.* = JSC.WebCore.Blob.initWithStore(store, ctx.ptr());
@@ -373,7 +373,7 @@ pub fn getStderr(
) js.JSValueRef {
var existing = ctx.ptr().getCachedObject(ZigString.static("BunSTDERR"));
if (existing.isEmpty()) {
- var rare_data = JSC.VirtualMachine.vm.rareData();
+ var rare_data = JSC.VirtualMachine.get().rareData();
var store = rare_data.stderr();
var blob = bun.default_allocator.create(JSC.WebCore.Blob) catch unreachable;
blob.* = JSC.WebCore.Blob.initWithStore(store, ctx.ptr());
@@ -396,7 +396,7 @@ pub fn getStdout(
) js.JSValueRef {
var existing = ctx.ptr().getCachedObject(ZigString.static("BunSTDOUT"));
if (existing.isEmpty()) {
- var rare_data = JSC.VirtualMachine.vm.rareData();
+ var rare_data = JSC.VirtualMachine.get().rareData();
var store = rare_data.stdout();
var blob = bun.default_allocator.create(JSC.WebCore.Blob) catch unreachable;
blob.* = JSC.WebCore.Blob.initWithStore(store, ctx.ptr());
@@ -426,7 +426,7 @@ pub fn getMain(
_: js.JSStringRef,
_: js.ExceptionRef,
) js.JSValueRef {
- return ZigString.init(VirtualMachine.vm.main).toValue(ctx.ptr()).asRef();
+ return ZigString.init(VirtualMachine.get().main).toValue(ctx.ptr()).asRef();
}
pub fn getAssetPrefix(
@@ -436,7 +436,7 @@ pub fn getAssetPrefix(
_: js.JSStringRef,
_: js.ExceptionRef,
) js.JSValueRef {
- return ZigString.init(VirtualMachine.vm.bundler.options.routes.asset_prefix_path).toValue(ctx.ptr()).asRef();
+ return ZigString.init(VirtualMachine.get().bundler.options.routes.asset_prefix_path).toValue(ctx.ptr()).asRef();
}
pub fn getArgv(
@@ -468,11 +468,11 @@ pub fn getRoutesDir(
_: js.JSStringRef,
_: js.ExceptionRef,
) js.JSValueRef {
- if (!VirtualMachine.vm.bundler.options.routes.routes_enabled or VirtualMachine.vm.bundler.options.routes.dir.len == 0) {
+ if (!VirtualMachine.get().bundler.options.routes.routes_enabled or VirtualMachine.get().bundler.options.routes.dir.len == 0) {
return js.JSValueMakeUndefined(ctx);
}
- return ZigString.init(VirtualMachine.vm.bundler.options.routes.dir).toValue(ctx.ptr()).asRef();
+ return ZigString.init(VirtualMachine.get().bundler.options.routes.dir).toValue(ctx.ptr()).asRef();
}
pub fn getFilePath(ctx: js.JSContextRef, arguments: []const js.JSValueRef, buf: []u8, exception: js.ExceptionRef) ?string {
@@ -495,7 +495,7 @@ pub fn getFilePath(ctx: js.JSContextRef, arguments: []const js.JSValueRef, buf:
var parts = [_]string{out_slice};
// This does the equivalent of Node's path.normalize(path.join(cwd, out_slice))
- var res = VirtualMachine.vm.bundler.fs.absBuf(&parts, buf);
+ var res = VirtualMachine.get().bundler.fs.absBuf(&parts, buf);
return res;
} else if (js.JSValueIsArray(ctx, value)) {
@@ -536,7 +536,7 @@ pub fn getFilePath(ctx: js.JSContextRef, arguments: []const js.JSValueRef, buf:
return null;
}
- return VirtualMachine.vm.bundler.fs.absBuf(temp_strings_list[0..temp_strings_list_len], buf);
+ return VirtualMachine.get().bundler.fs.absBuf(temp_strings_list[0..temp_strings_list_len], buf);
} else {
JSError(getAllocator(ctx), "Expected a file path as a string or an array of strings to be part of a file path.", .{}, ctx, exception);
return null;
@@ -606,8 +606,8 @@ pub fn readFileAsStringCallback(
return js.JSValueMakeUndefined(ctx);
}
- var contents_buf = VirtualMachine.vm.allocator.alloc(u8, stat.size + 2) catch unreachable; // OOM
- defer VirtualMachine.vm.allocator.free(contents_buf);
+ var contents_buf = VirtualMachine.get().allocator.alloc(u8, stat.size + 2) catch unreachable; // OOM
+ defer VirtualMachine.get().allocator.free(contents_buf);
const contents_len = file.readAll(contents_buf) catch |err| {
JSError(getAllocator(ctx), "{s} reading file (\"{s}\")", .{ @errorName(err), path }, ctx, exception);
return js.JSValueMakeUndefined(ctx);
@@ -628,37 +628,37 @@ pub fn readFileAsBytesCallback(
exception: js.ExceptionRef,
) js.JSValueRef {
const path = buf_z.ptr[0..buf_z.len];
+ const allocator = VirtualMachine.get().allocator;
var file = std.fs.cwd().openFileZ(buf_z, .{ .mode = .read_only }) catch |err| {
- JSError(getAllocator(ctx), "Opening file {s} for path: \"{s}\"", .{ @errorName(err), path }, ctx, exception);
+ JSError(allocator, "Opening file {s} for path: \"{s}\"", .{ @errorName(err), path }, ctx, exception);
return js.JSValueMakeUndefined(ctx);
};
defer file.close();
const stat = file.stat() catch |err| {
- JSError(getAllocator(ctx), "Getting file size {s} for \"{s}\"", .{ @errorName(err), path }, ctx, exception);
+ JSError(allocator, "Getting file size {s} for \"{s}\"", .{ @errorName(err), path }, ctx, exception);
return js.JSValueMakeUndefined(ctx);
};
if (stat.kind != .File) {
- JSError(getAllocator(ctx), "Can't read a {s} as a string (\"{s}\")", .{ @tagName(stat.kind), path }, ctx, exception);
+ JSError(allocator, "Can't read a {s} as a string (\"{s}\")", .{ @tagName(stat.kind), path }, ctx, exception);
return js.JSValueMakeUndefined(ctx);
}
- var contents_buf = VirtualMachine.vm.allocator.alloc(u8, stat.size + 2) catch unreachable; // OOM
- errdefer VirtualMachine.vm.allocator.free(contents_buf);
+ var contents_buf = allocator.alloc(u8, stat.size + 2) catch unreachable; // OOM
const contents_len = file.readAll(contents_buf) catch |err| {
- JSError(getAllocator(ctx), "{s} reading file (\"{s}\")", .{ @errorName(err), path }, ctx, exception);
+ JSError(allocator, "{s} reading file (\"{s}\")", .{ @errorName(err), path }, ctx, exception);
return js.JSValueMakeUndefined(ctx);
};
contents_buf[contents_len] = 0;
- var marked_array_buffer = VirtualMachine.vm.allocator.create(MarkedArrayBuffer) catch unreachable;
+ var marked_array_buffer = allocator.create(MarkedArrayBuffer) catch unreachable;
marked_array_buffer.* = MarkedArrayBuffer.fromBytes(
contents_buf[0..contents_len],
- VirtualMachine.vm.allocator,
+ allocator,
.Uint8Array,
);
@@ -673,12 +673,12 @@ pub fn getRouteFiles(
_: []const js.JSValueRef,
_: js.ExceptionRef,
) js.JSValueRef {
- if (VirtualMachine.vm.bundler.router == null) return js.JSObjectMakeArray(ctx, 0, null, null);
+ if (VirtualMachine.get().bundler.router == null) return js.JSObjectMakeArray(ctx, 0, null, null);
- const router = &VirtualMachine.vm.bundler.router.?;
+ const router = &VirtualMachine.get().bundler.router.?;
const list = router.getPublicPaths() catch unreachable;
- for (routes_list_strings[0..@minimum(list.len, routes_list_strings.len)]) |_, i| {
+ for (routes_list_strings[0..@min(list.len, routes_list_strings.len)]) |_, i| {
routes_list_strings[i] = ZigString.init(list[i]);
}
@@ -694,12 +694,12 @@ pub fn getRouteNames(
_: []const js.JSValueRef,
_: js.ExceptionRef,
) js.JSValueRef {
- if (VirtualMachine.vm.bundler.router == null) return js.JSObjectMakeArray(ctx, 0, null, null);
+ if (VirtualMachine.get().bundler.router == null) return js.JSObjectMakeArray(ctx, 0, null, null);
- const router = &VirtualMachine.vm.bundler.router.?;
+ const router = &VirtualMachine.get().bundler.router.?;
const list = router.getNames() catch unreachable;
- for (routes_list_strings[0..@minimum(list.len, routes_list_strings.len)]) |_, i| {
+ for (routes_list_strings[0..@min(list.len, routes_list_strings.len)]) |_, i| {
routes_list_strings[i] = ZigString.init(list[i]);
}
@@ -716,7 +716,7 @@ pub fn openInEditor(
args: []const js.JSValueRef,
exception: js.ExceptionRef,
) js.JSValueRef {
- var edit = &VirtualMachine.vm.rareData().editor_context;
+ var edit = &VirtualMachine.get().rareData().editor_context;
var arguments = JSC.Node.ArgumentsSlice.from(ctx.bunVM(), args);
defer arguments.deinit();
@@ -738,7 +738,7 @@ pub fn openInEditor(
if (!strings.eqlLong(prev_name, sliced.slice(), true)) {
var prev = edit.*;
edit.name = sliced.slice();
- edit.detectEditor(VirtualMachine.vm.bundler.env);
+ edit.detectEditor(VirtualMachine.get().bundler.env);
editor_choice = edit.editor;
if (editor_choice == null) {
edit.* = prev;
@@ -762,7 +762,7 @@ pub fn openInEditor(
}
const editor = editor_choice orelse edit.editor orelse brk: {
- edit.autoDetectEditor(VirtualMachine.vm.bundler.env);
+ edit.autoDetectEditor(VirtualMachine.get().bundler.env);
if (edit.editor == null) {
JSC.JSError(bun.default_allocator, "Failed to auto-detect editor", .{}, ctx, exception);
return null;
@@ -819,14 +819,14 @@ pub fn readFileAsString(
}
pub fn getPublicPath(to: string, origin: URL, comptime Writer: type, writer: Writer) void {
- return getPublicPathWithAssetPrefix(to, VirtualMachine.vm.bundler.fs.top_level_dir, origin, VirtualMachine.vm.bundler.options.routes.asset_prefix_path, comptime Writer, writer);
+ return getPublicPathWithAssetPrefix(to, VirtualMachine.get().bundler.fs.top_level_dir, origin, VirtualMachine.get().bundler.options.routes.asset_prefix_path, comptime Writer, writer);
}
pub fn getPublicPathWithAssetPrefix(to: string, dir: string, origin: URL, asset_prefix: string, comptime Writer: type, writer: Writer) void {
const relative_path = if (strings.hasPrefix(to, dir))
strings.withoutTrailingSlash(to[dir.len..])
else
- VirtualMachine.vm.bundler.fs.relative(dir, to);
+ VirtualMachine.get().bundler.fs.relative(dir, to);
if (origin.isAbsolute()) {
if (strings.hasPrefix(relative_path, "..") or strings.hasPrefix(relative_path, "./")) {
writer.writeAll(origin.origin) catch return;
@@ -834,7 +834,7 @@ pub fn getPublicPathWithAssetPrefix(to: string, dir: string, origin: URL, asset_
if (std.fs.path.isAbsolute(to)) {
writer.writeAll(to) catch return;
} else {
- writer.writeAll(VirtualMachine.vm.bundler.fs.abs(&[_]string{to})) catch return;
+ writer.writeAll(VirtualMachine.get().bundler.fs.abs(&[_]string{to})) catch return;
}
} else {
origin.joinWrite(
@@ -875,10 +875,10 @@ pub fn createNodeFS(
_: []const js.JSValueRef,
_: js.ExceptionRef,
) js.JSValueRef {
- return Node.NodeFSBindings.make(
- ctx,
- VirtualMachine.vm.nodeFS(),
- );
+ var module = ctx.allocator().create(JSC.Node.NodeJSFS) catch unreachable;
+ module.* = .{};
+
+ return module.toJS(ctx).asObjectRef();
}
pub fn generateHeapSnapshot(
@@ -1076,7 +1076,7 @@ pub fn getPublicPathJS(
var stream = std.io.fixedBufferStream(&public_path_temp_str);
var writer = stream.writer();
- getPublicPath(to, VirtualMachine.vm.origin, @TypeOf(&writer), &writer);
+ getPublicPath(to, VirtualMachine.get().origin, @TypeOf(&writer), &writer);
return ZigString.init(stream.buffer[0..stream.pos]).toValueGC(ctx.ptr()).asObjectRef();
}
@@ -1089,131 +1089,130 @@ pub const Class = NewClass(
},
.{
.match = .{
- .rfn = Router.deprecatedBunGlobalMatch,
+ .rfn = &Router.deprecatedBunGlobalMatch,
},
.sleepSync = .{
- .rfn = sleepSync,
+ .rfn = &sleepSync,
},
.fetch = .{
- .rfn = Fetch.call,
+ .rfn = &Fetch.call,
},
.getImportedStyles = .{
- .rfn = Bun.getImportedStyles,
+ .rfn = &Bun.getImportedStyles,
},
.inspect = .{
- .rfn = Bun.inspect,
+ .rfn = &Bun.inspect,
},
.getRouteFiles = .{
- .rfn = Bun.getRouteFiles,
+ .rfn = &Bun.getRouteFiles,
},
._Os = .{
- .rfn = Bun.newOs,
+ .rfn = &Bun.newOs,
},
._Path = .{
- .rfn = Bun.newPath,
+ .rfn = &Bun.newPath,
},
.getRouteNames = .{
- .rfn = Bun.getRouteNames,
+ .rfn = &Bun.getRouteNames,
},
.readFile = .{
- .rfn = Bun.readFileAsString,
+ .rfn = &Bun.readFileAsString,
},
.resolveSync = .{
- .rfn = Bun.resolveSync,
+ .rfn = &Bun.resolveSync,
},
.resolve = .{
- .rfn = Bun.resolve,
+ .rfn = &Bun.resolve,
},
.readFileBytes = .{
- .rfn = Bun.readFileAsBytes,
+ .rfn = &Bun.readFileAsBytes,
},
.getPublicPath = .{
- .rfn = Bun.getPublicPathJS,
+ .rfn = &Bun.getPublicPathJS,
},
.registerMacro = .{
- .rfn = Bun.registerMacro,
+ .rfn = &Bun.registerMacro,
.enumerable = false,
},
.fs = .{
- .rfn = Bun.createNodeFS,
+ .rfn = &Bun.createNodeFS,
.enumerable = false,
},
.jest = .{
- .rfn = @import("../test/jest.zig").Jest.call,
+ .rfn = &@import("../test/jest.zig").Jest.call,
.enumerable = false,
},
.indexOfLine = .{
- .rfn = Bun.indexOfLine,
- .enumerable = false,
+ .rfn = &Bun.indexOfLine,
},
.gc = .{
- .rfn = Bun.runGC,
+ .rfn = &Bun.runGC,
},
.allocUnsafe = .{
- .rfn = Bun.allocUnsafe,
+ .rfn = &Bun.allocUnsafe,
},
.mmap = .{
- .rfn = Bun.mmapFile,
+ .rfn = &Bun.mmapFile,
},
.generateHeapSnapshot = .{
- .rfn = Bun.generateHeapSnapshot,
+ .rfn = &Bun.generateHeapSnapshot,
},
.shrink = .{
- .rfn = Bun.shrink,
+ .rfn = &Bun.shrink,
},
.openInEditor = .{
- .rfn = Bun.openInEditor,
+ .rfn = &Bun.openInEditor,
},
.readAllStdinSync = .{
- .rfn = Bun.readAllStdinSync,
+ .rfn = &Bun.readAllStdinSync,
},
.serve = .{
- .rfn = Bun.serve,
+ .rfn = &Bun.serve,
},
.file = .{
- .rfn = JSC.WebCore.Blob.constructFile,
+ .rfn = &JSC.WebCore.Blob.constructFile,
},
.write = .{
- .rfn = JSC.WebCore.Blob.writeFile,
+ .rfn = &JSC.WebCore.Blob.writeFile,
},
.sha = .{
- .rfn = JSC.wrapWithHasContainer(Crypto.SHA512_256, "hash_", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(Crypto.SHA512_256, "hash_", false, false, true),
},
.nanoseconds = .{
- .rfn = nanoseconds,
+ .rfn = &nanoseconds,
},
.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_mimalloc_dump = .{
- .rfn = dump_mimalloc,
+ .rfn = &dump_mimalloc,
},
.gzipSync = .{
- .rfn = JSC.wrapWithHasContainer(JSZlib, "gzipSync", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSZlib, "gzipSync", false, false, true),
},
.deflateSync = .{
- .rfn = JSC.wrapWithHasContainer(JSZlib, "deflateSync", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSZlib, "deflateSync", false, false, true),
},
.gunzipSync = .{
- .rfn = JSC.wrapWithHasContainer(JSZlib, "gunzipSync", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSZlib, "gunzipSync", false, false, true),
},
.inflateSync = .{
- .rfn = JSC.wrapWithHasContainer(JSZlib, "inflateSync", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSZlib, "inflateSync", false, false, true),
},
.which = .{
- .rfn = which,
+ .rfn = &which,
},
.spawn = .{
- .rfn = JSC.wrapWithHasContainer(JSC.Subprocess, "spawn", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.Subprocess, "spawn", false, false, false),
},
.spawnSync = .{
- .rfn = JSC.wrapWithHasContainer(JSC.Subprocess, "spawnSync", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.Subprocess, "spawnSync", false, false, false),
},
.listen = .{
- .rfn = JSC.wrapWithHasContainer(JSC.API.Listener, "listen", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.API.Listener, "listen", false, false, false),
},
.connect = .{
- .rfn = JSC.wrapWithHasContainer(JSC.API.Listener, "connect", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.API.Listener, "connect", false, false, false),
},
},
.{
@@ -1325,7 +1324,7 @@ pub fn indexOfLine(
if (arguments.len > 1) {
offset = @intCast(
usize,
- @maximum(
+ @max(
arguments[1].to(u32),
0,
),
@@ -1340,7 +1339,7 @@ pub fn indexOfLine(
if (strings.indexOfNewlineOrNonASCII(bytes, @truncate(u32, current_offset))) |i| {
const byte = bytes[i];
if (byte > 0x7F) {
- current_offset += @maximum(strings.wtf8ByteSequenceLength(byte), 1);
+ current_offset += @max(strings.wtf8ByteSequenceLength(byte), 1);
continue;
}
@@ -1364,7 +1363,7 @@ pub fn indexOfLine(
pub const Crypto = struct {
const Hashers = @import("../../sha.zig");
- fn CryptoHasher(comptime Hasher: type, name: [:0]const u8) type {
+ fn CryptoHasher(comptime Hasher: type, comptime name: [:0]const u8) type {
return struct {
hashing: Hasher = Hasher{},
@@ -1397,7 +1396,7 @@ pub const Crypto = struct {
) JSC.JSValue {
var output_digest_buf: Hasher.Digest = undefined;
- Hasher.hash(input.slice(), &output_digest_buf, JSC.VirtualMachine.vm.rareData().boringEngine());
+ Hasher.hash(input.slice(), &output_digest_buf, JSC.VirtualMachine.get().rareData().boringEngine());
return encoding.encodeWithSize(globalThis, Hasher.digest, &output_digest_buf);
}
@@ -1418,7 +1417,7 @@ pub const Crypto = struct {
output_digest_slice = bytes[0..Hasher.digest];
}
- Hasher.hash(input.slice(), output_digest_slice, JSC.VirtualMachine.vm.rareData().boringEngine());
+ Hasher.hash(input.slice(), output_digest_slice, JSC.VirtualMachine.get().rareData().boringEngine());
if (output) |output_buf| {
return output_buf.value;
@@ -1559,7 +1558,7 @@ pub const Crypto = struct {
}
pub fn finalize(this: *@This()) callconv(.C) void {
- VirtualMachine.vm.allocator.destroy(this);
+ VirtualMachine.get().allocator.destroy(this);
}
};
}
@@ -1582,7 +1581,7 @@ pub fn nanoseconds(
_: []const JSC.C.JSValueRef,
_: JSC.C.ExceptionRef,
) JSC.C.JSValueRef {
- const ns = JSC.VirtualMachine.vm.origin_timer.read();
+ const ns = JSC.VirtualMachine.get().origin_timer.read();
return JSC.JSValue.jsNumberFromUint64(ns).asObjectRef();
}
@@ -1767,8 +1766,8 @@ pub fn allocUnsafe(
const length = @intCast(
usize,
- @minimum(
- @maximum(1, (args.nextEat() orelse JSC.JSValue.jsNumber(@as(i32, 1))).toInt32()),
+ @min(
+ @max(1, (args.nextEat() orelse JSC.JSValue.jsNumber(@as(i32, 1))).toInt32()),
std.math.maxInt(i32),
),
);
@@ -1795,7 +1794,7 @@ pub fn mmapFile(
var args = JSC.Node.ArgumentsSlice.from(ctx.bunVM(), arguments);
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- const path = getFilePath(ctx, arguments[0..@minimum(1, arguments.len)], &buf, exception) orelse return null;
+ const path = getFilePath(ctx, arguments[0..@min(1, arguments.len)], &buf, exception) orelse return null;
args.eat();
buf[path.len] = 0;
@@ -2007,7 +2006,7 @@ pub const Hash = struct {
function_args[0] = input;
}
- const value = @call(.{}, Function, function_args);
+ const value = @call(.auto, Function, function_args);
if (@TypeOf(value) == u32) {
return JSC.JSValue.jsNumber(@bitCast(i32, value)).asObjectRef();
@@ -2067,7 +2066,7 @@ pub const Unsafe = struct {
.rfn = arrayBufferToString,
},
.gcAggressionLevel = .{
- .rfn = JSC.wrapWithHasContainer(Unsafe, "gcAggressionLevel", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(Unsafe, "gcAggressionLevel", false, false, false),
},
},
.{},
@@ -2146,7 +2145,7 @@ pub const Unsafe = struct {
// },
// .{
// .load = .{
-// .rfn = BunLockfile.load,
+// .rfn = &BunLockfile.load,
// },
// },
// .{},
@@ -2160,10 +2159,10 @@ pub const Unsafe = struct {
// },
// .{
// .findPackagesByName = .{
-// .rfn = BunLockfile.load,
+// .rfn = &BunLockfile.load,
// },
// .dependencies = .{
-// .rfn = BunLockfile.load,
+// .rfn = &BunLockfile.load,
// },
// },
// .{},
@@ -2326,8 +2325,8 @@ pub const Timer = struct {
);
pub fn getNextID() callconv(.C) i32 {
- VirtualMachine.vm.timer.last_id +%= 1;
- return VirtualMachine.vm.timer.last_id;
+ VirtualMachine.get().timer.last_id +%= 1;
+ return VirtualMachine.get().timer.last_id;
}
const uws = @import("bun").uws;
@@ -2476,7 +2475,7 @@ pub const Timer = struct {
// use the threadlocal despite being slow on macOS
// to handle the timeout being cancelled after already enqueued
- var vm = JSC.VirtualMachine.vm;
+ var vm = JSC.VirtualMachine.get();
const repeats = timer_id.repeat > 0;
@@ -2572,7 +2571,7 @@ pub const Timer = struct {
// We don't deal with nesting levels directly
// but we do set the minimum timeout to be 1ms for repeating timers
- const interval: i32 = @maximum(
+ const interval: i32 = @max(
countdown.coerce(i32, globalThis),
if (repeat) @as(i32, 1) else 0,
);
@@ -2673,7 +2672,7 @@ pub const Timer = struct {
pub fn clearTimer(timer_id: JSValue, _: *JSGlobalObject, repeats: bool) void {
JSC.markBinding(@src());
- var map = if (repeats) &VirtualMachine.vm.timer.interval_map else &VirtualMachine.vm.timer.timeout_map;
+ var map = if (repeats) &VirtualMachine.get().timer.interval_map else &VirtualMachine.get().timer.timeout_map;
const id: Timeout.ID = .{
.id = timer_id.toInt32(),
.repeat = @as(u32, @boolToInt(repeats)),
@@ -2713,11 +2712,11 @@ pub const Timer = struct {
pub const namespace = shim.namespace;
pub const Export = shim.exportFunctions(.{
- .@"setTimeout" = setTimeout,
- .@"setInterval" = setInterval,
- .@"clearTimeout" = clearTimeout,
- .@"clearInterval" = clearInterval,
- .@"getNextID" = getNextID,
+ .setTimeout = setTimeout,
+ .setInterval = setInterval,
+ .clearTimeout = clearTimeout,
+ .clearInterval = clearInterval,
+ .getNextID = getNextID,
});
comptime {
@@ -2737,27 +2736,27 @@ pub const FFI = struct {
.{ .name = "FFI", .has_dom_calls = true },
.{
.viewSource = .{
- .rfn = JSC.wrapWithHasContainer(JSC.FFI, "print", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSC.FFI, "print", false, false, true),
},
.dlopen = .{
- .rfn = JSC.wrapWithHasContainer(JSC.FFI, "open", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(JSC.FFI, "open", false, false, true),
},
.callback = .{
- .rfn = JSC.wrapWithHasContainer(JSC.FFI, "callback", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.FFI, "callback", false, false, false),
},
.linkSymbols = .{
- .rfn = JSC.wrapWithHasContainer(JSC.FFI, "linkSymbols", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.FFI, "linkSymbols", false, false, false),
},
.ptr = JSC.DOMCall("FFI", @This(), "ptr", f64, JSC.DOMEffect.forRead(.TypedArrayProperties)),
.toBuffer = .{
- .rfn = JSC.wrapWithHasContainer(@This(), "toBuffer", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(@This(), "toBuffer", false, false, true),
},
.toArrayBuffer = .{
- .rfn = JSC.wrapWithHasContainer(@This(), "toArrayBuffer", false, false, true),
+ .rfn = &JSC.wrapWithHasContainer(@This(), "toArrayBuffer", false, false, true),
},
.closeCallback = .{
- .rfn = JSC.wrapWithHasContainer(JSC.FFI, "closeCallback", false, false, false),
+ .rfn = &JSC.wrapWithHasContainer(JSC.FFI, "closeCallback", false, false, false),
},
},
.{
@@ -2775,18 +2774,18 @@ pub const FFI = struct {
void,
.{ .name = "FFI", .has_dom_calls = true },
.{
- .@"u8" = JSC.DOMCall("Reader", @This(), "u8", i32, JSC.DOMEffect.forRead(.World)),
- .@"u16" = JSC.DOMCall("Reader", @This(), "u16", i32, JSC.DOMEffect.forRead(.World)),
- .@"u32" = JSC.DOMCall("Reader", @This(), "u32", i32, JSC.DOMEffect.forRead(.World)),
- .@"ptr" = JSC.DOMCall("Reader", @This(), "ptr", i52, JSC.DOMEffect.forRead(.World)),
- .@"i8" = JSC.DOMCall("Reader", @This(), "i8", i32, JSC.DOMEffect.forRead(.World)),
- .@"i16" = JSC.DOMCall("Reader", @This(), "i16", i32, JSC.DOMEffect.forRead(.World)),
- .@"i32" = JSC.DOMCall("Reader", @This(), "i32", i32, JSC.DOMEffect.forRead(.World)),
- .@"i64" = JSC.DOMCall("Reader", @This(), "i64", i64, JSC.DOMEffect.forRead(.World)),
- .@"u64" = JSC.DOMCall("Reader", @This(), "u64", u64, JSC.DOMEffect.forRead(.World)),
- .@"intptr" = JSC.DOMCall("Reader", @This(), "intptr", i52, JSC.DOMEffect.forRead(.World)),
- .@"f32" = JSC.DOMCall("Reader", @This(), "f32", f64, JSC.DOMEffect.forRead(.World)),
- .@"f64" = JSC.DOMCall("Reader", @This(), "f64", f64, JSC.DOMEffect.forRead(.World)),
+ .u8 = JSC.DOMCall("Reader", @This(), "u8", i32, JSC.DOMEffect.forRead(.World)),
+ .u16 = JSC.DOMCall("Reader", @This(), "u16", i32, JSC.DOMEffect.forRead(.World)),
+ .u32 = JSC.DOMCall("Reader", @This(), "u32", i32, JSC.DOMEffect.forRead(.World)),
+ .ptr = JSC.DOMCall("Reader", @This(), "ptr", i52, JSC.DOMEffect.forRead(.World)),
+ .i8 = JSC.DOMCall("Reader", @This(), "i8", i32, JSC.DOMEffect.forRead(.World)),
+ .i16 = JSC.DOMCall("Reader", @This(), "i16", i32, JSC.DOMEffect.forRead(.World)),
+ .i32 = JSC.DOMCall("Reader", @This(), "i32", i32, JSC.DOMEffect.forRead(.World)),
+ .i64 = JSC.DOMCall("Reader", @This(), "i64", i64, JSC.DOMEffect.forRead(.World)),
+ .u64 = JSC.DOMCall("Reader", @This(), "u64", u64, JSC.DOMEffect.forRead(.World)),
+ .intptr = JSC.DOMCall("Reader", @This(), "intptr", i52, JSC.DOMEffect.forRead(.World)),
+ .f32 = JSC.DOMCall("Reader", @This(), "f32", f64, JSC.DOMEffect.forRead(.World)),
+ .f64 = JSC.DOMCall("Reader", @This(), "f64", f64, JSC.DOMEffect.forRead(.World)),
},
.{},
);
@@ -2818,7 +2817,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) u32, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"ptr"(
+ pub fn ptr(
_: *JSGlobalObject,
_: JSValue,
arguments: []const JSValue,
@@ -2854,7 +2853,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) i32, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"intptr"(
+ pub fn intptr(
_: *JSGlobalObject,
_: JSValue,
arguments: []const JSValue,
@@ -2904,7 +2903,7 @@ pub const FFI = struct {
return JSValue.fromUInt64NoTruncate(global, value);
}
- pub fn @"u8WithoutTypeChecks"(
+ pub fn u8WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2914,7 +2913,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) u8, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"u16WithoutTypeChecks"(
+ pub fn u16WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2924,7 +2923,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) u16, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"u32WithoutTypeChecks"(
+ pub fn u32WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2934,7 +2933,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) u32, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"ptrWithoutTypeChecks"(
+ pub fn ptrWithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2944,7 +2943,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) u64, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"i8WithoutTypeChecks"(
+ pub fn i8WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2954,7 +2953,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) i8, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"i16WithoutTypeChecks"(
+ pub fn i16WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2964,7 +2963,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) i16, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"i32WithoutTypeChecks"(
+ pub fn i32WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2974,7 +2973,7 @@ pub const FFI = struct {
const value = @intToPtr(*align(1) i32, addr).*;
return JSValue.jsNumber(value);
}
- pub fn @"intptrWithoutTypeChecks"(
+ pub fn intptrWithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2985,7 +2984,7 @@ pub const FFI = struct {
return JSValue.jsNumber(value);
}
- pub fn @"f32WithoutTypeChecks"(
+ pub fn f32WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -2996,7 +2995,7 @@ pub const FFI = struct {
return JSValue.jsNumber(value);
}
- pub fn @"f64WithoutTypeChecks"(
+ pub fn f64WithoutTypeChecks(
_: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -3007,7 +3006,7 @@ pub const FFI = struct {
return JSValue.jsNumber(value);
}
- pub fn @"u64WithoutTypeChecks"(
+ pub fn u64WithoutTypeChecks(
global: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -3018,7 +3017,7 @@ pub const FFI = struct {
return JSValue.fromUInt64NoTruncate(global, value);
}
- pub fn @"i64WithoutTypeChecks"(
+ pub fn i64WithoutTypeChecks(
global: *JSGlobalObject,
_: *anyopaque,
raw_addr: i64,
@@ -3414,7 +3413,7 @@ pub const EnvironmentVariables = struct {
pub fn getEnvNames(globalObject: *JSC.JSGlobalObject, names: []ZigString) usize {
var vm = globalObject.bunVM();
const keys = vm.bundler.env.map.map.keys();
- const max = @minimum(names.len, keys.len);
+ const max = @min(names.len, keys.len);
for (keys[0..max]) |key, i| {
names[i] = ZigString.initUTF8(key);
}
@@ -3430,7 +3429,7 @@ pub const EnvironmentVariables = struct {
};
export fn Bun__reportError(_: *JSGlobalObject, err: JSC.JSValue) void {
- JSC.VirtualMachine.vm.runErrorHandler(err, null);
+ JSC.VirtualMachine.get().runErrorHandler(err, null);
}
comptime {
@@ -3498,7 +3497,7 @@ pub const JSZlib = struct {
}
var compressed = buffer.slice();
- const allocator = JSC.VirtualMachine.vm.allocator;
+ const allocator = JSC.VirtualMachine.get().allocator;
var list = std.ArrayListUnmanaged(u8).initCapacity(allocator, if (compressed.len > 512) compressed.len else 32) catch unreachable;
var reader = zlib.ZlibCompressorArrayList.init(compressed, &list, allocator, opts) catch |err| {
if (err == error.InvalidArgument) {
@@ -3515,7 +3514,7 @@ pub const JSZlib = struct {
}
return ZigString.init("Zlib returned an error").toErrorInstance(globalThis);
};
- reader.list = .{ .items = reader.list.toOwnedSlice(allocator) };
+ reader.list = .{ .items = reader.list.toOwnedSlice(allocator) catch @panic("TODO") };
reader.list.capacity = reader.list.items.len;
reader.list_ptr = &reader.list;
@@ -3528,7 +3527,7 @@ pub const JSZlib = struct {
buffer: JSC.Node.StringOrBuffer,
) JSValue {
var compressed = buffer.slice();
- const allocator = JSC.VirtualMachine.vm.allocator;
+ const allocator = JSC.VirtualMachine.get().allocator;
var list = std.ArrayListUnmanaged(u8).initCapacity(allocator, if (compressed.len > 512) compressed.len else 32) catch unreachable;
var reader = zlib.ZlibReaderArrayList.initWithOptions(compressed, &list, allocator, .{
.windowBits = -15,
@@ -3547,7 +3546,7 @@ pub const JSZlib = struct {
}
return ZigString.init("Zlib returned an error").toErrorInstance(globalThis);
};
- reader.list = .{ .items = reader.list.toOwnedSlice(allocator) };
+ reader.list = .{ .items = reader.list.toOwnedSlice(allocator) catch @panic("TODO") };
reader.list.capacity = reader.list.items.len;
reader.list_ptr = &reader.list;
@@ -3560,7 +3559,7 @@ pub const JSZlib = struct {
buffer: JSC.Node.StringOrBuffer,
) JSValue {
var compressed = buffer.slice();
- const allocator = JSC.VirtualMachine.vm.allocator;
+ const allocator = JSC.VirtualMachine.get().allocator;
var list = std.ArrayListUnmanaged(u8).initCapacity(allocator, if (compressed.len > 512) compressed.len else 32) catch unreachable;
var reader = zlib.ZlibReaderArrayList.init(compressed, &list, allocator) catch |err| {
if (err == error.InvalidArgument) {
@@ -3577,7 +3576,7 @@ pub const JSZlib = struct {
}
return ZigString.init("Zlib returned an error").toErrorInstance(globalThis);
};
- reader.list = .{ .items = reader.list.toOwnedSlice(allocator) };
+ reader.list = .{ .items = reader.list.toOwnedSlice(allocator) catch @panic("TODO") };
reader.list.capacity = reader.list.items.len;
reader.list_ptr = &reader.list;
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 8fd6621f2..cbee356f2 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -1169,7 +1169,7 @@ fn NewSocket(comptime ssl: bool) type {
var buf: [512]u8 = undefined;
var length: i32 = 512;
this.socket.remoteAddress(&buf, &length);
- const address = buf[0..@intCast(usize, @minimum(length, 0))];
+ const address = buf[0..@intCast(usize, @min(length, 0))];
if (address.len == 0) {
return JSValue.jsUndefined();
@@ -1202,7 +1202,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const offset = @minimum(args.ptr[1].toUInt64NoTruncate(), slice.len);
+ const offset = @min(args.ptr[1].toUInt64NoTruncate(), slice.len);
slice = slice[offset..];
if (args.len > 2) {
@@ -1211,7 +1211,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const length = @minimum(args.ptr[2].toUInt64NoTruncate(), slice.len);
+ const length = @min(args.ptr[2].toUInt64NoTruncate(), slice.len);
slice = slice[0..length];
}
}
@@ -1257,7 +1257,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const offset = @minimum(args.ptr[1].toUInt64NoTruncate(), slice.len);
+ const offset = @min(args.ptr[1].toUInt64NoTruncate(), slice.len);
slice = slice[offset..];
if (args.len > 2) {
@@ -1266,7 +1266,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const length = @minimum(args.ptr[2].toUInt64NoTruncate(), slice.len);
+ const length = @min(args.ptr[2].toUInt64NoTruncate(), slice.len);
slice = slice[0..length];
}
}
@@ -1292,7 +1292,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const offset = @minimum(args.ptr[1].toUInt64NoTruncate(), slice.len);
+ const offset = @min(args.ptr[1].toUInt64NoTruncate(), slice.len);
slice = slice[offset..];
if (args.len > 2) {
@@ -1301,7 +1301,7 @@ fn NewSocket(comptime ssl: bool) type {
return .zero;
}
- const length = @minimum(args.ptr[2].toUInt64NoTruncate(), slice.len);
+ const length = @min(args.ptr[2].toUInt64NoTruncate(), slice.len);
slice = slice[0..length];
}
}
@@ -1405,7 +1405,7 @@ fn NewSocket(comptime ssl: bool) type {
this.socket.close(0, null);
}
this.markInactive();
- if (this.poll_ref.isActive()) this.poll_ref.unref(JSC.VirtualMachine.vm);
+ if (this.poll_ref.isActive()) this.poll_ref.unref(JSC.VirtualMachine.get());
}
pub fn reload(this: *This, globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSValue {
diff --git a/src/bun.js/api/bun/spawn.zig b/src/bun.js/api/bun/spawn.zig
index 7ed36cf34..b71e49dbc 100644
--- a/src/bun.js/api/bun/spawn.zig
+++ b/src/bun.js/api/bun/spawn.zig
@@ -53,7 +53,7 @@ pub const PosixSpawn = struct {
pub fn deinit(self: *Attr) void {
if (comptime bun.Environment.isMac) {
// https://github.com/ziglang/zig/issues/12964
- system.posix_spawnattr_destroy(&self.attr);
+ _ = system.posix_spawnattr_destroy(&self.attr);
} else {
_ = system.posix_spawnattr_destroy(&self.attr);
}
@@ -93,7 +93,7 @@ pub const PosixSpawn = struct {
pub fn deinit(self: *Actions) void {
if (comptime bun.Environment.isMac) {
// https://github.com/ziglang/zig/issues/12964
- system.posix_spawn_file_actions_destroy(&self.actions);
+ _ = system.posix_spawn_file_actions_destroy(&self.actions);
} else {
_ = system.posix_spawn_file_actions_destroy(&self.actions);
}
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig
index c4d6467a0..38141c34c 100644
--- a/src/bun.js/api/bun/subprocess.zig
+++ b/src/bun.js/api/bun/subprocess.zig
@@ -134,7 +134,7 @@ pub const Subprocess = struct {
.pipe => {
if (this.pipe == .buffer) {
if (this.pipe.buffer.fifo.poll_ref) |poll| {
- poll.enableKeepingProcessAlive(JSC.VirtualMachine.vm);
+ poll.enableKeepingProcessAlive(JSC.VirtualMachine.get());
}
}
},
@@ -147,7 +147,7 @@ pub const Subprocess = struct {
.pipe => {
if (this.pipe == .buffer) {
if (this.pipe.buffer.fifo.poll_ref) |poll| {
- poll.disableKeepingProcessAlive(JSC.VirtualMachine.vm);
+ poll.disableKeepingProcessAlive(JSC.VirtualMachine.get());
}
}
},
@@ -522,7 +522,7 @@ pub const Subprocess = struct {
},
);
- this.remain = this.remain[@minimum(bytes_written, this.remain.len)..];
+ this.remain = this.remain[@min(bytes_written, this.remain.len)..];
to_write = to_write[bytes_written..];
// we are done or it accepts no more input
@@ -762,7 +762,7 @@ pub const Subprocess = struct {
switch (this.*) {
.pipe => {
if (this.pipe.poll_ref) |poll| {
- poll.enableKeepingProcessAlive(JSC.VirtualMachine.vm);
+ poll.enableKeepingProcessAlive(JSC.VirtualMachine.get());
}
},
else => {},
@@ -773,7 +773,7 @@ pub const Subprocess = struct {
switch (this.*) {
.pipe => {
if (this.pipe.poll_ref) |poll| {
- poll.disableKeepingProcessAlive(JSC.VirtualMachine.vm);
+ poll.disableKeepingProcessAlive(JSC.VirtualMachine.get());
}
},
else => {},
@@ -994,7 +994,7 @@ pub const Subprocess = struct {
var cwd = jsc_vm.bundler.fs.top_level_dir;
var stdio = [3]Stdio{
- .{ .ignore = .{} },
+ .{ .ignore = {} },
.{ .pipe = null },
.{ .inherit = {} },
};
@@ -1133,7 +1133,7 @@ pub const Subprocess = struct {
if (!stdio_val.isEmptyOrUndefinedOrNull()) {
if (stdio_val.jsType().isArray()) {
var stdio_iter = stdio_val.arrayIterator(globalThis);
- stdio_iter.len = @minimum(stdio_iter.len, 3);
+ stdio_iter.len = @min(stdio_iter.len, 3);
var i: usize = 0;
while (stdio_iter.next()) |value| : (i += 1) {
if (!extractStdio(globalThis, i, value, &stdio))
@@ -1195,17 +1195,17 @@ pub const Subprocess = struct {
}
const stdin_pipe = if (stdio[0].isPiped()) os.pipe2(0) catch |err| {
- globalThis.throw("failed to create stdin pipe: {s}", .{err});
+ globalThis.throw("failed to create stdin pipe: {s}", .{@errorName(err)});
return .zero;
} else undefined;
const stdout_pipe = if (stdio[1].isPiped()) os.pipe2(0) catch |err| {
- globalThis.throw("failed to create stdout pipe: {s}", .{err});
+ globalThis.throw("failed to create stdout pipe: {s}", .{@errorName(err)});
return .zero;
} else undefined;
const stderr_pipe = if (stdio[2].isPiped()) os.pipe2(0) catch |err| {
- globalThis.throw("failed to create stderr pipe: {s}", .{err});
+ globalThis.throw("failed to create stderr pipe: {s}", .{@errorName(err)});
return .zero;
} else undefined;
@@ -1728,7 +1728,8 @@ pub const Subprocess = struct {
} else if (value.as(JSC.WebCore.Response)) |req| {
req.getBodyValue().toBlobIfPossible();
return extractStdioBlob(globalThis, req.getBodyValue().useAsAnyBlob(), i, stdio_array);
- } else if (JSC.WebCore.ReadableStream.fromJS(value, globalThis)) |*req| {
+ } else if (JSC.WebCore.ReadableStream.fromJS(value, globalThis)) |req_const| {
+ var req = req_const;
if (i == std.os.STDIN_FILENO) {
if (req.toAnyBlob(globalThis)) |blob| {
return extractStdioBlob(globalThis, blob, i, stdio_array);
@@ -1742,7 +1743,7 @@ pub const Subprocess = struct {
return false;
}
- stdio_array[i] = .{ .pipe = req.* };
+ stdio_array[i] = .{ .pipe = req };
return true;
},
else => {},
diff --git a/src/bun.js/api/ffi.zig b/src/bun.js/api/ffi.zig
index 6ea141559..8ff86f04a 100644
--- a/src/bun.js/api/ffi.zig
+++ b/src/bun.js/api/ffi.zig
@@ -1,5 +1,6 @@
const Bun = @This();
-const default_allocator = @import("bun").default_allocator;
+const root = @import("root");
+const default_allocator = bun.default_allocator;
const bun = @import("bun");
const Environment = bun.Environment;
const NetworkThread = @import("bun").HTTP.NetworkThread;
@@ -105,7 +106,7 @@ pub const FFI = struct {
return JSC.toInvalidArguments("Expected callback function", .{}, globalThis);
}
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
var function: Function = .{};
var func = &function;
@@ -158,7 +159,7 @@ pub const FFI = struct {
this.dylib = null;
}
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
for (this.functions.values()) |*val| {
val.deinit(globalThis, allocator);
@@ -170,7 +171,7 @@ pub const FFI = struct {
pub fn printCallback(global: *JSGlobalObject, object: JSC.JSValue) JSValue {
JSC.markBinding(@src());
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
if (object.isEmptyOrUndefinedOrNull() or !object.isObject()) {
return JSC.toInvalidArguments("Expected an object", .{}, global);
@@ -194,7 +195,7 @@ pub const FFI = struct {
}
pub fn print(global: *JSGlobalObject, object: JSC.JSValue, is_callback_val: ?JSC.JSValue) JSValue {
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
if (is_callback_val) |is_callback| {
if (is_callback.toBoolean()) {
return printCallback(global, object);
@@ -257,7 +258,7 @@ pub const FFI = struct {
}
// pub fn dlcompile(global: *JSGlobalObject, object: JSC.JSValue) JSValue {
- // const allocator = VirtualMachine.vm.allocator;
+ // const allocator = VirtualMachine.get().allocator;
// if (object.isEmptyOrUndefinedOrNull() or !object.isObject()) {
// return JSC.toInvalidArguments("Expected an options object with symbol names", .{}, global);
@@ -277,7 +278,7 @@ pub const FFI = struct {
pub fn open(global: *JSGlobalObject, name_str: ZigString, object: JSC.JSValue) JSC.JSValue {
JSC.markBinding(@src());
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
var name_slice = name_str.toSlice(allocator);
defer name_slice.deinit();
@@ -380,7 +381,7 @@ pub const FFI = struct {
},
.compiled => |*compiled| {
const str = ZigString.init(std.mem.span(function_name));
- const cb = JSC.NewFunction(
+ const cb = JSC.NewRuntimeFunction(
global,
&str,
@intCast(u32, function.arg_types.items.len),
@@ -406,7 +407,7 @@ pub const FFI = struct {
pub fn linkSymbols(global: *JSGlobalObject, object: JSC.JSValue) JSC.JSValue {
JSC.markBinding(@src());
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
if (object.isEmptyOrUndefinedOrNull() or !object.isObject()) {
return JSC.toInvalidArguments("Expected an options object with symbol names", .{}, global);
@@ -476,7 +477,7 @@ pub const FFI = struct {
.compiled => |*compiled| {
const name = &ZigString.init(std.mem.span(function_name));
- const cb = JSC.NewFunction(
+ const cb = JSC.NewRuntimeFunction(
global,
name,
@intCast(u32, function.arg_types.items.len),
@@ -547,7 +548,7 @@ pub const FFI = struct {
}
}
// var function
- var return_type = ABIType.@"void";
+ var return_type = ABIType.void;
var threadsafe = false;
@@ -578,7 +579,7 @@ pub const FFI = struct {
};
}
- if (function.threadsafe and return_type != ABIType.@"void") {
+ if (function.threadsafe and return_type != ABIType.void) {
abi_types.clearAndFree(allocator);
return ZigString.static("Threadsafe functions must return void").toErrorInstance(global);
}
@@ -607,7 +608,7 @@ pub const FFI = struct {
}
pub fn generateSymbols(global: *JSGlobalObject, symbols: *bun.StringArrayHashMapUnmanaged(Function), object: JSC.JSValue) !?JSValue {
JSC.markBinding(@src());
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
var symbols_iter = JSC.JSPropertyIterator(.{
.skip_empty_name = true,
@@ -642,7 +643,7 @@ pub const FFI = struct {
base_name: ?[:0]const u8 = null,
state: ?*TCC.TCCState = null,
- return_type: ABIType = ABIType.@"void",
+ return_type: ABIType = ABIType.void,
arg_types: std.ArrayListUnmanaged(ABIType) = .{},
step: Step = Step{ .pending = {} },
threadsafe: bool = false,
@@ -704,7 +705,7 @@ pub const FFI = struct {
const FFI_HEADER: string = @embedFile("./FFI.h");
pub inline fn ffiHeader() string {
if (comptime Environment.isDebug) {
- var dirpath = std.fs.path.dirname(@src().file).?;
+ var dirpath = comptime bun.Environment.base_path ++ std.fs.path.dirname(@src().file).?;
var env = std.process.getEnvMap(default_allocator) catch unreachable;
const dir = std.mem.replaceOwned(
@@ -736,16 +737,16 @@ pub const FFI = struct {
msg = msg[offset..];
}
- this.step = .{ .failed = .{ .msg = VirtualMachine.vm.allocator.dupe(u8, msg) catch unreachable, .allocated = true } };
+ this.step = .{ .failed = .{ .msg = VirtualMachine.get().allocator.dupe(u8, msg) catch unreachable, .allocated = true } };
}
extern fn pthread_jit_write_protect_np(enable: bool) callconv(.C) void;
const MyFunctionSStructWorkAround = struct {
- JSVALUE_TO_INT64: fn (JSValue0: JSC.JSValue) callconv(.C) i64,
- JSVALUE_TO_UINT64: fn (JSValue0: JSC.JSValue) callconv(.C) u64,
- INT64_TO_JSVALUE: fn (arg0: [*c]JSC.JSGlobalObject, arg1: i64) callconv(.C) JSC.JSValue,
- UINT64_TO_JSVALUE: fn (arg0: [*c]JSC.JSGlobalObject, arg1: u64) callconv(.C) JSC.JSValue,
+ JSVALUE_TO_INT64: *const fn (JSValue0: JSC.JSValue) callconv(.C) i64,
+ JSVALUE_TO_UINT64: *const fn (JSValue0: JSC.JSValue) callconv(.C) u64,
+ INT64_TO_JSVALUE: *const fn (arg0: *JSC.JSGlobalObject, arg1: i64) callconv(.C) JSC.JSValue,
+ UINT64_TO_JSVALUE: *const fn (arg0: *JSC.JSGlobalObject, arg1: u64) callconv(.C) JSC.JSValue,
bun_call: *const @TypeOf(JSC.C.JSObjectCallAsFunction),
};
const headers = @import("../bindings/headers.zig");
@@ -831,7 +832,7 @@ pub const FFI = struct {
return;
}
- var bytes: []u8 = try allocator.rawAlloc(@intCast(usize, relocation_size), 16, 16, 0);
+ var bytes: []u8 = try allocator.alloc(u8, @intCast(usize, relocation_size));
defer {
if (this.step == .failed) {
allocator.free(bytes);
@@ -931,6 +932,16 @@ pub const FFI = struct {
var source_code_writer = source_code.writer();
var ffi_wrapper = Bun__createFFICallbackFunction(js_context, js_function);
try this.printCallbackSourceCode(js_context, ffi_wrapper, &source_code_writer);
+
+ if (comptime Environment.allow_assert) {
+ debug_write: {
+ const fd = std.os.open("/tmp/bun-ffi-callback-source.c", std.os.O.WRONLY | std.os.O.CREAT, 0o644) catch break :debug_write;
+ _ = std.os.write(fd, source_code.items) catch break :debug_write;
+ std.os.ftruncate(fd, source_code.items.len) catch break :debug_write;
+ std.os.close(fd);
+ }
+ }
+
try source_code.append(0);
// defer source_code.deinit();
var state = TCC.tcc_new() orelse return error.TCCMissing;
@@ -991,7 +1002,7 @@ pub const FFI = struct {
return;
}
- var bytes: []u8 = try allocator.rawAlloc(@intCast(usize, relocation_size), 16, 16, 0);
+ var bytes: []u8 = try allocator.alloc(u8, @intCast(usize, relocation_size));
defer {
if (this.step == .failed) {
allocator.free(bytes);
@@ -1149,12 +1160,12 @@ pub const FFI = struct {
try writer.writeAll(", ");
}
first = false;
-
try writer.writeAll(" ");
+
const lengthBuf = std.fmt.bufPrintIntToSlice(arg_buf["arg".len..], i, 10, .lower, .{});
const argName = arg_buf[0 .. 3 + lengthBuf.len];
if (arg.needsACastInC()) {
- try writer.print("{}", .{arg.toC(argName)});
+ try writer.print("{any}", .{arg.toC(argName)});
} else {
try writer.writeAll(argName);
}
@@ -1168,7 +1179,7 @@ pub const FFI = struct {
try writer.writeAll("return ");
if (!(this.return_type == .void)) {
- try writer.print("{}.asZigRepr", .{this.return_type.toJS("return_value")});
+ try writer.print("{any}.asZigRepr", .{this.return_type.toJS("return_value")});
} else {
try writer.writeAll("ValueUndefined.asZigRepr");
}
@@ -1194,7 +1205,12 @@ pub const FFI = struct {
context_ptr: ?*anyopaque,
writer: anytype,
) !void {
- try writer.print("#define JS_GLOBAL_OBJECT (void*)0x{X}UL\n", .{@ptrToInt(globalObject)});
+ {
+ const ptr = @ptrToInt(globalObject);
+ const fmt = bun.fmt.hexIntUpper(ptr);
+ try writer.print("#define JS_GLOBAL_OBJECT (void*)0x{any}ULL\n", .{fmt});
+ }
+
try writer.writeAll("#define IS_CALLBACK 1\n");
brk: {
@@ -1266,28 +1282,35 @@ pub const FFI = struct {
for (this.arg_types.items) |arg, i| {
const printed = std.fmt.bufPrintIntToSlice(arg_buf["arg".len..], i, 10, .lower, .{});
const arg_name = arg_buf[0 .. "arg".len + printed.len];
- try writer.print("arguments[{d}] = {}.asZigRepr;\n", .{ i, arg.toJS(arg_name) });
+ try writer.print("arguments[{d}] = {any}.asZigRepr;\n", .{ i, arg.toJS(arg_name) });
}
}
try writer.writeAll(" ");
var inner_buf_: [372]u8 = undefined;
var inner_buf: []u8 = &.{};
- if (this.arg_types.items.len > 0) {
- inner_buf = try std.fmt.bufPrint(
- inner_buf_[1..],
- "FFI_Callback_call((void*)0x{X}UL, {d}, arguments)",
- .{ @ptrToInt(context_ptr), this.arg_types.items.len },
- );
- } else {
- inner_buf = try std.fmt.bufPrint(
- inner_buf_[1..],
- "FFI_Callback_call((void*)0x{X}UL, 0, (ZIG_REPR_TYPE*)0)",
- .{
- @ptrToInt(context_ptr),
- },
- );
+
+ {
+ const ptr = @ptrToInt(context_ptr);
+ const fmt = bun.fmt.hexIntUpper(ptr);
+
+ if (this.arg_types.items.len > 0) {
+ inner_buf = try std.fmt.bufPrint(
+ inner_buf_[1..],
+ "FFI_Callback_call((void*)0x{any}ULL, {d}, arguments)",
+ .{ fmt, this.arg_types.items.len },
+ );
+ } else {
+ inner_buf = try std.fmt.bufPrint(
+ inner_buf_[1..],
+ "FFI_Callback_call((void*)0x{any}ULL, 0, (ZIG_REPR_TYPE*)0)",
+ .{
+ fmt,
+ },
+ );
+ }
}
+
if (this.return_type == .void) {
try writer.writeAll(inner_buf);
} else {
@@ -1324,7 +1347,7 @@ pub const FFI = struct {
ptr = 12,
- @"void" = 13,
+ void = 13,
cstring = 14,
@@ -1375,8 +1398,8 @@ pub const FFI = struct {
.{ "void*", ABIType.ptr },
.{ "ptr", ABIType.ptr },
.{ "pointer", ABIType.ptr },
- .{ "void", ABIType.@"void" },
- .{ "cstring", ABIType.@"cstring" },
+ .{ "void", ABIType.void },
+ .{ "cstring", ABIType.cstring },
.{ "i64_fast", ABIType.i64_fast },
.{ "u64_fast", ABIType.u64_fast },
.{ "function", ABIType.function },
diff --git a/src/bun.js/api/filesystem_router.zig b/src/bun.js/api/filesystem_router.zig
index ab2ef4738..3271e3cc7 100644
--- a/src/bun.js/api/filesystem_router.zig
+++ b/src/bun.js/api/filesystem_router.zig
@@ -69,7 +69,7 @@ const DeprecatedGlobalRouter = struct {
break :brk JSC.JSValue.fromRef(arguments[0]);
};
- var router = JavaScript.VirtualMachine.vm.bundler.router orelse {
+ var router = JavaScript.VirtualMachine.get().bundler.router orelse {
JSError(getAllocator(ctx), "Bun.match needs a framework configured with routes", .{}, ctx, exception);
return null;
};
@@ -140,9 +140,9 @@ const DeprecatedGlobalRouter = struct {
var matched = MatchedRoute.init(
getAllocator(ctx),
route.*,
- JSC.VirtualMachine.vm.refCountedString(JSC.VirtualMachine.vm.origin.href, null, false),
- JSC.VirtualMachine.vm.refCountedString(JSC.VirtualMachine.vm.bundler.options.routes.asset_prefix_path, null, false),
- JSC.VirtualMachine.vm.refCountedString(JSC.VirtualMachine.vm.bundler.fs.top_level_dir, null, false),
+ JSC.VirtualMachine.get().refCountedString(JSC.VirtualMachine.get().origin.href, null, false),
+ JSC.VirtualMachine.get().refCountedString(JSC.VirtualMachine.get().bundler.options.routes.asset_prefix_path, null, false),
+ JSC.VirtualMachine.get().refCountedString(JSC.VirtualMachine.get().bundler.fs.top_level_dir, null, false),
) catch unreachable;
return matched.toJS(ctx).asObjectRef();
@@ -665,7 +665,7 @@ pub const MatchedRoute = struct {
var writer = stream.writer();
JSC.API.Bun.getPublicPathWithAssetPrefix(
this.route.file_path,
- if (this.base_dir) |base_dir| base_dir.slice() else VirtualMachine.vm.bundler.fs.top_level_dir,
+ if (this.base_dir) |base_dir| base_dir.slice() else VirtualMachine.get().bundler.fs.top_level_dir,
if (this.origin) |origin| URL.parse(origin.slice()) else URL{},
if (this.asset_prefix) |prefix| prefix.slice() else "",
@TypeOf(&writer),
diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig
index 8828ea8ff..05b110b90 100644
--- a/src/bun.js/api/html_rewriter.zig
+++ b/src/bun.js/api/html_rewriter.zig
@@ -307,7 +307,7 @@ pub const HTMLRewriter = struct {
doc.ctx = this;
}
- const chunk_size = @maximum(size_hint orelse 16384, 1024);
+ const chunk_size = @max(size_hint orelse 16384, 1024);
this.rewriter = builder.build(
.UTF8,
.{
@@ -417,7 +417,7 @@ pub const HTMLRewriter = struct {
.preallocated_parsing_buffer_size = if (input_size == JSC.WebCore.Blob.max_size)
1024
else
- @maximum(input_size, 1024),
+ @max(input_size, 1024),
.max_allowed_memory_usage = std.math.maxInt(u32),
},
false,
@@ -476,7 +476,7 @@ pub const HTMLRewriter = struct {
if (sink.response.body.value == .Locked and @ptrToInt(sink.response.body.value.Locked.task) == @ptrToInt(sink) and
sink.response.body.value.Locked.promise == null)
{
- sink.response.body.value = .{ .Empty = .{} };
+ sink.response.body.value = .{ .Empty = {} };
// is there a pending promise?
// we will need to reject it
} else if (sink.response.body.value == .Locked and @ptrToInt(sink.response.body.value.Locked.task) == @ptrToInt(sink) and
@@ -593,7 +593,7 @@ pub const HTMLRewriter = struct {
// sink.rewriter = builder.build(
// .UTF8,
// .{
- // .preallocated_parsing_buffer_size = @maximum(original.body.len(), 1024),
+ // .preallocated_parsing_buffer_size = @max(original.body.len(), 1024),
// .max_allowed_memory_usage = std.math.maxInt(u32),
// },
// false,
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 85918d320..3a50a472f 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -302,8 +302,8 @@ pub const ServerConfig = struct {
if (arg.getTruthy(global, "port")) |port_| {
args.port = @intCast(
u16,
- @minimum(
- @maximum(0, port_.coerce(i32, global)),
+ @min(
+ @max(0, port_.coerce(i32, global)),
std.math.maxInt(u16),
),
);
@@ -356,7 +356,7 @@ pub const ServerConfig = struct {
}
if (arg.getTruthy(global, "maxRequestBodySize")) |max_request_body_size| {
- args.max_request_body_size = @intCast(u64, @maximum(0, max_request_body_size.toInt64()));
+ args.max_request_body_size = @intCast(u64, @max(0, max_request_body_size.toInt64()));
}
if (arg.getTruthy(global, "error")) |onError| {
@@ -552,26 +552,33 @@ pub fn NewRequestContextStackAllocator(comptime RequestContext: type, comptime c
pub fn get(this: *@This()) std.mem.Allocator {
this.unused = Set.initFull();
- return std.mem.Allocator.init(this, alloc, resize, free);
+ return .{
+ .ptr = this,
+ .vtable = &.{
+ .alloc = alloc,
+ .resize = resize,
+ .free = free,
+ },
+ };
}
- fn alloc(self: *@This(), a: usize, b: u29, c: u29, d: usize) ![]u8 {
+ fn alloc(self_: *anyopaque, a: usize, b: u8, d: usize) ?[*]u8 {
+ const self = @ptrCast(*@This(), @alignCast(@alignOf(@This()), self_));
if (self.unused.findFirstSet()) |i| {
self.unused.unset(i);
return std.mem.asBytes(&self.buf[i]);
}
- return try self.fallback_allocator.rawAlloc(a, b, c, d);
+ return self.fallback_allocator.rawAlloc(a, b, d);
}
fn resize(
- _: *@This(),
+ _: *anyopaque,
_: []u8,
- _: u29,
+ _: u8,
_: usize,
- _: u29,
_: usize,
- ) ?usize {
+ ) bool {
unreachable;
}
@@ -581,13 +588,12 @@ pub fn NewRequestContextStackAllocator(comptime RequestContext: type, comptime c
}
fn free(
- self: *@This(),
+ self_: *anyopaque,
buf: []u8,
- buf_align: u29,
+ buf_align: u8,
return_address: usize,
) void {
- _ = buf_align;
- _ = return_address;
+ const self = @ptrCast(*@This(), @alignCast(@alignOf(@This()), self_));
const bytes = std.mem.asBytes(&self.buf);
if (sliceContainsSlice(bytes, buf)) {
const index = if (bytes[0..buf.len].ptr != buf.ptr)
@@ -800,7 +806,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
.message = std.fmt.allocPrint(allocator, comptime Output.prettyFmt(fmt, false), args) catch unreachable,
.router = null,
.reason = .fetch_event_handler,
- .cwd = VirtualMachine.vm.bundler.fs.top_level_dir,
+ .cwd = VirtualMachine.get().bundler.fs.top_level_dir,
.problems = Api.Problems{
.code = @truncate(u16, @errorToInt(err)),
.name = @errorName(err),
@@ -1127,8 +1133,8 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
return false;
}
- const adjusted_count_temporary = @minimum(@as(u64, this.sendfile.remain), @as(u63, std.math.maxInt(u63)));
- // TODO we should not need this int cast; improve the return type of `@minimum`
+ const adjusted_count_temporary = @min(@as(u64, this.sendfile.remain), @as(u63, std.math.maxInt(u63)));
+ // TODO we should not need this int cast; improve the return type of `@min`
const adjusted_count = @intCast(u63, adjusted_count_temporary);
if (Environment.isLinux) {
@@ -1205,7 +1211,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
pub fn sendWritableBytesForBlob(this: *RequestContext, bytes_: []const u8, write_offset: c_ulong, resp: *App.Response) bool {
std.debug.assert(this.resp == resp);
- var bytes = bytes_[@minimum(bytes_.len, @truncate(usize, write_offset))..];
+ var bytes = bytes_[@min(bytes_.len, @truncate(usize, write_offset))..];
if (resp.tryEnd(bytes, bytes_.len, this.shouldCloseConnection())) {
this.finalize();
return true;
@@ -1218,7 +1224,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
pub fn sendWritableBytesForCompleteResponseBuffer(this: *RequestContext, bytes_: []const u8, write_offset: c_ulong, resp: *App.Response) bool {
std.debug.assert(this.resp == resp);
- var bytes = bytes_[@minimum(bytes_.len, @truncate(usize, write_offset))..];
+ var bytes = bytes_[@min(bytes_.len, @truncate(usize, write_offset))..];
if (resp.tryEnd(bytes, bytes_.len, this.shouldCloseConnection())) {
this.response_buf_owned.items.len = 0;
this.finalize();
@@ -1306,7 +1312,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.blob.Blob.size = if (std.os.S.ISREG(stat.mode))
stat_size
else
- @minimum(original_size, stat_size);
+ @min(original_size, stat_size);
this.needs_content_length = true;
@@ -1327,8 +1333,8 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
// we know the bounds when we are sending a regular file
if (std.os.S.ISREG(stat.mode)) {
- this.sendfile.offset = @minimum(this.sendfile.offset, stat_size);
- this.sendfile.remain = @minimum(@maximum(this.sendfile.remain, this.sendfile.offset), stat_size) -| this.sendfile.offset;
+ this.sendfile.offset = @min(this.sendfile.offset, stat_size);
+ this.sendfile.remain = @min(@max(this.sendfile.remain, this.sendfile.offset), stat_size) -| this.sendfile.offset;
}
this.resp.runCorkedWithType(*RequestContext, renderMetadataAndNewline, this);
@@ -1386,7 +1392,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.blob.Blob.size = if (original_size == 0 or original_size == Blob.max_size)
stat_size
else
- @minimum(original_size, stat_size);
+ @min(original_size, stat_size);
if (!this.has_written_status)
this.needs_content_range = true;
@@ -1830,7 +1836,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
}
- streamLog("onReject({s})", .{wrote_anything});
+ streamLog("onReject({any})", .{wrote_anything});
if (req.aborted) {
req.finalizeForAbort();
@@ -2086,7 +2092,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.renderDefaultError(
vm.log,
error.ExceptionOcurred,
- exception_list.toOwnedSlice(),
+ exception_list.toOwnedSlice() catch @panic("TODO"),
"<r><red>{s}<r> - <b>{s}<r> failed",
.{ @as(string, @tagName(this.method)), this.ensurePathname() },
);
@@ -2210,7 +2216,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
this.resp.writeHeader(
"content-disposition",
- std.fmt.bufPrint(&filename_buf, "filename=\"{s}\"", .{basename[0..@minimum(basename.len, 1024 - 32)]}) catch "",
+ std.fmt.bufPrint(&filename_buf, "filename=\"{s}\"", .{basename[0..@min(basename.len, 1024 - 32)]}) catch "",
);
}
}
@@ -2345,7 +2351,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
}
if (this.request_body_buf.capacity == 0) {
- this.request_body_buf.ensureTotalCapacityPrecise(this.allocator, @minimum(this.request_body_content_len, max_request_body_preallocate_length)) catch @panic("Out of memory while allocating request body buffer");
+ this.request_body_buf.ensureTotalCapacityPrecise(this.allocator, @min(this.request_body_content_len, max_request_body_preallocate_length)) catch @panic("Out of memory while allocating request body buffer");
}
this.request_body_buf.appendSlice(this.allocator, chunk) catch @panic("Out of memory while allocating request body");
@@ -2391,7 +2397,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
if (request.as(Request)) |req| {
var old = req.body;
old.Locked.onReceiveValue = null;
- req.body = .{ .Empty = .{} };
+ req.body = .{ .Empty = {} };
old.resolve(&req.body, this.server.globalThis);
return;
}
@@ -2402,7 +2408,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
if (request.as(Request)) |req| {
var old = req.body;
old.Locked.onReceiveValue = null;
- req.body = .{ .Empty = .{} };
+ req.body = .{ .Empty = {} };
old.toError(error.RequestBodyTooLarge, this.server.globalThis);
return;
}
@@ -2419,7 +2425,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
if (request.as(Request)) |req| {
var old = req.body;
old.Locked.onReceiveValue = null;
- req.body = .{ .Empty = .{} };
+ req.body = .{ .Empty = {} };
old.resolve(&req.body, this.server.globalThis);
return;
}
@@ -2683,7 +2689,7 @@ pub const WebSocketServer = struct {
globalObject.throwInvalidArguments("websocket expects maxPayloadLength to be an integer", .{});
return null;
}
- server.maxPayloadLength = @intCast(u32, @truncate(i33, @maximum(value.toInt64(), 0)));
+ server.maxPayloadLength = @intCast(u32, @truncate(i33, @max(value.toInt64(), 0)));
}
}
if (object.get(globalObject, "idleTimeout")) |value| {
@@ -2703,7 +2709,7 @@ pub const WebSocketServer = struct {
return null;
}
- server.backpressureLimit = @intCast(u32, @truncate(i33, @maximum(value.toInt64(), 0)));
+ server.backpressureLimit = @intCast(u32, @truncate(i33, @max(value.toInt64(), 0)));
}
}
// if (object.get(globalObject, "sendPings")) |value| {
@@ -4125,7 +4131,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
var url: URL = undefined;
var first_arg = args.nextEat().?;
- var body: JSC.WebCore.Body.Value = .{ .Empty = .{} };
+ var body: JSC.WebCore.Body.Value = .{ .Empty = {} };
var existing_request: ?WebCore.Request = null;
// TODO: set Host header
// TODO: set User-Agent header
@@ -4329,7 +4335,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
.globalThis = globalThis,
.config = config,
.base_url_string_for_joining = bun.default_allocator.dupe(u8, strings.trim(config.base_url.href, "/")) catch unreachable,
- .vm = JSC.VirtualMachine.vm,
+ .vm = JSC.VirtualMachine.get(),
.allocator = Arena.getThreadlocalDefault(),
};
@@ -4402,7 +4408,8 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
if (written > 0) {
var message = output_buf[0..written];
zig_str = ZigString.init(std.fmt.allocPrint(bun.default_allocator, "OpenSSL {s}", .{message}) catch unreachable);
- zig_str.withEncoding().mark();
+ var encoded_str = zig_str.withEncoding();
+ encoded_str.mark();
}
}
@@ -4457,7 +4464,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
_ = js_printer.printJSON(
*js_printer.BufferPrinter,
&writer,
- bun.Global.BunInfo.generate(*Bundler, &JSC.VirtualMachine.vm.bundler, allocator) catch unreachable,
+ bun.Global.BunInfo.generate(*Bundler, &JSC.VirtualMachine.get().bundler, allocator) catch unreachable,
&source,
) catch unreachable;
@@ -4480,8 +4487,8 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
return;
}
- var ctx = &JSC.VirtualMachine.vm.rareData().editor_context;
- ctx.autoDetectEditor(JSC.VirtualMachine.vm.bundler.env);
+ var ctx = &JSC.VirtualMachine.get().rareData().editor_context;
+ ctx.autoDetectEditor(JSC.VirtualMachine.get().bundler.env);
var line: ?string = req.header("editor-line");
var column: ?string = req.header("editor-column");
@@ -4517,7 +4524,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
.uws_request = req,
.https = ssl_enabled,
.body = .{
- .Empty = .{},
+ .Empty = {},
},
};
@@ -4597,7 +4604,7 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
.upgrader = ctx,
.https = ssl_enabled,
.body = .{
- .Empty = .{},
+ .Empty = {},
},
};
ctx.upgrade_context = upgrade_ctx;
diff --git a/src/bun.js/api/transpiler.zig b/src/bun.js/api/transpiler.zig
index 24104c2b7..abcef8248 100644
--- a/src/bun.js/api/transpiler.zig
+++ b/src/bun.js/api/transpiler.zig
@@ -494,7 +494,7 @@ fn transformOptionsFromJSC(ctx: JSC.C.JSContextRef, temp_allocator: std.mem.Allo
allocator,
&transpiler.log,
logger.Source.initPathString("tsconfig.json", transpiler.tsconfig_buf),
- &VirtualMachine.vm.bundler.resolver.caches.json,
+ &VirtualMachine.get().bundler.resolver.caches.json,
true,
) catch null) |parsed_tsconfig| {
transpiler.tsconfig = parsed_tsconfig;
@@ -529,7 +529,7 @@ fn transformOptionsFromJSC(ctx: JSC.C.JSContextRef, temp_allocator: std.mem.Allo
if (out.len == 0) break :macros;
transpiler.macros_buf = std.fmt.allocPrint(allocator, "{}", .{out}) catch unreachable;
const source = logger.Source.initPathString("macros.json", transpiler.macros_buf);
- const json = (VirtualMachine.vm.bundler.resolver.caches.json.parseJSON(
+ const json = (VirtualMachine.get().bundler.resolver.caches.json.parseJSON(
&transpiler.log,
source,
allocator,
@@ -639,7 +639,7 @@ fn transformOptionsFromJSC(ctx: JSC.C.JSContextRef, temp_allocator: std.mem.Allo
};
buf.items.len += name.len;
if (name.len > 0) {
- replacements.putAssumeCapacity(name, .{ .delete = .{} });
+ replacements.putAssumeCapacity(name, .{ .delete = {} });
}
}
}
@@ -763,7 +763,7 @@ pub fn constructor(
log,
transpiler_options.transform,
null,
- JavaScript.VirtualMachine.vm.bundler.env,
+ JavaScript.VirtualMachine.get().bundler.env,
) catch |err| {
if ((log.warnings + log.errors) > 0) {
var out_exception = log.toJS(ctx.ptr(), getAllocator(ctx), "Failed to create transpiler");
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig
index f331dc8f5..79f1fe46a 100644
--- a/src/bun.js/base.zig
+++ b/src/bun.js/base.zig
@@ -190,9 +190,9 @@ pub const To = struct {
JSC.C.JSValueRef => value,
else => {
- const Info: std.builtin.TypeInfo = comptime @typeInfo(Type);
+ const Info: std.builtin.Type = comptime @typeInfo(Type);
if (comptime Info == .Enum) {
- const Enum: std.builtin.TypeInfo.Enum = Info.Enum;
+ const Enum: std.builtin.Type.Enum = Info.Enum;
if (comptime !std.meta.trait.isNumber(Enum.tag_type)) {
zig_str = JSC.ZigString.init(@tagName(value));
return zig_str.toValue(context.ptr()).asObjectRef();
@@ -207,7 +207,7 @@ pub const To = struct {
if (value.len <= prefill) {
var array: [prefill]JSC.C.JSValueRef = undefined;
var i: u8 = 0;
- const len = @minimum(@intCast(u8, value.len), prefill);
+ const len = @min(@intCast(u8, value.len), prefill);
while (i < len and exception.* == null) : (i += 1) {
array[i] = if (comptime Child == JSC.C.JSValueRef)
value[i]
@@ -270,7 +270,7 @@ pub const To = struct {
if (comptime Info == .Struct) {
if (comptime @hasDecl(Type, "Class") and @hasDecl(Type.Class, "isJavaScriptCoreClass")) {
if (comptime !@hasDecl(Type, "finalize")) {
- @compileError(comptime std.fmt.comptimePrint("JSC class {s} must implement finalize to prevent memory leaks", .{Type.Class.name}));
+ @compileError(std.fmt.comptimePrint("JSC class {s} must implement finalize to prevent memory leaks", .{Type.Class.name}));
}
if (comptime !@hasDecl(Type, "toJS")) {
@@ -281,6 +281,12 @@ pub const To = struct {
}
}
+ if (comptime @hasDecl(Type, "toJS") and @typeInfo(@TypeOf(@field(Type, "toJS"))).Fn.params.len == 2) {
+ var val = bun.default_allocator.create(Type) catch unreachable;
+ val.* = value;
+ return val.toJS(context).asObjectRef();
+ }
+
const res = value.toJS(context, exception);
if (@TypeOf(res) == JSC.C.JSValueRef) {
@@ -313,11 +319,20 @@ pub const To = struct {
_: js.JSStringRef,
exception: js.ExceptionRef,
) js.JSValueRef {
- return withType(std.meta.fieldInfo(Type, field).field_type, @field(this, @tagName(field)), ctx, exception);
+ return withType(std.meta.fieldInfo(Type, field).type, @field(this, @tagName(field)), ctx, exception);
}
}.rfn;
}
+ pub const JSC_C_Function = fn (
+ js.JSContextRef,
+ js.JSObjectRef,
+ js.JSObjectRef,
+ usize,
+ [*c]const js.JSValueRef,
+ js.ExceptionRef,
+ ) callconv(.C) js.JSValueRef;
+
pub fn Callback(
comptime ZigContextType: type,
comptime ctxfn: fn (
@@ -838,7 +853,7 @@ pub fn NewConstructor(
) type {
return struct {
pub usingnamespace NewClassWithInstanceType(void, InstanceType.Class.class_options, staticFunctions, properties, InstanceType);
- const name_string = &ZigString.init(InstanceType.Class.class_options.name);
+ const name_string = ZigString.static(InstanceType.Class.class_options.name);
pub fn constructor(ctx: js.JSContextRef) callconv(.C) js.JSObjectRef {
return JSValue.makeWithNameAndPrototype(
ctx.ptr(),
@@ -907,7 +922,7 @@ pub fn NewClassWithInstanceType(
arguments: [*c]const js.JSValueRef,
exception: js.ExceptionRef,
) callconv(.C) js.JSValueRef {
- return &complete_definition.callAsConstructor.?(ctx, function, argumentCount, arguments, exception);
+ return getClassDefinition().callAsConstructor.?(ctx, function, argumentCount, arguments, exception);
}
};
@@ -929,14 +944,60 @@ pub fn NewClassWithInstanceType(
}
pub const Constructor = ConstructorWrapper.rfn;
- const class_definition_ptr = &complete_definition;
+
+ var class_definition: js.JSClassDefinition = undefined;
+ var class_definition_set: bool = false;
+ const static_functions__: [function_name_literals.len + 1]js.JSStaticFunction = if (function_name_literals.len > 0) generateDef([function_name_literals.len + 1]js.JSStaticFunction) else undefined;
+ const static_values_ptr = &static_properties;
+
+ fn generateClassDefinition() void {
+ class_definition = comptime brk: {
+ var def = generateDef(JSC.C.JSClassDefinition);
+ if (function_name_literals.len > 0)
+ def.staticFunctions = &static_functions__;
+ if (options.no_inheritance) {
+ def.attributes = JSC.C.JSClassAttributes.kJSClassAttributeNoAutomaticPrototype;
+ }
+ if (property_names.len > 0) {
+ def.staticValues = static_values_ptr;
+ }
+
+ def.className = options.name.ptr;
+ // def.getProperty = getPropertyCallback;
+
+ if (def.callAsConstructor == null) {
+ def.callAsConstructor = &throwInvalidConstructorError;
+ }
+
+ if (def.callAsFunction == null) {
+ def.callAsFunction = &throwInvalidFunctionError;
+ }
+
+ if (def.getPropertyNames == null) {
+ def.getPropertyNames = &getPropertyNames;
+ }
+
+ if (!singleton and def.hasInstance == null)
+ def.hasInstance = &customHasInstance;
+ break :brk def;
+ };
+ }
+
+ fn getClassDefinition() *const JSC.C.JSClassDefinition {
+ if (!class_definition_set) {
+ class_definition_set = true;
+ generateClassDefinition();
+ }
+
+ return &class_definition;
+ }
pub fn get() callconv(.C) [*c]js.JSClassRef {
var lazy = lazy_ref;
if (!lazy.loaded) {
lazy = .{
- .ref = js.JSClassCreate(class_definition_ptr),
+ .ref = js.JSClassCreate(getClassDefinition()),
.loaded = true,
};
lazy_ref = lazy;
@@ -1064,7 +1125,7 @@ pub fn NewClassWithInstanceType(
js.ExceptionRef,
) js.JSValueRef;
- if (Func.Fn.args.len == @typeInfo(WithPropFn).Fn.args.len) {
+ if (Func.Fn.params.len == @typeInfo(WithPropFn).Fn.params.len) {
return func(
this,
ctx,
@@ -1120,43 +1181,45 @@ pub fn NewClassWithInstanceType(
};
}
- pub inline fn getDefinition() js.JSClassDefinition {
- var definition = complete_definition;
- definition.className = options.name;
- return definition;
- }
-
pub fn getPropertyNames(
_: js.JSContextRef,
_: js.JSObjectRef,
props: js.JSPropertyNameAccumulatorRef,
) callconv(.C) void {
if (comptime property_name_refs.len > 0) {
- comptime var i: usize = 0;
if (!property_name_refs_set) {
+ comptime var i: usize = 0;
property_name_refs_set = true;
- inline while (i < property_name_refs.len) : (i += 1) {
+ inline while (i < comptime property_name_refs.len) : (i += 1) {
property_name_refs[i] = js.JSStringCreateStatic(property_names[i].ptr, property_names[i].len);
}
comptime i = 0;
- }
- inline while (i < property_name_refs.len) : (i += 1) {
- js.JSPropertyNameAccumulatorAddName(props, property_name_refs[i]);
+ } else {
+ comptime var i: usize = 0;
+ inline while (i < property_name_refs.len) : (i += 1) {
+ js.JSPropertyNameAccumulatorAddName(props, property_name_refs[i]);
+ }
}
}
+ const ref_len = comptime function_name_refs.len;
if (comptime function_name_refs.len > 0) {
- comptime var j: usize = 0;
if (!function_name_refs_set) {
+ comptime var j: usize = 0;
function_name_refs_set = true;
- inline while (j < function_name_refs.len) : (j += 1) {
+ inline while (j < ref_len) : (j += 1) {
function_name_refs[j] = js.JSStringCreateStatic(function_names[j].ptr, function_names[j].len);
}
comptime j = 0;
- }
- inline while (j < function_name_refs.len) : (j += 1) {
- js.JSPropertyNameAccumulatorAddName(props, function_name_refs[j]);
+ inline while (j < ref_len) : (j += 1) {
+ js.JSPropertyNameAccumulatorAddName(props, function_name_refs[j]);
+ }
+ } else {
+ comptime var j: usize = 0;
+ inline while (j < ref_len) : (j += 1) {
+ js.JSPropertyNameAccumulatorAddName(props, function_name_refs[j]);
+ }
}
}
}
@@ -1173,10 +1236,10 @@ pub fn NewClassWithInstanceType(
.attributes = js.JSPropertyAttributes.kJSPropertyAttributeNone,
},
);
- for (property_name_literals) |_, i| {
+ for (property_name_literals) |lit, i| {
props[i] = brk2: {
var static_prop = JSC.C.JSStaticValue{
- .name = property_names[i][0.. :0].ptr,
+ .name = lit.ptr[0..lit.len :0],
.getProperty = null,
.setProperty = null,
.attributes = @intToEnum(js.JSPropertyAttributes, 0),
@@ -1196,7 +1259,7 @@ pub fn NewClassWithInstanceType(
// this madness is a workaround for stage1 compiler bugs
fn generateDef(comptime ReturnType: type) ReturnType {
- var count = 0;
+ var count: usize = 0;
var def: js.JSClassDefinition = js.JSClassDefinition{
.version = 0,
.attributes = js.JSClassAttributes.kJSClassAttributeNone,
@@ -1216,80 +1279,80 @@ pub fn NewClassWithInstanceType(
.hasInstance = null,
.convertToType = null,
};
-
var __static_functions: [function_name_literals.len + 1]js.JSStaticFunction = undefined;
for (__static_functions) |_, i| {
__static_functions[i] = js.JSStaticFunction{
- .name = @intToPtr([*c]const u8, 0),
+ .name = "",
.callAsFunction = null,
.attributes = js.JSPropertyAttributes.kJSPropertyAttributeNone,
};
}
- for (function_name_literals) |function_name_literal, i| {
- const is_read_only = options.read_only;
+ @setEvalBranchQuota(50_000);
+ const is_read_only = options.read_only;
+
+ inline for (comptime function_name_literals) |function_name_literal| {
+ const CtxField = comptime @field(staticFunctions, function_name_literal);
- _ = i;
- switch (@typeInfo(@TypeOf(@field(staticFunctions, function_name_literal)))) {
+ switch (comptime @typeInfo(@TypeOf(CtxField))) {
.Struct => {
- const CtxField = @field(staticFunctions, function_name_literals[i]);
-
- if (strings.eqlComptime(function_name_literal, "constructor")) {
- def.callAsConstructor = To.JS.Constructor(staticFunctions.constructor.rfn).rfn;
- } else if (strings.eqlComptime(function_name_literal, "finalize")) {
- def.finalize = To.JS.Finalize(ZigType, staticFunctions.finalize.rfn).rfn;
- } else if (strings.eqlComptime(function_name_literal, "call")) {
- def.callAsFunction = To.JS.Callback(ZigType, staticFunctions.call.rfn).rfn;
- } else if (strings.eqlComptime(function_name_literal, "callAsFunction")) {
+ if (comptime strings.eqlComptime(function_name_literal, "constructor")) {
+ def.callAsConstructor = &To.JS.Constructor(staticFunctions.constructor.rfn).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "finalize")) {
+ def.finalize = &To.JS.Finalize(ZigType, staticFunctions.finalize.rfn).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "call")) {
+ def.callAsFunction = &To.JS.Callback(ZigType, staticFunctions.call.rfn).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "callAsFunction")) {
const ctxfn = @field(staticFunctions, function_name_literal).rfn;
- const Func: std.builtin.TypeInfo.Fn = @typeInfo(@TypeOf(ctxfn)).Fn;
+ const Func: std.builtin.Type.Fn = @typeInfo(@TypeOf(if (@typeInfo(@TypeOf(ctxfn)) == .Pointer) ctxfn.* else ctxfn)).Fn;
- const PointerType = std.meta.Child(Func.args[0].arg_type.?);
+ const PointerType = std.meta.Child(Func.params[0].type.?);
- def.callAsFunction = if (Func.calling_convention == .C) ctxfn else To.JS.Callback(
+ def.callAsFunction = &(if (Func.calling_convention == .C) ctxfn else To.JS.Callback(
PointerType,
ctxfn,
- ).rfn;
- } else if (strings.eqlComptime(function_name_literal, "hasProperty")) {
+ ).rfn);
+ } else if (comptime strings.eqlComptime(function_name_literal, "hasProperty")) {
def.hasProperty = @field(staticFunctions, "hasProperty").rfn;
- } else if (strings.eqlComptime(function_name_literal, "getProperty")) {
+ } else if (comptime strings.eqlComptime(function_name_literal, "getProperty")) {
def.getProperty = @field(staticFunctions, "getProperty").rfn;
- } else if (strings.eqlComptime(function_name_literal, "setProperty")) {
+ } else if (comptime strings.eqlComptime(function_name_literal, "setProperty")) {
def.setProperty = @field(staticFunctions, "setProperty").rfn;
- } else if (strings.eqlComptime(function_name_literal, "deleteProperty")) {
- def.deleteProperty = @field(staticFunctions, "deleteProperty").rfn;
- } else if (strings.eqlComptime(function_name_literal, "getPropertyNames")) {
+ } else if (comptime strings.eqlComptime(function_name_literal, "deleteProperty")) {
+ def.deleteProperty = &@field(staticFunctions, "deleteProperty").rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "getPropertyNames")) {
def.getPropertyNames = @field(staticFunctions, "getPropertyNames").rfn;
- } else if (strings.eqlComptime(function_name_literal, "convertToType")) {
+ } else if (comptime strings.eqlComptime(function_name_literal, "convertToType")) {
def.convertToType = @field(staticFunctions, "convertToType").rfn;
- } else if (!@hasField(@TypeOf(CtxField), "is_dom_call")) {
+ } else if (comptime !@hasField(@TypeOf(CtxField), "is_dom_call")) {
if (!@hasField(@TypeOf(CtxField), "rfn")) {
@compileError("Expected " ++ options.name ++ "." ++ function_name_literal ++ " to have .rfn");
}
const ctxfn = CtxField.rfn;
- const Func: std.builtin.TypeInfo.Fn = @typeInfo(@TypeOf(ctxfn)).Fn;
+ const Func: std.builtin.Type.Fn = @typeInfo(@TypeOf(if (@typeInfo(@TypeOf(ctxfn)) == .Pointer) ctxfn.* else ctxfn)).Fn;
var attributes: c_uint = @enumToInt(js.JSPropertyAttributes.kJSPropertyAttributeNone);
- if (is_read_only or hasReadOnly(@TypeOf(CtxField))) {
+ if (comptime is_read_only or hasReadOnly(@TypeOf(CtxField))) {
attributes |= @enumToInt(js.JSPropertyAttributes.kJSPropertyAttributeReadOnly);
}
- if (hasEnumerable(@TypeOf(CtxField)) and !CtxField.enumerable) {
+ if (comptime hasEnumerable(@TypeOf(CtxField)) and !CtxField.enumerable) {
attributes |= @enumToInt(js.JSPropertyAttributes.kJSPropertyAttributeDontEnum);
}
- var PointerType = void;
-
- if (Func.args[0].arg_type.? != void) {
- PointerType = std.meta.Child(Func.args[0].arg_type.?);
- }
+ const PointerType = comptime brk: {
+ if (Func.params[0].type.? != void) {
+ break :brk std.meta.Child(Func.params[0].type.?);
+ }
+ break :brk void;
+ };
__static_functions[count] = js.JSStaticFunction{
- .name = @ptrCast([*c]const u8, function_names[i].ptr),
- .callAsFunction = if (Func.calling_convention == .C) ctxfn else To.JS.Callback(
+ .name = std.meta.assumeSentinel(function_name_literal ++ [_]u8{0}, 0),
+ .callAsFunction = if (Func.calling_convention == .C) &CtxField.rfn else &To.JS.Callback(
PointerType,
- ctxfn,
+ if (@typeInfo(@TypeOf(ctxfn)) == .Pointer) ctxfn.* else ctxfn,
).rfn,
.attributes = @intToEnum(js.JSPropertyAttributes, attributes),
};
@@ -1298,16 +1361,16 @@ pub fn NewClassWithInstanceType(
}
},
.Fn => {
- if (strings.eqlComptime(function_name_literal, "constructor")) {
- def.callAsConstructor = To.JS.Constructor(staticFunctions.constructor).rfn;
- } else if (strings.eqlComptime(function_name_literal, "finalize")) {
- def.finalize = To.JS.Finalize(ZigType, staticFunctions.finalize).rfn;
- } else if (strings.eqlComptime(function_name_literal, "call")) {
- def.callAsFunction = To.JS.Callback(ZigType, staticFunctions.call).rfn;
- } else if (strings.eqlComptime(function_name_literal, "getPropertyNames")) {
- def.getPropertyNames = To.JS.Callback(ZigType, staticFunctions.getPropertyNames).rfn;
- } else if (strings.eqlComptime(function_name_literal, "hasInstance")) {
- def.hasInstance = staticFunctions.hasInstance;
+ if (comptime strings.eqlComptime(function_name_literal, "constructor")) {
+ def.callAsConstructor = &To.JS.Constructor(staticFunctions.constructor).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "finalize")) {
+ def.finalize = &To.JS.Finalize(ZigType, staticFunctions.finalize).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "call")) {
+ def.callAsFunction = &To.JS.Callback(ZigType, staticFunctions.call).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "getPropertyNames")) {
+ def.getPropertyNames = &To.JS.Callback(ZigType, staticFunctions.getPropertyNames).rfn;
+ } else if (comptime strings.eqlComptime(function_name_literal, "hasInstance")) {
+ def.hasInstance = &staticFunctions.hasInstance;
} else {
const attributes: js.JSPropertyAttributes = brk: {
var base = @enumToInt(js.JSPropertyAttributes.kJSPropertyAttributeNone);
@@ -1319,8 +1382,8 @@ pub fn NewClassWithInstanceType(
};
__static_functions[count] = js.JSStaticFunction{
- .name = @ptrCast([*c]const u8, function_names[i].ptr),
- .callAsFunction = To.JS.Callback(
+ .name = std.meta.assumeSentinel(function_name_literal ++ [_]u8{0}, 0),
+ .callAsFunction = &To.JS.Callback(
ZigType,
@field(staticFunctions, function_name_literal),
).rfn,
@@ -1334,48 +1397,12 @@ pub fn NewClassWithInstanceType(
}
}
- if (ReturnType == JSC.C.JSClassDefinition) {
+ if (comptime ReturnType == JSC.C.JSClassDefinition) {
return def;
} else {
return __static_functions;
}
}
-
- const base_def_ = generateDef(JSC.C.JSClassDefinition);
- const static_functions__: [function_name_literals.len + 1]js.JSStaticFunction = generateDef([function_name_literals.len + 1]js.JSStaticFunction);
- const static_functions_ptr = &static_functions__;
- const static_values_ptr = &static_properties;
- const class_name_str: stringZ = options.name;
-
- const complete_definition = brk: {
- var def = base_def_;
- def.staticFunctions = static_functions_ptr;
- if (options.no_inheritance) {
- def.attributes = JSC.C.JSClassAttributes.kJSClassAttributeNoAutomaticPrototype;
- }
- if (property_names.len > 0) {
- def.staticValues = static_values_ptr;
- }
-
- def.className = class_name_str;
- // def.getProperty = getPropertyCallback;
-
- if (def.callAsConstructor == null) {
- def.callAsConstructor = throwInvalidConstructorError;
- }
-
- if (def.callAsFunction == null) {
- def.callAsFunction = throwInvalidFunctionError;
- }
-
- if (def.getPropertyNames == null) {
- def.getPropertyNames = getPropertyNames;
- }
-
- if (!singleton and def.hasInstance == null)
- def.hasInstance = customHasInstance;
- break :brk def;
- };
};
}
@@ -1923,7 +1950,7 @@ pub const RefString = struct {
allocator: std.mem.Allocator,
ctx: ?*anyopaque = null,
- onBeforeDeinit: ?Callback = null,
+ onBeforeDeinit: ?*const Callback = null,
pub const Hash = u32;
pub const Map = std.HashMap(Hash, *JSC.RefString, IdentityContext(Hash), 80);
@@ -2077,14 +2104,11 @@ const FFI = JSC.FFI;
pub const JSPrivateDataPtr = TaggedPointerUnion(.{
AttributeIterator,
BigIntStats,
- Blob,
- Body,
BuildError,
Comment,
DebugServer,
DebugSSLServer,
DescribeScope,
- DirEnt,
DocEnd,
DocType,
Element,
@@ -2095,10 +2119,7 @@ pub const JSPrivateDataPtr = TaggedPointerUnion(.{
LazyPropertiesObject,
ModuleNamespace,
- NodeFS,
- Request,
ResolveError,
- Response,
Router,
Server,
@@ -2130,7 +2151,7 @@ pub const JSPropertyNameIterator = struct {
pub fn getterWrap(comptime Container: type, comptime name: string) GetterType(Container) {
return struct {
const FunctionType = @TypeOf(@field(Container, name));
- const FunctionTypeInfo: std.builtin.TypeInfo.Fn = @typeInfo(FunctionType).Fn;
+ const FunctionTypeInfo: std.builtin.Type.Fn = @typeInfo(FunctionType).Fn;
const ArgsTuple = std.meta.ArgsTuple(FunctionType);
pub fn callback(
@@ -2141,11 +2162,11 @@ pub fn getterWrap(comptime Container: type, comptime name: string) GetterType(Co
exception: js.ExceptionRef,
) js.JSObjectRef {
const result: JSValue = if (comptime std.meta.fields(ArgsTuple).len == 1)
- @call(.{}, @field(Container, name), .{
+ @call(.auto, @field(Container, name), .{
this,
})
else
- @call(.{}, @field(Container, name), .{ this, ctx.ptr() });
+ @call(.auto, @field(Container, name), .{ this, ctx.ptr() });
if (!result.isUndefinedOrNull() and result.isError()) {
exception.* = result.asObjectRef();
return null;
@@ -2159,7 +2180,7 @@ pub fn getterWrap(comptime Container: type, comptime name: string) GetterType(Co
pub fn setterWrap(comptime Container: type, comptime name: string) SetterType(Container) {
return struct {
const FunctionType = @TypeOf(@field(Container, name));
- const FunctionTypeInfo: std.builtin.TypeInfo.Fn = @typeInfo(FunctionType).Fn;
+ const FunctionTypeInfo: std.builtin.Type.Fn = @typeInfo(FunctionType).Fn;
pub fn callback(
this: *Container,
@@ -2169,7 +2190,7 @@ pub fn setterWrap(comptime Container: type, comptime name: string) SetterType(Co
value: js.JSValueRef,
exception: js.ExceptionRef,
) bool {
- @call(.{}, @field(Container, name), .{ this, JSC.JSValue.fromRef(value), exception, ctx.ptr() });
+ @call(.auto, @field(Container, name), .{ this, JSC.JSValue.fromRef(value), exception, ctx.ptr() });
return exception.* == null;
}
}.callback;
@@ -2370,7 +2391,7 @@ pub fn DOMCall(
arguments_ptr: [*]const JSC.JSValue,
arguments_len: usize,
) callconv(.C) JSValue {
- return @call(.{}, @field(Container, functionName), .{
+ return @call(.auto, @field(Container, functionName), .{
globalObject,
thisValue,
arguments_ptr[0..arguments_len],
@@ -2382,8 +2403,8 @@ pub fn DOMCall(
pub const Arguments = std.meta.ArgsTuple(Fastpath);
pub const Export = shim.exportFunctions(.{
- .@"slowpath" = slowpath,
- .@"fastpath" = fastpath,
+ .slowpath = slowpath,
+ .fastpath = fastpath,
});
pub fn put(globalObject: *JSC.JSGlobalObject, value: JSValue) void {
@@ -2421,14 +2442,14 @@ pub fn DOMCall(
},
1 => {
try writer.writeAll(", ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].type));
try writer.writeAll("));\n");
},
2 => {
try writer.writeAll(", ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].type));
try writer.writeAll(", ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[3].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[3].type));
try writer.writeAll("));\n");
},
else => @compileError("Must be <= 3 arguments"),
@@ -2449,14 +2470,14 @@ pub fn DOMCall(
},
1 => {
try writer.writeAll(", ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].type));
try writer.writeAll(" arg1)) {\n");
},
2 => {
try writer.writeAll(", ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[2].type));
try writer.writeAll(" arg1, ");
- try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[3].field_type));
+ try writer.writeAll(DOMCallArgumentTypeWrapper(Fields[3].type));
try writer.writeAll(" arg2)) {\n");
},
else => @compileError("Must be <= 3 arguments"),
@@ -2543,14 +2564,14 @@ pub fn DOMCall(
0 => {},
1 => {
try writer.writeAll(",\n ");
- try writer.writeAll(DOMCallArgumentType(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentType(Fields[2].type));
try writer.writeAll("\n ");
},
2 => {
try writer.writeAll(",\n ");
- try writer.writeAll(DOMCallArgumentType(Fields[2].field_type));
+ try writer.writeAll(DOMCallArgumentType(Fields[2].type));
try writer.writeAll(",\n ");
- try writer.writeAll(DOMCallArgumentType(Fields[3].field_type));
+ try writer.writeAll(DOMCallArgumentType(Fields[3].type));
try writer.writeAll("\n ");
},
else => @compileError("Must be <= 3 arguments"),
@@ -2608,7 +2629,7 @@ pub fn wrapWithHasContainer(
) MethodType(Container, has_container) {
return struct {
const FunctionType = @TypeOf(@field(Container, name));
- const FunctionTypeInfo: std.builtin.TypeInfo.Fn = @typeInfo(FunctionType).Fn;
+ const FunctionTypeInfo: std.builtin.Type.Fn = @typeInfo(FunctionType).Fn;
const Args = std.meta.ArgsTuple(FunctionType);
const eater = if (auto_protect) JSC.Node.ArgumentsSlice.protectEatNext else JSC.Node.ArgumentsSlice.nextEat;
@@ -2624,8 +2645,8 @@ pub fn wrapWithHasContainer(
var args: Args = undefined;
comptime var i: usize = 0;
- inline while (i < FunctionTypeInfo.args.len) : (i += 1) {
- const ArgType = comptime FunctionTypeInfo.args[i].arg_type.?;
+ inline while (i < FunctionTypeInfo.params.len) : (i += 1) {
+ const ArgType = comptime FunctionTypeInfo.params[i].type.?;
switch (comptime ArgType) {
*Container => {
@@ -2753,7 +2774,7 @@ pub fn wrapWithHasContainer(
}
}
- var result: JSValue = @call(.{}, @field(Container, name), args);
+ var result: JSValue = @call(.auto, @field(Container, name), args);
if (!result.isEmptyOrUndefinedOrNull() and result.isError()) {
exception.* = result.asObjectRef();
iter.deinit();
@@ -2796,7 +2817,7 @@ pub fn wrapInstanceMethod(
) InstanceMethodType(Container) {
return struct {
const FunctionType = @TypeOf(@field(Container, name));
- const FunctionTypeInfo: std.builtin.TypeInfo.Fn = @typeInfo(FunctionType).Fn;
+ const FunctionTypeInfo: std.builtin.Type.Fn = @typeInfo(FunctionType).Fn;
const Args = std.meta.ArgsTuple(FunctionType);
const eater = if (auto_protect) JSC.Node.ArgumentsSlice.protectEatNext else JSC.Node.ArgumentsSlice.nextEat;
@@ -2805,13 +2826,13 @@ pub fn wrapInstanceMethod(
globalThis: *JSC.JSGlobalObject,
callframe: *JSC.CallFrame,
) callconv(.C) JSC.JSValue {
- const arguments = callframe.arguments(FunctionTypeInfo.args.len);
+ const arguments = callframe.arguments(FunctionTypeInfo.params.len);
var iter = JSC.Node.ArgumentsSlice.init(globalThis.bunVM(), arguments.ptr[0..arguments.len]);
var args: Args = undefined;
comptime var i: usize = 0;
- inline while (i < FunctionTypeInfo.args.len) : (i += 1) {
- const ArgType = comptime FunctionTypeInfo.args[i].arg_type.?;
+ inline while (i < FunctionTypeInfo.params.len) : (i += 1) {
+ const ArgType = comptime FunctionTypeInfo.params[i].type.?;
switch (comptime ArgType) {
*Container => {
@@ -2930,7 +2951,7 @@ pub fn wrapInstanceMethod(
defer iter.deinit();
- return @call(.{}, @field(Container, name), args);
+ return @call(.auto, @field(Container, name), args);
}
}.method;
}
@@ -2942,7 +2963,7 @@ pub fn wrapStaticMethod(
) JSC.Codegen.StaticCallbackType {
return struct {
const FunctionType = @TypeOf(@field(Container, name));
- const FunctionTypeInfo: std.builtin.TypeInfo.Fn = @typeInfo(FunctionType).Fn;
+ const FunctionTypeInfo: std.builtin.Type.Fn = @typeInfo(FunctionType).Fn;
const Args = std.meta.ArgsTuple(FunctionType);
const eater = if (auto_protect) JSC.Node.ArgumentsSlice.protectEatNext else JSC.Node.ArgumentsSlice.nextEat;
@@ -2950,13 +2971,13 @@ pub fn wrapStaticMethod(
globalThis: *JSC.JSGlobalObject,
callframe: *JSC.CallFrame,
) callconv(.C) JSC.JSValue {
- const arguments = callframe.arguments(FunctionTypeInfo.args.len);
+ const arguments = callframe.arguments(FunctionTypeInfo.params.len);
var iter = JSC.Node.ArgumentsSlice.init(globalThis.bunVM(), arguments.ptr[0..arguments.len]);
var args: Args = undefined;
comptime var i: usize = 0;
- inline while (i < FunctionTypeInfo.args.len) : (i += 1) {
- const ArgType = comptime FunctionTypeInfo.args[i].arg_type.?;
+ inline while (i < FunctionTypeInfo.params.len) : (i += 1) {
+ const ArgType = comptime FunctionTypeInfo.params[i].type.?;
switch (comptime ArgType) {
*JSC.JSGlobalObject => {
@@ -3072,59 +3093,11 @@ pub fn wrapStaticMethod(
defer iter.deinit();
- return @call(.{}, @field(Container, name), args);
+ return @call(.auto, @field(Container, name), args);
}
}.method;
}
-pub fn cachedBoundFunction(comptime name: [:0]const u8, comptime callback: anytype) (fn (
- _: void,
- ctx: js.JSContextRef,
- _: js.JSValueRef,
- _: js.JSStringRef,
- _: js.ExceptionRef,
-) js.JSValueRef) {
- return struct {
- const name_ = name;
- pub fn call(
- arg2: js.JSContextRef,
- arg3: js.JSObjectRef,
- arg4: js.JSObjectRef,
- arg5: usize,
- arg6: [*c]const js.JSValueRef,
- arg7: js.ExceptionRef,
- ) callconv(.C) js.JSObjectRef {
- return callback(
- {},
- arg2,
- arg3,
- arg4,
- arg6[0..arg5],
- arg7,
- );
- }
-
- pub fn getter(
- _: void,
- ctx: js.JSContextRef,
- _: js.JSValueRef,
- _: js.JSStringRef,
- _: js.ExceptionRef,
- ) js.JSValueRef {
- const name_slice = std.mem.span(name_);
- var existing = ctx.ptr().getCachedObject(&ZigString.init(name_slice));
- if (existing.isEmpty()) {
- return ctx.ptr().putCachedObject(
- &ZigString.init(name_slice),
- JSValue.fromRef(JSC.C.JSObjectMakeFunctionWithCallback(ctx, JSC.C.JSStringCreateStatic(name_slice.ptr, name_slice.len), call)),
- ).asObjectRef();
- }
-
- return existing.asObjectRef();
- }
- }.getter;
-}
-
/// Track whether an object should keep the event loop alive
pub const Ref = struct {
has: bool = false,
@@ -3163,7 +3136,7 @@ pub const PollRef = struct {
/// Make calling ref() on this poll into a no-op.
pub fn disable(this: *PollRef) void {
- this.unref(JSC.VirtualMachine.vm);
+ this.unref(JSC.VirtualMachine.get());
this.status = .done;
}
@@ -3218,7 +3191,7 @@ pub const FilePoll = struct {
fd: u32 = invalid_fd,
flags: Flags.Set = Flags.Set{},
- owner: Owner = Deactivated.owner,
+ owner: Owner = undefined,
/// We re-use FilePoll objects to avoid allocating new ones.
///
@@ -3234,7 +3207,7 @@ pub const FilePoll = struct {
const BufferedInput = Subprocess.BufferedInput;
const BufferedOutput = Subprocess.BufferedOutput;
const Deactivated = opaque {
- pub var owner = Owner.init(@intToPtr(*Deactivated, @as(usize, 0xDEADBEEF)));
+ pub var owner: Owner = Owner.init(@intToPtr(*Deactivated, @as(usize, 0xDEADBEEF)));
};
pub const Owner = bun.TaggedPointerUnion(.{
@@ -3300,7 +3273,7 @@ pub const FilePoll = struct {
}
pub fn deinit(this: *FilePoll) void {
- var vm = JSC.VirtualMachine.vm;
+ var vm = JSC.VirtualMachine.get();
this.deinitWithVM(vm);
}
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
index 21e6d1185..15a1d9111 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h
@@ -18,4 +18,6 @@ std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectConstructor;std:
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForTextDecoderConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForRequest;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForRequestConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForResponse;
std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForResponseConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlob;
-std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlobConstructor; \ No newline at end of file
+std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlobConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForDirent;
+std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForDirentConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeJSFS;
+std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeJSFSConstructor; \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
index f8e81b0c1..273a699c5 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h
@@ -18,4 +18,6 @@ std::unique_ptr<IsoSubspace> m_subspaceForExpectConstructor;std::unique_ptr<IsoS
std::unique_ptr<IsoSubspace> m_subspaceForTextDecoderConstructor;std::unique_ptr<IsoSubspace> m_subspaceForRequest;
std::unique_ptr<IsoSubspace> m_subspaceForRequestConstructor;std::unique_ptr<IsoSubspace> m_subspaceForResponse;
std::unique_ptr<IsoSubspace> m_subspaceForResponseConstructor;std::unique_ptr<IsoSubspace> m_subspaceForBlob;
-std::unique_ptr<IsoSubspace> m_subspaceForBlobConstructor; \ No newline at end of file
+std::unique_ptr<IsoSubspace> m_subspaceForBlobConstructor;std::unique_ptr<IsoSubspace> m_subspaceForDirent;
+std::unique_ptr<IsoSubspace> m_subspaceForDirentConstructor;std::unique_ptr<IsoSubspace> m_subspaceForNodeJSFS;
+std::unique_ptr<IsoSubspace> m_subspaceForNodeJSFSConstructor; \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
index f2d881bb5..cefb58178 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
@@ -117,4 +117,16 @@ JSC::Structure* JSBlobStructure() { return m_JSBlob.getInitializedOnMainThread(t
JSC::JSValue JSBlobPrototype() { return m_JSBlob.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_JSBlob;
bool hasJSBlobSetterValue { false };
- mutable JSC::WriteBarrier<JSC::Unknown> m_JSBlobSetterValue; \ No newline at end of file
+ mutable JSC::WriteBarrier<JSC::Unknown> m_JSBlobSetterValue;
+JSC::Structure* JSDirentStructure() { return m_JSDirent.getInitializedOnMainThread(this); }
+ JSC::JSObject* JSDirentConstructor() { return m_JSDirent.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSDirentPrototype() { return m_JSDirent.prototypeInitializedOnMainThread(this); }
+ JSC::LazyClassStructure m_JSDirent;
+ bool hasJSDirentSetterValue { false };
+ mutable JSC::WriteBarrier<JSC::Unknown> m_JSDirentSetterValue;
+JSC::Structure* JSNodeJSFSStructure() { return m_JSNodeJSFS.getInitializedOnMainThread(this); }
+ JSC::JSObject* JSNodeJSFSConstructor() { return m_JSNodeJSFS.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSNodeJSFSPrototype() { return m_JSNodeJSFS.prototypeInitializedOnMainThread(this); }
+ JSC::LazyClassStructure m_JSNodeJSFS;
+ bool hasJSNodeJSFSSetterValue { false };
+ mutable JSC::WriteBarrier<JSC::Unknown> m_JSNodeJSFSSetterValue; \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
index ade20e72a..64e0bb9b2 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
@@ -119,6 +119,18 @@ void GlobalObject::initGeneratedLazyClasses() {
init.setStructure(WebCore::JSBlob::createStructure(init.vm, init.global, init.prototype));
init.setConstructor(WebCore::JSBlob::createConstructor(init.vm, init.global, init.prototype));
});
+ m_JSDirent.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSDirent::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSDirent::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSDirent::createConstructor(init.vm, init.global, init.prototype));
+ });
+ m_JSNodeJSFS.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSNodeJSFS::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSNodeJSFS::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSNodeJSFS::createConstructor(init.vm, init.global, init.prototype));
+ });
}
template<typename Visitor>
void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor)
@@ -143,4 +155,6 @@ void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor&
thisObject->m_JSRequest.visit(visitor); visitor.append(thisObject->m_JSRequestSetterValue);
thisObject->m_JSResponse.visit(visitor); visitor.append(thisObject->m_JSResponseSetterValue);
thisObject->m_JSBlob.visit(visitor); visitor.append(thisObject->m_JSBlobSetterValue);
+ thisObject->m_JSDirent.visit(visitor); visitor.append(thisObject->m_JSDirentSetterValue);
+ thisObject->m_JSNodeJSFS.visit(visitor); visitor.append(thisObject->m_JSNodeJSFSSetterValue);
} \ No newline at end of file
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp
index e3fb6123f..c80251c13 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses.cpp
+++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp
@@ -8961,5 +8961,2307 @@ extern "C" EncodedJSValue Blob__create(Zig::GlobalObject* globalObject, void* pt
return JSValue::encode(instance);
}
+class JSDirentPrototype final : public JSC::JSNonFinalObject {
+public:
+ using Base = JSC::JSNonFinalObject;
+
+ static JSDirentPrototype* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSDirentPrototype* ptr = new (NotNull, JSC::allocateCell<JSDirentPrototype>(vm)) JSDirentPrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm, globalObject);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ template<typename CellType, JSC::SubspaceAccess>
+ static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ return &vm.plainObjectSpace();
+ }
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSDirentPrototype(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ : Base(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSC::JSGlobalObject*);
+};
+
+class JSDirentConstructor final : public JSC::InternalFunction {
+public:
+ using Base = JSC::InternalFunction;
+ static JSDirentConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSDirentPrototype* prototype);
+
+ static constexpr unsigned StructureFlags = Base::StructureFlags;
+ static constexpr bool needsDestruction = false;
+
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info());
+ }
+
+ template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSDirentConstructor, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForDirentConstructor.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForDirentConstructor = WTFMove(space); },
+ [](auto& spaces) { return spaces.m_subspaceForDirentConstructor.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForDirentConstructor = WTFMove(space); });
+ }
+
+ void initializeProperties(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype);
+
+ // Must be defined for each specialization class.
+ static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES construct(JSC::JSGlobalObject*, JSC::CallFrame*);
+
+ DECLARE_EXPORT_INFO;
+
+private:
+ JSDirentConstructor(JSC::VM& vm, JSC::Structure* structure);
+ void finishCreation(JSC::VM&, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype);
+};
+
+extern "C" void* DirentClass__construct(JSC::JSGlobalObject*, JSC::CallFrame*);
+JSC_DECLARE_CUSTOM_GETTER(jsDirentConstructor);
+extern "C" void DirentClass__finalize(void*);
+
+extern "C" EncodedJSValue DirentPrototype__isBlockDevice(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isBlockDeviceCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isCharacterDevice(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isCharacterDeviceCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isDirectory(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isDirectoryCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isFIFO(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isFIFOCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isFileCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isSocket(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isSocketCallback);
+
+extern "C" EncodedJSValue DirentPrototype__isSymbolicLink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isSymbolicLinkCallback);
+
+extern "C" JSC::EncodedJSValue DirentPrototype__getName(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(DirentPrototype__nameGetterWrap);
+
+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDirentPrototype, JSDirentPrototype::Base);
+
+static const HashTableValue JSDirentPrototypeTableValues[] = {
+ { "isBlockDevice"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isBlockDeviceCallback, 0 } },
+ { "isCharacterDevice"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isCharacterDeviceCallback, 0 } },
+ { "isDirectory"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isDirectoryCallback, 0 } },
+ { "isFIFO"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isFIFOCallback, 0 } },
+ { "isFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isFileCallback, 0 } },
+ { "isSocket"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isSocketCallback, 0 } },
+ { "isSymbolicLink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isSymbolicLinkCallback, 0 } },
+ { "name"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, DirentPrototype__nameGetterWrap, 0 } }
+};
+
+const ClassInfo JSDirentPrototype::s_info = { "Dirent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirentPrototype) };
+
+JSC_DEFINE_CUSTOM_GETTER(jsDirentConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName))
+{
+ VM& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* prototype = jsDynamicCast<JSDirentPrototype*>(JSValue::decode(thisValue));
+
+ if (UNLIKELY(!prototype))
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ return JSValue::encode(globalObject->JSDirentConstructor());
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isBlockDeviceCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isBlockDevice(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isCharacterDeviceCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isCharacterDevice(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isDirectoryCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isDirectory(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isFIFOCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isFIFO(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isFile(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isSocketCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isSocket(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isSymbolicLinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return DirentPrototype__isSymbolicLink(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(DirentPrototype__nameGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSDirent* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ if (JSValue cachedValue = thisObject->m_name.get())
+ return JSValue::encode(cachedValue);
+
+ JSC::JSValue result = JSC::JSValue::decode(
+ DirentPrototype__getName(thisObject->wrapped(), globalObject));
+ RETURN_IF_EXCEPTION(throwScope, {});
+ thisObject->m_name.set(vm, thisObject, result);
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(result));
+}
+
+extern "C" void DirentPrototype__nameSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
+{
+ auto& vm = globalObject->vm();
+ auto* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue));
+ thisObject->m_name.set(vm, thisObject, JSValue::decode(value));
+}
+
+extern "C" EncodedJSValue DirentPrototype__nameGetCachedValue(JSC::EncodedJSValue thisValue)
+{
+ auto* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue));
+ return JSValue::encode(thisObject->m_name.get());
+}
+
+void JSDirentPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
+{
+ Base::finishCreation(vm);
+ reifyStaticProperties(vm, JSDirent::info(), JSDirentPrototypeTableValues, *this);
+ JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
+}
+
+void JSDirentConstructor::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype)
+{
+ Base::finishCreation(vm, 0, "Dirent"_s, PropertyAdditionMode::WithoutStructureTransition);
+
+ putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ ASSERT(inherits(info()));
+}
+
+JSDirentConstructor::JSDirentConstructor(JSC::VM& vm, JSC::Structure* structure)
+ : Base(vm, structure, construct, construct)
+{
+}
+
+JSDirentConstructor* JSDirentConstructor::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSDirentPrototype* prototype)
+{
+ JSDirentConstructor* ptr = new (NotNull, JSC::allocateCell<JSDirentConstructor>(vm)) JSDirentConstructor(vm, structure);
+ ptr->finishCreation(vm, globalObject, prototype);
+ return ptr;
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSDirentConstructor::construct(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ JSC::VM& vm = globalObject->vm();
+ JSObject* newTarget = asObject(callFrame->newTarget());
+ auto* constructor = globalObject->JSDirentConstructor();
+ Structure* structure = globalObject->JSDirentStructure();
+ if (constructor != newTarget) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ auto* functionGlobalObject = reinterpret_cast<Zig::GlobalObject*>(
+ // ShadowRealm functions belong to a different global object.
+ getFunctionRealm(globalObject, newTarget));
+ RETURN_IF_EXCEPTION(scope, {});
+ structure = InternalFunction::createSubclassStructure(
+ globalObject,
+ newTarget,
+ functionGlobalObject->JSDirentStructure());
+ }
+
+ void* ptr = DirentClass__construct(globalObject, callFrame);
+
+ if (UNLIKELY(!ptr)) {
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ JSDirent* instance = JSDirent::create(vm, globalObject, structure, ptr);
+
+ return JSValue::encode(instance);
+}
+
+void JSDirentConstructor::initializeProperties(VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype)
+{
+}
+
+const ClassInfo JSDirentConstructor::s_info = { "Function"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirentConstructor) };
+
+extern "C" EncodedJSValue Dirent__getConstructor(Zig::GlobalObject* globalObject)
+{
+ return JSValue::encode(globalObject->JSDirentConstructor());
+}
+
+JSDirent::~JSDirent()
+{
+ if (m_ctx) {
+ DirentClass__finalize(m_ctx);
+ }
+}
+void JSDirent::destroy(JSCell* cell)
+{
+ static_cast<JSDirent*>(cell)->JSDirent::~JSDirent();
+}
+
+const ClassInfo JSDirent::s_info = { "Dirent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirent) };
+
+void JSDirent::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+}
+
+JSDirent* JSDirent::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx)
+{
+ JSDirent* ptr = new (NotNull, JSC::allocateCell<JSDirent>(vm)) JSDirent(vm, structure, ctx);
+ ptr->finishCreation(vm);
+ return ptr;
+}
+
+extern "C" void* Dirent__fromJS(JSC::EncodedJSValue value)
+{
+ JSC::JSValue decodedValue = JSC::JSValue::decode(value);
+ if (!decodedValue || decodedValue.isUndefinedOrNull())
+ return nullptr;
+
+ JSDirent* object = JSC::jsDynamicCast<JSDirent*>(decodedValue);
+
+ if (!object)
+ return nullptr;
+
+ return object->wrapped();
+}
+
+extern "C" bool Dirent__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr)
+{
+ JSDirent* object = JSC::jsDynamicCast<JSDirent*>(JSValue::decode(value));
+ if (!object)
+ return false;
+
+ object->m_ctx = ptr;
+ return true;
+}
+
+extern "C" const size_t Dirent__ptrOffset = JSDirent::offsetOfWrapped();
+
+void JSDirent::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
+{
+ auto* thisObject = jsCast<JSDirent*>(cell);
+ if (void* wrapped = thisObject->wrapped()) {
+ // if (thisObject->scriptExecutionContext())
+ // analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
+ }
+ Base::analyzeHeap(cell, analyzer);
+}
+
+JSObject* JSDirent::createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+ return WebCore::JSDirentConstructor::create(vm, globalObject, WebCore::JSDirentConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<WebCore::JSDirentPrototype*>(prototype));
+}
+
+JSObject* JSDirent::createPrototype(VM& vm, JSDOMGlobalObject* globalObject)
+{
+ return JSDirentPrototype::create(vm, globalObject, JSDirentPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+extern "C" EncodedJSValue Dirent__create(Zig::GlobalObject* globalObject, void* ptr)
+{
+ auto& vm = globalObject->vm();
+ JSC::Structure* structure = globalObject->JSDirentStructure();
+ JSDirent* instance = JSDirent::create(vm, globalObject, structure, ptr);
+
+ return JSValue::encode(instance);
+}
+
+template<typename Visitor>
+void JSDirent::visitChildrenImpl(JSCell* cell, Visitor& visitor)
+{
+ JSDirent* thisObject = jsCast<JSDirent*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ Base::visitChildren(thisObject, visitor);
+
+ visitor.append(thisObject->m_name);
+}
+
+DEFINE_VISIT_CHILDREN(JSDirent);
+
+template<typename Visitor>
+void JSDirent::visitAdditionalChildren(Visitor& visitor)
+{
+ JSDirent* thisObject = this;
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+ visitor.append(thisObject->m_name);
+ ;
+}
+
+DEFINE_VISIT_ADDITIONAL_CHILDREN(JSDirent);
+
+template<typename Visitor>
+void JSDirent::visitOutputConstraintsImpl(JSCell* cell, Visitor& visitor)
+{
+ JSDirent* thisObject = jsCast<JSDirent*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ thisObject->visitAdditionalChildren<Visitor>(visitor);
+}
+
+DEFINE_VISIT_OUTPUT_CONSTRAINTS(JSDirent);
+class JSNodeJSFSPrototype final : public JSC::JSNonFinalObject {
+public:
+ using Base = JSC::JSNonFinalObject;
+
+ static JSNodeJSFSPrototype* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSNodeJSFSPrototype* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFSPrototype>(vm)) JSNodeJSFSPrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm, globalObject);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ template<typename CellType, JSC::SubspaceAccess>
+ static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ return &vm.plainObjectSpace();
+ }
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSNodeJSFSPrototype(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ : Base(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSC::JSGlobalObject*);
+};
+
+class JSNodeJSFSConstructor final : public JSC::InternalFunction {
+public:
+ using Base = JSC::InternalFunction;
+ static JSNodeJSFSConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSNodeJSFSPrototype* prototype);
+
+ static constexpr unsigned StructureFlags = Base::StructureFlags;
+ static constexpr bool needsDestruction = false;
+
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info());
+ }
+
+ template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSNodeJSFSConstructor, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForNodeJSFSConstructor.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForNodeJSFSConstructor = WTFMove(space); },
+ [](auto& spaces) { return spaces.m_subspaceForNodeJSFSConstructor.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForNodeJSFSConstructor = WTFMove(space); });
+ }
+
+ void initializeProperties(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype);
+
+ // Must be defined for each specialization class.
+ static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES construct(JSC::JSGlobalObject*, JSC::CallFrame*);
+
+ DECLARE_EXPORT_INFO;
+
+private:
+ JSNodeJSFSConstructor(JSC::VM& vm, JSC::Structure* structure);
+ void finishCreation(JSC::VM&, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype);
+};
+
+extern "C" void* NodeJSFSClass__construct(JSC::JSGlobalObject*, JSC::CallFrame*);
+JSC_DECLARE_CUSTOM_GETTER(jsNodeJSFSConstructor);
+extern "C" void NodeJSFSClass__finalize(void*);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__access(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__accessCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__accessSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__accessSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__appendFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__appendFileCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__appendFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__appendFileSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__chmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chmodCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__chmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chmodSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__chown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chownCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__chownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chownSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__close(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__closeCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__closeSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__closeSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__copyFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__copyFileCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__copyFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__copyFileSyncCallback);
+
+extern "C" JSC::EncodedJSValue NodeJSFSPrototype__getDirent(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);
+JSC_DECLARE_CUSTOM_GETTER(NodeJSFSPrototype__DirentGetterWrap);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__exists(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__existsCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__existsSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__existsSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fchmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchmodCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fchmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchmodSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fchown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchownCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fchownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchownSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fdatasync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fdatasyncSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fstat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fstatCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fstatSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fstatSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fsync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fsyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__fsyncSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fsyncSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__ftruncate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__ftruncateSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__futimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__futimesCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__futimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__futimesSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lchmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchmodCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lchmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchmodSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lchown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchownCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lchownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchownSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__link(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__linkCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__linkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__linkSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lstat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lstatCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lstatSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lstatSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lutimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lutimesCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__lutimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lutimesSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__mkdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdirCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__mkdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdirSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__mkdtemp(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__mkdtempSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__open(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__openCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__opendir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__opendirCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__opendirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__opendirSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__openSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__openSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__read(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readdirCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readdirSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readFileCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readFileSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readlinkCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readlinkSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readv(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readvCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__readvSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readvSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__realpath(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__realpathCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__realpathSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__realpathSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__rename(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__renameCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__renameSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__renameSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__rm(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__rmdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmdirCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__rmdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmdirSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__rmSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__stat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__statCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__statSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__statSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__symlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__symlinkCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__symlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__symlinkSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__truncate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__truncateCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__truncateSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__truncateSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__unlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__unlinkCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__unlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__unlinkSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__utimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__utimesCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__utimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__utimesSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__write(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__writeFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeFileCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__writeFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeFileSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__writeSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeSyncCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__writev(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writevCallback);
+
+extern "C" EncodedJSValue NodeJSFSPrototype__writevSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);
+JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writevSyncCallback);
+
+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSNodeJSFSPrototype, JSNodeJSFSPrototype::Base);
+
+static const HashTableValue JSNodeJSFSPrototypeTableValues[] = {
+ { "access"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__accessCallback, 3 } },
+ { "accessSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__accessSyncCallback, 2 } },
+ { "appendFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__appendFileCallback, 4 } },
+ { "appendFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__appendFileSyncCallback, 3 } },
+ { "chmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chmodCallback, 3 } },
+ { "chmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chmodSyncCallback, 2 } },
+ { "chown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chownCallback, 4 } },
+ { "chownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chownSyncCallback, 3 } },
+ { "close"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__closeCallback, 1 } },
+ { "closeSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__closeSyncCallback, 1 } },
+ { "copyFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__copyFileCallback, 4 } },
+ { "copyFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__copyFileSyncCallback, 3 } },
+ { "Dirent"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, NodeJSFSPrototype__DirentGetterWrap, 0 } },
+ { "exists"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__existsCallback, 2 } },
+ { "existsSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__existsSyncCallback, 1 } },
+ { "fchmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchmodCallback, 3 } },
+ { "fchmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchmodSyncCallback, 2 } },
+ { "fchown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchownCallback, 4 } },
+ { "fchownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchownSyncCallback, 3 } },
+ { "fdatasync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fdatasyncCallback, 2 } },
+ { "fdatasyncSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fdatasyncSyncCallback, 1 } },
+ { "fstat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fstatCallback, 1 } },
+ { "fstatSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fstatSyncCallback, 1 } },
+ { "fsync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fsyncCallback, 2 } },
+ { "fsyncSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fsyncSyncCallback, 1 } },
+ { "ftruncate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__ftruncateCallback, 1 } },
+ { "ftruncateSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__ftruncateSyncCallback, 1 } },
+ { "futimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__futimesCallback, 4 } },
+ { "futimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__futimesSyncCallback, 3 } },
+ { "lchmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchmodCallback, 3 } },
+ { "lchmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchmodSyncCallback, 2 } },
+ { "lchown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchownCallback, 4 } },
+ { "lchownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchownSyncCallback, 3 } },
+ { "link"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__linkCallback, 3 } },
+ { "linkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__linkSyncCallback, 2 } },
+ { "lstat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lstatCallback, 1 } },
+ { "lstatSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lstatSyncCallback, 1 } },
+ { "lutimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lutimesCallback, 4 } },
+ { "lutimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lutimesSyncCallback, 3 } },
+ { "mkdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdirCallback, 3 } },
+ { "mkdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdirSyncCallback, 2 } },
+ { "mkdtemp"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdtempCallback, 3 } },
+ { "mkdtempSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdtempSyncCallback, 2 } },
+ { "open"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__openCallback, 4 } },
+ { "opendir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__opendirCallback, 3 } },
+ { "opendirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__opendirSyncCallback, 2 } },
+ { "openSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__openSyncCallback, 3 } },
+ { "read"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readCallback, 6 } },
+ { "readdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readdirCallback, 3 } },
+ { "readdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readdirSyncCallback, 2 } },
+ { "readFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readFileCallback, 3 } },
+ { "readFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readFileSyncCallback, 2 } },
+ { "readlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readlinkCallback, 3 } },
+ { "readlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readlinkSyncCallback, 2 } },
+ { "readSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readSyncCallback, 5 } },
+ { "readv"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readvCallback, 4 } },
+ { "readvSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readvSyncCallback, 3 } },
+ { "realpath"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__realpathCallback, 3 } },
+ { "realpathSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__realpathSyncCallback, 2 } },
+ { "rename"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__renameCallback, 3 } },
+ { "renameSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__renameSyncCallback, 2 } },
+ { "rm"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmCallback, 3 } },
+ { "rmdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmdirCallback, 3 } },
+ { "rmdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmdirSyncCallback, 2 } },
+ { "rmSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmSyncCallback, 2 } },
+ { "stat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__statCallback, 1 } },
+ { "statSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__statSyncCallback, 1 } },
+ { "symlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__symlinkCallback, 4 } },
+ { "symlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__symlinkSyncCallback, 3 } },
+ { "truncate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__truncateCallback, 3 } },
+ { "truncateSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__truncateSyncCallback, 2 } },
+ { "unlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__unlinkCallback, 2 } },
+ { "unlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__unlinkSyncCallback, 1 } },
+ { "utimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__utimesCallback, 4 } },
+ { "utimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__utimesSyncCallback, 3 } },
+ { "write"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeCallback, 6 } },
+ { "writeFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeFileCallback, 4 } },
+ { "writeFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeFileSyncCallback, 3 } },
+ { "writeSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeSyncCallback, 5 } },
+ { "writev"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writevCallback, 4 } },
+ { "writevSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writevSyncCallback, 3 } }
+};
+
+const ClassInfo JSNodeJSFSPrototype::s_info = { "NodeJSFS"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFSPrototype) };
+
+JSC_DEFINE_CUSTOM_GETTER(jsNodeJSFSConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName))
+{
+ VM& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto* prototype = jsDynamicCast<JSNodeJSFSPrototype*>(JSValue::decode(thisValue));
+
+ if (UNLIKELY(!prototype))
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ return JSValue::encode(globalObject->JSNodeJSFSConstructor());
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__accessCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__access(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__accessSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__accessSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__appendFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__appendFile(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__appendFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__appendFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__chmod(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__chmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__chown(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__chownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__closeCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__close(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__closeSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__closeSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__copyFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__copyFile(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__copyFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__copyFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(NodeJSFSPrototype__DirentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ auto& vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ JSNodeJSFS* thisObject = jsCast<JSNodeJSFS*>(JSValue::decode(thisValue));
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+ JSC::EncodedJSValue result = NodeJSFSPrototype__getDirent(thisObject->wrapped(), globalObject);
+ RETURN_IF_EXCEPTION(throwScope, {});
+ RELEASE_AND_RETURN(throwScope, result);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__existsCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__exists(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__existsSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__existsSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fchmod(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fchmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fchown(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fchownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fdatasync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fdatasyncSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fstatCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fstat(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fstatSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fstatSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fsyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fsync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fsyncSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__fsyncSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__ftruncate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__ftruncateSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__futimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__futimes(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__futimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__futimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lchmod(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lchmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lchown(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lchownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__linkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__link(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__linkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__linkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lstatCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lstat(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lstatSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lstatSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lutimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lutimes(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lutimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__lutimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__mkdir(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__mkdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__mkdtemp(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__mkdtempSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__openCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__open(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__opendirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__opendir(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__opendirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__opendirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__openSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__openSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__read(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readdir(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readFile(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readlink(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readvCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readv(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readvSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__readvSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__realpathCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__realpath(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__realpathSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__realpathSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__renameCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__rename(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__renameSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__renameSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__rm(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__rmdir(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__rmdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__rmSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__statCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__stat(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__statSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__statSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__symlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__symlink(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__symlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__symlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__truncateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__truncate(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__truncateSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__truncateSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__unlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__unlink(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__unlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__unlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__utimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__utimes(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__utimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__utimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__write(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__writeFile(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__writeFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__writeSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writevCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__writev(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writevSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
+{
+ auto& vm = lexicalGlobalObject->vm();
+
+ JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue());
+
+ if (UNLIKELY(!thisObject)) {
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ }
+
+ JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
+
+ return NodeJSFSPrototype__writevSync(thisObject->wrapped(), lexicalGlobalObject, callFrame);
+}
+
+void JSNodeJSFSPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
+{
+ Base::finishCreation(vm);
+ reifyStaticProperties(vm, JSNodeJSFS::info(), JSNodeJSFSPrototypeTableValues, *this);
+ JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
+}
+
+void JSNodeJSFSConstructor::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype)
+{
+ Base::finishCreation(vm, 0, "NodeJSFS"_s, PropertyAdditionMode::WithoutStructureTransition);
+
+ putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+ ASSERT(inherits(info()));
+}
+
+JSNodeJSFSConstructor::JSNodeJSFSConstructor(JSC::VM& vm, JSC::Structure* structure)
+ : Base(vm, structure, construct, construct)
+{
+}
+
+JSNodeJSFSConstructor* JSNodeJSFSConstructor::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSNodeJSFSPrototype* prototype)
+{
+ JSNodeJSFSConstructor* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFSConstructor>(vm)) JSNodeJSFSConstructor(vm, structure);
+ ptr->finishCreation(vm, globalObject, prototype);
+ return ptr;
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSNodeJSFSConstructor::construct(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)
+{
+ Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
+ JSC::VM& vm = globalObject->vm();
+ JSObject* newTarget = asObject(callFrame->newTarget());
+ auto* constructor = globalObject->JSNodeJSFSConstructor();
+ Structure* structure = globalObject->JSNodeJSFSStructure();
+ if (constructor != newTarget) {
+ auto scope = DECLARE_THROW_SCOPE(vm);
+
+ auto* functionGlobalObject = reinterpret_cast<Zig::GlobalObject*>(
+ // ShadowRealm functions belong to a different global object.
+ getFunctionRealm(globalObject, newTarget));
+ RETURN_IF_EXCEPTION(scope, {});
+ structure = InternalFunction::createSubclassStructure(
+ globalObject,
+ newTarget,
+ functionGlobalObject->JSNodeJSFSStructure());
+ }
+
+ void* ptr = NodeJSFSClass__construct(globalObject, callFrame);
+
+ if (UNLIKELY(!ptr)) {
+ return JSValue::encode(JSC::jsUndefined());
+ }
+
+ JSNodeJSFS* instance = JSNodeJSFS::create(vm, globalObject, structure, ptr);
+
+ return JSValue::encode(instance);
+}
+
+void JSNodeJSFSConstructor::initializeProperties(VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype)
+{
+}
+
+const ClassInfo JSNodeJSFSConstructor::s_info = { "Function"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFSConstructor) };
+
+extern "C" EncodedJSValue NodeJSFS__getConstructor(Zig::GlobalObject* globalObject)
+{
+ return JSValue::encode(globalObject->JSNodeJSFSConstructor());
+}
+
+JSNodeJSFS::~JSNodeJSFS()
+{
+}
+void JSNodeJSFS::destroy(JSCell* cell)
+{
+ static_cast<JSNodeJSFS*>(cell)->JSNodeJSFS::~JSNodeJSFS();
+}
+
+const ClassInfo JSNodeJSFS::s_info = { "NodeJSFS"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFS) };
+
+void JSNodeJSFS::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+}
+
+JSNodeJSFS* JSNodeJSFS::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx)
+{
+ JSNodeJSFS* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFS>(vm)) JSNodeJSFS(vm, structure, ctx);
+ ptr->finishCreation(vm);
+ return ptr;
+}
+
+extern "C" void* NodeJSFS__fromJS(JSC::EncodedJSValue value)
+{
+ JSC::JSValue decodedValue = JSC::JSValue::decode(value);
+ if (!decodedValue || decodedValue.isUndefinedOrNull())
+ return nullptr;
+
+ JSNodeJSFS* object = JSC::jsDynamicCast<JSNodeJSFS*>(decodedValue);
+
+ if (!object)
+ return nullptr;
+
+ return object->wrapped();
+}
+
+extern "C" bool NodeJSFS__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr)
+{
+ JSNodeJSFS* object = JSC::jsDynamicCast<JSNodeJSFS*>(JSValue::decode(value));
+ if (!object)
+ return false;
+
+ object->m_ctx = ptr;
+ return true;
+}
+
+extern "C" const size_t NodeJSFS__ptrOffset = JSNodeJSFS::offsetOfWrapped();
+
+void JSNodeJSFS::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
+{
+ auto* thisObject = jsCast<JSNodeJSFS*>(cell);
+ if (void* wrapped = thisObject->wrapped()) {
+ // if (thisObject->scriptExecutionContext())
+ // analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
+ }
+ Base::analyzeHeap(cell, analyzer);
+}
+
+JSObject* JSNodeJSFS::createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+ return WebCore::JSNodeJSFSConstructor::create(vm, globalObject, WebCore::JSNodeJSFSConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<WebCore::JSNodeJSFSPrototype*>(prototype));
+}
+
+JSObject* JSNodeJSFS::createPrototype(VM& vm, JSDOMGlobalObject* globalObject)
+{
+ return JSNodeJSFSPrototype::create(vm, globalObject, JSNodeJSFSPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+extern "C" EncodedJSValue NodeJSFS__create(Zig::GlobalObject* globalObject, void* ptr)
+{
+ auto& vm = globalObject->vm();
+ JSC::Structure* structure = globalObject->JSNodeJSFSStructure();
+ JSNodeJSFS* instance = JSNodeJSFS::create(vm, globalObject, structure, ptr);
+
+ return JSValue::encode(instance);
+}
} // namespace WebCore
diff --git a/src/bun.js/bindings/ZigGeneratedClasses.h b/src/bun.js/bindings/ZigGeneratedClasses.h
index 700d7bab3..3f34fc978 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses.h
@@ -1182,4 +1182,110 @@ public:
void finishCreation(JSC::VM&);
};
+class JSDirent final : public JSC::JSDestructibleObject {
+public:
+ using Base = JSC::JSDestructibleObject;
+ static JSDirent* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx);
+
+ DECLARE_EXPORT_INFO;
+ template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSDirent, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForDirent.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForDirent = WTFMove(space); },
+ [](auto& spaces) { return spaces.m_subspaceForDirent.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForDirent = WTFMove(space); });
+ }
+
+ static void destroy(JSC::JSCell*);
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(static_cast<JSC::JSType>(ObjectType), StructureFlags), info());
+ }
+
+ static JSObject* createPrototype(VM& vm, JSDOMGlobalObject* globalObject);
+ static JSObject* createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype);
+
+ ~JSDirent();
+
+ void* wrapped() const { return m_ctx; }
+
+ void detach()
+ {
+ m_ctx = nullptr;
+ }
+
+ static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
+ static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSDirent, m_ctx); }
+
+ void* m_ctx { nullptr };
+
+ JSDirent(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr)
+ : Base(vm, structure)
+ {
+ m_ctx = sinkPtr;
+ }
+
+ void finishCreation(JSC::VM&);
+
+ DECLARE_VISIT_CHILDREN;
+ template<typename Visitor> void visitAdditionalChildren(Visitor&);
+ DECLARE_VISIT_OUTPUT_CONSTRAINTS;
+
+ mutable JSC::WriteBarrier<JSC::Unknown> m_name;
+};
+
+class JSNodeJSFS final : public JSC::JSDestructibleObject {
+public:
+ using Base = JSC::JSDestructibleObject;
+ static JSNodeJSFS* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx);
+
+ DECLARE_EXPORT_INFO;
+ template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return WebCore::subspaceForImpl<JSNodeJSFS, WebCore::UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForNodeJSFS.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForNodeJSFS = WTFMove(space); },
+ [](auto& spaces) { return spaces.m_subspaceForNodeJSFS.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForNodeJSFS = WTFMove(space); });
+ }
+
+ static void destroy(JSC::JSCell*);
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(static_cast<JSC::JSType>(ObjectType), StructureFlags), info());
+ }
+
+ static JSObject* createPrototype(VM& vm, JSDOMGlobalObject* globalObject);
+ static JSObject* createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype);
+
+ ~JSNodeJSFS();
+
+ void* wrapped() const { return m_ctx; }
+
+ void detach()
+ {
+ m_ctx = nullptr;
+ }
+
+ static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
+ static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSNodeJSFS, m_ctx); }
+
+ void* m_ctx { nullptr };
+
+ JSNodeJSFS(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr)
+ : Base(vm, structure)
+ {
+ m_ctx = sinkPtr;
+ }
+
+ void finishCreation(JSC::VM&);
+};
+
}
diff --git a/src/bun.js/bindings/bindings-generator.zig b/src/bun.js/bindings/bindings-generator.zig
index 893e808d4..7168585de 100644
--- a/src/bun.js/bindings/bindings-generator.zig
+++ b/src/bun.js/bindings/bindings-generator.zig
@@ -22,10 +22,11 @@ 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 paths = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers.h" };
- const paths2 = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers-cpp.h" };
- const paths4 = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "ZigGeneratedCode.cpp" };
+ const paths = [_][]const u8{ src_path, "headers.h" };
+ const paths2 = [_][]const u8{ src_path, "headers-cpp.h" };
+ const paths4 = [_][]const u8{ src_path, "ZigGeneratedCode.cpp" };
const cpp = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths2), .{});
const file = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths), .{});
@@ -44,7 +45,7 @@ pub fn main() anyerror!void {
comptime var i: usize = 0;
inline while (i < Classes.len) : (i += 1) {
const Class = Classes[i];
- const paths = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, Class.name ++ ".generated.h" };
+ const paths = [_][]const u8{ src_path, Class.name ++ ".generated.h" };
var headerFilePath = try std.fs.path.join(
allocator,
&paths,
diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig
index 1ce48da90..2226d0fb5 100644
--- a/src/bun.js/bindings/bindings.zig
+++ b/src/bun.js/bindings/bindings.zig
@@ -32,7 +32,7 @@ pub const JSObject = extern struct {
});
}
- const InitializeCallback = fn (ctx: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void;
+ const InitializeCallback = *const fn (ctx: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void;
pub fn create(global_object: *JSGlobalObject, length: usize, ctx: *anyopaque, initializer: InitializeCallback) JSValue {
return cppFn("create", .{
global_object,
@@ -45,7 +45,7 @@ pub const JSObject = extern struct {
pub fn Initializer(comptime Ctx: type, comptime func: fn (*Ctx, obj: *JSObject, global: *JSGlobalObject) void) type {
return struct {
pub fn call(this: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void {
- @call(.{ .modifier = .always_inline }, func, .{ @ptrCast(*Ctx, @alignCast(@alignOf(*Ctx), this.?)), obj.?, global.? });
+ @call(.always_inline, func, .{ @ptrCast(*Ctx, @alignCast(@alignOf(*Ctx), this.?)), obj.?, global.? });
}
};
}
@@ -111,10 +111,10 @@ pub const ZigString = extern struct {
pub fn substring(this: ZigString, offset: usize) ZigString {
if (this.is16Bit()) {
- return ZigString.from16Slice(this.utf16SliceAligned()[@minimum(this.len, offset)..]);
+ return ZigString.from16Slice(this.utf16SliceAligned()[@min(this.len, offset)..]);
}
- var out = ZigString.init(this.slice()[@minimum(this.len, offset)..]);
+ var out = ZigString.init(this.slice()[@min(this.len, offset)..]);
if (this.isUTF8()) {
out.markUTF8();
}
@@ -184,7 +184,7 @@ pub const ZigString = extern struct {
}
pub fn trunc(this: ZigString, len: usize) ZigString {
- return .{ .ptr = this.ptr, .len = @minimum(len, this.len) };
+ return .{ .ptr = this.ptr, .len = @min(len, this.len) };
}
pub fn eqlComptime(this: ZigString, comptime other: []const u8) bool {
@@ -463,7 +463,7 @@ pub const ZigString = extern struct {
}
pub fn slice(this: *const ZigString) []const u8 {
- return untagged(this.ptr)[0..@minimum(this.len, std.math.maxInt(u32))];
+ return untagged(this.ptr)[0..@min(this.len, std.math.maxInt(u32))];
}
pub fn dupe(this: ZigString, allocator: std.mem.Allocator) ![]const u8 {
@@ -566,7 +566,7 @@ pub const ZigString = extern struct {
inline fn assertGlobal(this: *const ZigString) void {
if (comptime bun.Environment.allow_assert) {
- std.debug.assert(bun.Mimalloc.mi_is_in_heap_region(untagged(this.ptr)) or bun.Mimalloc.mi_check_owned(untagged(this.ptr)));
+ std.debug.assert(this.len == 0 or bun.Mimalloc.mi_is_in_heap_region(untagged(this.ptr)) or bun.Mimalloc.mi_check_owned(untagged(this.ptr)));
}
}
@@ -583,7 +583,7 @@ pub const ZigString = extern struct {
pub fn toExternalValueWithCallback(
this: *const ZigString,
global: *JSGlobalObject,
- callback: fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void,
+ callback: *const fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void,
) JSValue {
return shim.cppFn("toExternalValueWithCallback", .{ this, global, callback });
}
@@ -592,7 +592,7 @@ pub const ZigString = extern struct {
this: *const ZigString,
global: *JSGlobalObject,
ctx: ?*anyopaque,
- callback: fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void,
+ callback: *const fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void,
) JSValue {
return shim.cppFn("external", .{ this, global, ctx, callback });
}
@@ -641,7 +641,7 @@ pub const DOMURL = opaque {
}
pub fn cast(value: JSValue) ?*DOMURL {
- return cast_(value, JSC.VirtualMachine.vm.global.vm());
+ return cast_(value, JSC.VirtualMachine.get().global.vm());
}
pub fn href_(this: *DOMURL, out: *ZigString) void {
@@ -1018,7 +1018,7 @@ pub const FetchHeaders = opaque {
}
pub fn cast(value: JSValue) ?*FetchHeaders {
- return cast_(value, JSC.VirtualMachine.vm.global.vm());
+ return cast_(value, JSC.VirtualMachine.get().global.vm());
}
pub fn toJS(this: *FetchHeaders, globalThis: *JSGlobalObject) JSValue {
@@ -1219,10 +1219,10 @@ pub const JSString = extern struct {
});
}
- pub const JStringIteratorAppend8Callback = fn (*Iterator, [*]const u8, u32) callconv(.C) void;
- pub const JStringIteratorAppend16Callback = fn (*Iterator, [*]const u16, u32) callconv(.C) void;
- pub const JStringIteratorWrite8Callback = fn (*Iterator, [*]const u8, u32, u32) callconv(.C) void;
- pub const JStringIteratorWrite16Callback = fn (*Iterator, [*]const u16, u32, u32) callconv(.C) void;
+ pub const JStringIteratorAppend8Callback = *const fn (*Iterator, [*]const u8, u32) callconv(.C) void;
+ pub const JStringIteratorAppend16Callback = *const fn (*Iterator, [*]const u16, u32) callconv(.C) void;
+ pub const JStringIteratorWrite8Callback = *const fn (*Iterator, [*]const u8, u32, u32) callconv(.C) void;
+ pub const JStringIteratorWrite16Callback = *const fn (*Iterator, [*]const u16, u32, u32) callconv(.C) void;
pub const Iterator = extern struct {
data: ?*anyopaque,
stop: u8,
@@ -1247,41 +1247,41 @@ pub fn NewGlobalObject(comptime Type: type) type {
const moduleNotImpl = "Module fetch not implemented";
pub fn import(global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) ErrorableZigString {
if (comptime @hasDecl(Type, "import")) {
- return @call(.{ .modifier = .always_inline }, Type.import, .{ global, specifier.*, source.* });
+ return @call(.always_inline, Type.import, .{ global, specifier.*, source.* });
}
return ErrorableZigString.err(error.ImportFailed, ZigString.init(importNotImpl).toErrorInstance(global).asVoid());
}
pub fn resolve(res: *ErrorableZigString, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void {
if (comptime @hasDecl(Type, "resolve")) {
- @call(.{ .modifier = .always_inline }, Type.resolve, .{ res, global, specifier.*, source.* });
+ @call(.always_inline, Type.resolve, .{ res, global, specifier.*, source.* });
return;
}
res.* = ErrorableZigString.err(error.ResolveFailed, ZigString.init(resolveNotImpl).toErrorInstance(global).asVoid());
}
pub fn fetch(ret: *ErrorableResolvedSource, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void {
if (comptime @hasDecl(Type, "fetch")) {
- @call(.{ .modifier = .always_inline }, Type.fetch, .{ ret, global, specifier.*, source.* });
+ @call(.always_inline, Type.fetch, .{ ret, global, specifier.*, source.* });
return;
}
ret.* = ErrorableResolvedSource.err(error.FetchFailed, ZigString.init(moduleNotImpl).toErrorInstance(global).asVoid());
}
pub fn promiseRejectionTracker(global: *JSGlobalObject, promise: *JSPromise, rejection: JSPromiseRejectionOperation) callconv(.C) JSValue {
if (comptime @hasDecl(Type, "promiseRejectionTracker")) {
- return @call(.{ .modifier = .always_inline }, Type.promiseRejectionTracker, .{ global, promise, rejection });
+ return @call(.always_inline, Type.promiseRejectionTracker, .{ global, promise, rejection });
}
return JSValue.jsUndefined();
}
pub fn reportUncaughtException(global: *JSGlobalObject, exception: *Exception) callconv(.C) JSValue {
if (comptime @hasDecl(Type, "reportUncaughtException")) {
- return @call(.{ .modifier = .always_inline }, Type.reportUncaughtException, .{ global, exception });
+ return @call(.always_inline, Type.reportUncaughtException, .{ global, exception });
}
return JSValue.jsUndefined();
}
pub fn onCrash() callconv(.C) void {
if (comptime @hasDecl(Type, "onCrash")) {
- return @call(.{ .modifier = .always_inline }, Type.onCrash, .{});
+ return @call(.always_inline, Type.onCrash, .{});
}
Output.flush();
@@ -1537,7 +1537,7 @@ pub const JSInternalPromise = extern struct {
pub fn rejectAsHandledException(this: *JSInternalPromise, globalThis: *JSGlobalObject, value: *Exception) void {
cppFn("rejectAsHandledException", .{ this, globalThis, value });
}
- // pub const PromiseCallbackPrimitive = fn (
+ // pub const PromiseCallbackPrimitive = *const fn (
// ctx: ?*anyopaque,
// globalThis: *JSGlobalObject,
// arguments: [*]const JSValue,
@@ -1960,7 +1960,7 @@ pub const JSGlobalObject = extern struct {
// you most likely need to run
// make clean-jsc-bindings
// make bindings -j10
- const assertion = this.bunVM_() == @ptrCast(*anyopaque, JSC.VirtualMachine.vm);
+ const assertion = this.bunVM_() == @ptrCast(*anyopaque, JSC.VirtualMachine.get());
if (!assertion) @breakpoint();
std.debug.assert(assertion);
}
@@ -1969,7 +1969,7 @@ pub const JSGlobalObject = extern struct {
/// We can't do the threadlocal check when queued from another thread
pub fn bunVMConcurrently(this: *JSGlobalObject) *JSC.VirtualMachine {
- return @ptrCast(*JSC.VirtualMachine, @alignCast(std.meta.alignment(JSC.VirtualMachine), this.bunVM_()));
+ return @ptrCast(*JSC.VirtualMachine, @alignCast(@alignOf(JSC.VirtualMachine), this.bunVM_()));
}
pub fn handleRejectedPromises(this: *JSGlobalObject) void {
@@ -2024,7 +2024,7 @@ pub const JSGlobalObject = extern struct {
};
};
-pub const JSNativeFn = fn (*JSGlobalObject, *CallFrame) callconv(.C) JSValue;
+pub const JSNativeFn = *const fn (*JSGlobalObject, *CallFrame) callconv(.C) JSValue;
pub const JSArrayIterator = struct {
i: u32 = 0,
@@ -2053,10 +2053,10 @@ pub const JSArrayIterator = struct {
pub const JSValueReprInt = i64;
pub const JSValue = enum(JSValueReprInt) {
zero = 0,
- @"undefined" = @bitCast(JSValueReprInt, @as(i64, 0xa)),
- @"null" = @bitCast(JSValueReprInt, @as(i64, 0x2)),
- @"true" = @bitCast(JSValueReprInt, @as(i64, 0x4)),
- @"false" = @bitCast(JSValueReprInt, @as(i64, 0x6)),
+ undefined = @bitCast(JSValueReprInt, @as(i64, 0xa)),
+ null = @bitCast(JSValueReprInt, @as(i64, 0x2)),
+ true = @bitCast(JSValueReprInt, @as(i64, 0x4)),
+ false = @bitCast(JSValueReprInt, @as(i64, 0x6)),
_,
pub const Type = JSValueReprInt;
@@ -2357,10 +2357,10 @@ pub const JSValue = enum(JSValueReprInt) {
return cppFn("coerceToInt32", .{ this, globalThis });
}
- const PropertyIteratorFn = fn (
- globalObject_: [*c]JSGlobalObject,
+ const PropertyIteratorFn = *const fn (
+ globalObject_: *JSGlobalObject,
ctx_ptr: ?*anyopaque,
- key: *ZigString,
+ key: [*c]ZigString,
value: JSValue,
is_symbol: bool,
) callconv(.C) void;
@@ -2404,7 +2404,7 @@ pub const JSValue = enum(JSValueReprInt) {
?*JSInternalPromise => asInternalPromise(this),
?*JSPromise => asPromise(this),
- u52 => @truncate(u52, @intCast(u64, @maximum(this.toInt64(), 0))),
+ u52 => @truncate(u52, @intCast(u64, @max(this.toInt64(), 0))),
u64 => toUInt64NoTruncate(this),
u8 => @truncate(u8, toU32(this)),
i16 => @truncate(i16, toInt32(this)),
@@ -2512,12 +2512,12 @@ pub const JSValue = enum(JSValueReprInt) {
pub fn protect(this: JSValue) void {
if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return;
- JSC.C.JSValueProtect(JSC.VirtualMachine.vm.global, this.asObjectRef());
+ JSC.C.JSValueProtect(JSC.VirtualMachine.get().global, this.asObjectRef());
}
pub fn unprotect(this: JSValue) void {
if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return;
- JSC.C.JSValueUnprotect(JSC.VirtualMachine.vm.global, this.asObjectRef());
+ JSC.C.JSValueUnprotect(JSC.VirtualMachine.get().global, this.asObjectRef());
}
pub fn JSONValueFromString(
@@ -2615,10 +2615,10 @@ pub const JSValue = enum(JSValueReprInt) {
}
pub inline fn jsNull() JSValue {
- return JSValue.@"null";
+ return JSValue.null;
}
pub inline fn jsUndefined() JSValue {
- return JSValue.@"undefined";
+ return JSValue.undefined;
}
pub inline fn jsBoolean(i: bool) JSValue {
const out = cppFn("jsBoolean", .{i});
@@ -3171,7 +3171,7 @@ pub const JSValue = enum(JSValueReprInt) {
}
pub inline fn toU32(this: JSValue) u32 {
- return @intCast(u32, @maximum(this.toInt32(), 0));
+ return @intCast(u32, @max(this.toInt32(), 0));
}
pub fn getLengthOfArray(this: JSValue, globalThis: *JSGlobalObject) u64 {
@@ -3189,7 +3189,7 @@ pub const JSValue = enum(JSValueReprInt) {
this: JSValue,
globalObject: *JSGlobalObject,
ctx: ?*anyopaque,
- callback: fn (vm: [*c]VM, globalObject: [*c]JSGlobalObject, ctx: ?*anyopaque, nextValue: JSValue) callconv(.C) void,
+ callback: *const fn (vm: *VM, globalObject: *JSGlobalObject, ctx: ?*anyopaque, nextValue: JSValue) callconv(.C) void,
) void {
return cppFn("forEach", .{ this, globalObject, ctx, callback });
}
@@ -3339,11 +3339,11 @@ pub const VM = extern struct {
return cppFn("isJITEnabled", .{});
}
- pub fn holdAPILock(this: *VM, ctx: ?*anyopaque, callback: fn (ctx: ?*anyopaque) callconv(.C) void) void {
+ pub fn holdAPILock(this: *VM, ctx: ?*anyopaque, callback: *const fn (ctx: ?*anyopaque) callconv(.C) void) void {
cppFn("holdAPILock", .{ this, ctx, callback });
}
- pub fn deferGC(this: *VM, ctx: ?*anyopaque, callback: fn (ctx: ?*anyopaque) callconv(.C) void) void {
+ pub fn deferGC(this: *VM, ctx: ?*anyopaque, callback: *const fn (ctx: ?*anyopaque) callconv(.C) void) void {
cppFn("deferGC", .{ this, ctx, callback });
}
@@ -3354,9 +3354,9 @@ pub const VM = extern struct {
return cppFn("deleteAllCode", .{ vm, global_object });
}
- extern fn Bun__setOnEachMicrotaskTick(vm: *VM, ptr: ?*anyopaque, callback: ?(fn (*anyopaque) callconv(.C) void)) void;
+ extern fn Bun__setOnEachMicrotaskTick(vm: *VM, ptr: ?*anyopaque, callback: ?*const fn (*anyopaque) callconv(.C) void) void;
- pub fn onEachMicrotask(vm: *VM, comptime Ptr: type, ptr: *Ptr, comptime callback: fn (*Ptr) void) void {
+ pub fn onEachMicrotask(vm: *VM, comptime Ptr: type, ptr: *Ptr, comptime callback: *const fn (*Ptr) void) void {
if (comptime is_bindgen) {
return;
}
@@ -3382,7 +3382,7 @@ pub const VM = extern struct {
pub fn whenIdle(
vm: *VM,
- callback: fn (...) callconv(.C) void,
+ callback: *const fn (...) callconv(.C) void,
) void {
return cppFn("whenIdle", .{ vm, callback });
}
@@ -3569,47 +3569,37 @@ pub const CallFrame = opaque {
return (@ptrCast([*]const JSC.JSValue, @alignCast(alignment, self)) + Sizes.Bun_CallFrame__callee)[0];
}
- pub fn arguments(self: *const CallFrame, comptime max: usize) struct { ptr: [max]JSC.JSValue, len: usize } {
- var buf: [max]JSC.JSValue = std.mem.zeroes([max]JSC.JSValue);
+ fn Arguments(comptime max: usize) type {
+ return struct {
+ ptr: [max]JSC.JSValue,
+ len: usize,
+ pub inline fn init(comptime i: usize, ptr: [*]const JSC.JSValue) @This() {
+ var args: [max]JSC.JSValue = std.mem.zeroes([max]JSC.JSValue);
+ args[0..comptime i].* = ptr[0..i].*;
+
+ return @This(){
+ .ptr = args,
+ .len = i,
+ };
+ }
+ };
+ }
+
+ pub fn arguments(self: *const CallFrame, comptime max: usize) Arguments(max) {
const len = self.argumentsCount();
var ptr = self.argumentsPtr();
- switch (@minimum(len, max)) {
- 0 => {
- return .{ .ptr = buf, .len = 0 };
- },
- 1 => {
- buf[0..1].* = ptr[0..1].*;
- return .{ .ptr = buf, .len = 1 };
- },
- 2 => {
- buf[0..2].* = ptr[0..2].*;
- return .{ .ptr = buf, .len = 2 };
- },
- 3 => {
- buf[0..3].* = ptr[0..3].*;
- return .{ .ptr = buf, .len = 3 };
- },
- 4 => {
- buf[0..4].* = ptr[0..4].*;
- return .{ .ptr = buf, .len = 4 };
- },
- 5 => {
- buf[0..5].* = ptr[0..5].*;
- return .{ .ptr = buf, .len = 5 };
- },
- 6 => {
- buf[0..6].* = ptr[0..6].*;
- return .{ .ptr = buf, .len = 6 };
- },
- 7 => {
- buf[0..7].* = ptr[0..7].*;
- return .{ .ptr = buf, .len = 7 };
- },
- else => {
- buf[0..8].* = ptr[0..8].*;
- return .{ .ptr = buf, .len = 8 };
- },
- }
+ return switch (@min(len, max)) {
+ 0 => .{ .ptr = undefined, .len = 0 },
+ 1 => Arguments(max).init(1, ptr),
+ 2 => Arguments(max).init(@min(2, max), ptr),
+ 3 => Arguments(max).init(@min(3, max), ptr),
+ 4 => Arguments(max).init(@min(4, max), ptr),
+ 5 => Arguments(max).init(@min(5, max), ptr),
+ 6 => Arguments(max).init(@min(6, max), ptr),
+ 7 => Arguments(max).init(@min(7, max), ptr),
+ 8 => Arguments(max).init(@min(8, max), ptr),
+ else => unreachable,
+ };
}
pub fn argument(self: *const CallFrame, comptime i: comptime_int) JSC.JSValue {
@@ -3659,7 +3649,7 @@ pub const EncodedJSValue = extern union {
asDouble: f64,
};
-const DeinitFunction = fn (ctx: *anyopaque, buffer: [*]u8, len: usize) callconv(.C) void;
+const DeinitFunction = *const fn (ctx: *anyopaque, buffer: [*]u8, len: usize) callconv(.C) void;
pub const JSArray = struct {
pub fn from(globalThis: *JSGlobalObject, arguments: []const JSC.JSValue) JSValue {
@@ -3701,15 +3691,25 @@ const private = struct {
pub extern fn Bun__FFIFunction_setDataPtr(JSValue, ?*anyopaque) void;
};
-pub fn NewFunctionPtr(globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, functionPointer: anytype, strong: bool) *anyopaque {
+pub fn NewFunctionPtr(globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, comptime functionPointer: anytype, strong: bool) *anyopaque {
JSC.markBinding(@src());
- return private.Bun__CreateFFIFunction(globalObject, symbolName, argCount, @ptrCast(*const anyopaque, functionPointer), strong);
+ return private.Bun__CreateFFIFunction(globalObject, symbolName, argCount, @ptrCast(*const anyopaque, &functionPointer), strong);
}
pub fn NewFunction(
globalObject: *JSGlobalObject,
symbolName: ?*const ZigString,
argCount: u32,
+ comptime functionPointer: anytype,
+ strong: bool,
+) JSValue {
+ return NewRuntimeFunction(globalObject, symbolName, argCount, &functionPointer, strong);
+}
+
+pub fn NewRuntimeFunction(
+ globalObject: *JSGlobalObject,
+ symbolName: ?*const ZigString,
+ argCount: u32,
functionPointer: anytype,
strong: bool,
) JSValue {
@@ -3731,7 +3731,7 @@ pub fn NewFunctionWithData(
globalObject: *JSGlobalObject,
symbolName: ?*const ZigString,
argCount: u32,
- functionPointer: anytype,
+ comptime functionPointer: anytype,
strong: bool,
data: *anyopaque,
) JSValue {
@@ -3740,7 +3740,7 @@ pub fn NewFunctionWithData(
globalObject,
symbolName,
argCount,
- @ptrCast(*const anyopaque, functionPointer),
+ @ptrCast(*const anyopaque, &functionPointer),
strong,
data,
);
@@ -3931,21 +3931,21 @@ pub fn JSPropertyIterator(comptime options: JSPropertyIteratorOptions) type {
// DOMCall Fields
pub const __DOMCall_ptr = @import("../api/bun.zig").FFI.Class.functionDefinitions.ptr;
-pub const __DOMCall__reader_u8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u8";
-pub const __DOMCall__reader_u16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u16";
-pub const __DOMCall__reader_u32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u32";
-pub const __DOMCall__reader_ptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"ptr";
-pub const __DOMCall__reader_i8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i8";
-pub const __DOMCall__reader_i16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i16";
-pub const __DOMCall__reader_i32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i32";
-pub const __DOMCall__reader_f32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"f32";
-pub const __DOMCall__reader_f64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"f64";
-pub const __DOMCall__reader_i64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i64";
-pub const __DOMCall__reader_u64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u64";
-pub const __DOMCall__reader_intptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"intptr";
-pub const __Crypto_getRandomValues = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"getRandomValues";
-pub const __Crypto_randomUUID = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"randomUUID";
-pub const __Crypto_timingSafeEqual = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"timingSafeEqual";
+pub const __DOMCall__reader_u8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u8;
+pub const __DOMCall__reader_u16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u16;
+pub const __DOMCall__reader_u32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u32;
+pub const __DOMCall__reader_ptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.ptr;
+pub const __DOMCall__reader_i8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i8;
+pub const __DOMCall__reader_i16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i16;
+pub const __DOMCall__reader_i32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i32;
+pub const __DOMCall__reader_f32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.f32;
+pub const __DOMCall__reader_f64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.f64;
+pub const __DOMCall__reader_i64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i64;
+pub const __DOMCall__reader_u64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u64;
+pub const __DOMCall__reader_intptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.intptr;
+pub const __Crypto_getRandomValues = @import("../webcore.zig").Crypto.Class.functionDefinitions.getRandomValues;
+pub const __Crypto_randomUUID = @import("../webcore.zig").Crypto.Class.functionDefinitions.randomUUID;
+pub const __Crypto_timingSafeEqual = @import("../webcore.zig").Crypto.Class.functionDefinitions.timingSafeEqual;
pub const DOMCalls = .{
@import("../api/bun.zig").FFI,
@import("../api/bun.zig").FFI.Reader,
diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp
new file mode 100644
index 000000000..8ed868c77
--- /dev/null
+++ b/src/bun.js/bindings/c-bindings.cpp
@@ -0,0 +1,13 @@
+// when we don't want to use @cInclude, we can just stick wrapper functions here
+#include <sys/resource.h>
+#include <cstdint>
+
+extern "C" int32_t get_process_priority(uint32_t pid)
+{
+ return getpriority(PRIO_PROCESS, pid);
+}
+
+extern "C" int32_t set_process_priority(uint32_t pid, int32_t priority)
+{
+ return setpriority(PRIO_PROCESS, pid, priority);
+} \ No newline at end of file
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig
index 2e187e302..b2460cc0d 100644
--- a/src/bun.js/bindings/exports.zig
+++ b/src/bun.js/bindings/exports.zig
@@ -58,51 +58,51 @@ pub const ZigGlobalObject = extern struct {
unreachable;
}
- return @call(.{ .modifier = .always_inline }, Interface.import, .{ global, specifier, source });
+ return @call(.always_inline, Interface.import, .{ global, specifier, source });
}
pub fn resolve(res: *ErrorableZigString, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void {
if (comptime is_bindgen) {
unreachable;
}
- @call(.{ .modifier = .always_inline }, Interface.resolve, .{ res, global, specifier, source });
+ @call(.always_inline, Interface.resolve, .{ res, global, specifier, source });
}
pub fn fetch(ret: *ErrorableResolvedSource, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void {
if (comptime is_bindgen) {
unreachable;
}
- @call(.{ .modifier = .always_inline }, Interface.fetch, .{ ret, global, specifier, source });
+ @call(.always_inline, Interface.fetch, .{ ret, global, specifier, source });
}
pub fn promiseRejectionTracker(global: *JSGlobalObject, promise: *JSPromise, rejection: JSPromiseRejectionOperation) callconv(.C) JSValue {
if (comptime is_bindgen) {
unreachable;
}
- return @call(.{ .modifier = .always_inline }, Interface.promiseRejectionTracker, .{ global, promise, rejection });
+ return @call(.always_inline, Interface.promiseRejectionTracker, .{ global, promise, rejection });
}
pub fn reportUncaughtException(global: *JSGlobalObject, exception: *Exception) callconv(.C) JSValue {
if (comptime is_bindgen) {
unreachable;
}
- return @call(.{ .modifier = .always_inline }, Interface.reportUncaughtException, .{ global, exception });
+ return @call(.always_inline, Interface.reportUncaughtException, .{ global, exception });
}
pub fn onCrash() callconv(.C) void {
if (comptime is_bindgen) {
unreachable;
}
- return @call(.{ .modifier = .always_inline }, Interface.onCrash, .{});
+ return @call(.always_inline, Interface.onCrash, .{});
}
pub const Export = shim.exportFunctions(
.{
- .@"import" = import,
- .@"resolve" = resolve,
- .@"fetch" = fetch,
+ .import = import,
+ .resolve = resolve,
+ .fetch = fetch,
// .@"eval" = eval,
- .@"promiseRejectionTracker" = promiseRejectionTracker,
- .@"reportUncaughtException" = reportUncaughtException,
- .@"onCrash" = onCrash,
+ .promiseRejectionTracker = promiseRejectionTracker,
+ .reportUncaughtException = reportUncaughtException,
+ .onCrash = onCrash,
},
);
@@ -146,7 +146,7 @@ pub const ZigErrorType = extern struct {
}
pub const Export = shim.exportFunctions(.{
- .@"isPrivateData" = isPrivateData,
+ .isPrivateData = isPrivateData,
});
comptime {
@@ -399,14 +399,14 @@ pub const Process = extern struct {
pub const getExecPath = JSC.Node.Process.getExecPath;
pub const Export = shim.exportFunctions(.{
- .@"getTitle" = getTitle,
- .@"setTitle" = setTitle,
- .@"getArgv" = getArgv,
- .@"getCwd" = getCwd,
- .@"setCwd" = setCwd,
- .@"exit" = exit,
- .@"getArgv0" = getArgv0,
- .@"getExecPath" = getExecPath,
+ .getTitle = getTitle,
+ .setTitle = setTitle,
+ .getArgv = getArgv,
+ .getCwd = getCwd,
+ .setCwd = setCwd,
+ .exit = exit,
+ .getArgv0 = getArgv0,
+ .getExecPath = getExecPath,
});
comptime {
@@ -992,7 +992,7 @@ pub const ZigConsoleClient = struct {
var exception = holder.zigException();
var err = ZigString.init("trace output").toErrorInstance(global);
err.toZigException(global, exception);
- JS.VirtualMachine.vm.remapZigException(exception, err, null);
+ JS.VirtualMachine.get().remapZigException(exception, err, null);
if (Output.enable_ansi_colors_stderr)
JS.VirtualMachine.printStackTrace(
@@ -1498,7 +1498,7 @@ pub const ZigConsoleClient = struct {
else
writer.writeAll(end);
any_non_ascii = false;
- slice = slice[@minimum(slice.len, i + 1)..];
+ slice = slice[@min(slice.len, i + 1)..];
i = 0;
len = @truncate(u32, slice.len);
const next_value = this.remaining_values[0];
@@ -1589,11 +1589,11 @@ pub const ZigConsoleClient = struct {
comptime Writer: type,
writer: Writer,
) !void {
- const indent = @minimum(this.indent, 8);
+ const indent = @min(this.indent, 8);
var buf = [_]u8{' '} ** 32;
var total_remain: usize = indent;
while (total_remain > 0) {
- const written = @minimum(16, total_remain);
+ const written = @min(16, total_remain);
try writer.writeAll(buf[0 .. written * 2]);
total_remain -|= written;
}
@@ -1698,16 +1698,16 @@ pub const ZigConsoleClient = struct {
}
pub fn forEach(
- globalObject_: [*c]JSGlobalObject,
+ globalThis: *JSGlobalObject,
ctx_ptr: ?*anyopaque,
- key: *ZigString,
+ key_: [*c]ZigString,
value: JSValue,
is_symbol: bool,
) callconv(.C) void {
+ const key = key_.?[0];
if (key.eqlComptime("constructor")) return;
if (key.eqlComptime("call")) return;
- var globalThis = globalObject_.?;
var ctx: *@This() = bun.cast(*@This(), ctx_ptr orelse return);
var this = ctx.formatter;
var writer_ = ctx.writer;
@@ -1790,7 +1790,7 @@ pub const ZigConsoleClient = struct {
writer.print(
comptime Output.prettyFmt("<r><d>[<r><blue>Symbol({any})<r><d>]:<r> ", enable_ansi_colors),
.{
- key.*,
+ key,
},
);
}
@@ -1969,7 +1969,7 @@ pub const ZigConsoleClient = struct {
}
},
.Error => {
- JS.VirtualMachine.vm.printErrorlikeObject(
+ JS.VirtualMachine.get().printErrorlikeObject(
value,
null,
null,
@@ -2660,7 +2660,7 @@ pub const ZigConsoleClient = struct {
writer.print(comptime Output.prettyFmt(fmt_, enable_ansi_colors), .{slice[0]});
var leftover = slice[1..];
const max = 512;
- leftover = leftover[0..@minimum(leftover.len, max)];
+ leftover = leftover[0..@min(leftover.len, max)];
for (leftover) |el| {
this.printComma(@TypeOf(&writer.ctx), &writer.ctx, enable_ansi_colors) catch return;
writer.writeAll(" ");
@@ -2906,19 +2906,19 @@ pub const ZigConsoleClient = struct {
) callconv(.C) void {}
pub const Export = shim.exportFunctions(.{
- .@"messageWithTypeAndLevel" = messageWithTypeAndLevel,
- .@"count" = count,
- .@"countReset" = countReset,
- .@"time" = time,
- .@"timeLog" = timeLog,
- .@"timeEnd" = timeEnd,
- .@"profile" = profile,
- .@"profileEnd" = profileEnd,
- .@"takeHeapSnapshot" = takeHeapSnapshot,
- .@"timeStamp" = timeStamp,
- .@"record" = record,
- .@"recordEnd" = recordEnd,
- .@"screenshot" = screenshot,
+ .messageWithTypeAndLevel = messageWithTypeAndLevel,
+ .count = count,
+ .countReset = countReset,
+ .time = time,
+ .timeLog = timeLog,
+ .timeEnd = timeEnd,
+ .profile = profile,
+ .profileEnd = profileEnd,
+ .takeHeapSnapshot = takeHeapSnapshot,
+ .timeStamp = timeStamp,
+ .record = record,
+ .recordEnd = recordEnd,
+ .screenshot = screenshot,
});
comptime {
diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig
index 0099d2c9f..e38870229 100644
--- a/src/bun.js/bindings/generated_classes.zig
+++ b/src/bun.js/bindings/generated_classes.zig
@@ -108,9 +108,9 @@ pub const JSTCPSocket = struct {
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");
+ @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");
+ @compileLog("Expected TCPSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.flush)));
if (@TypeOf(TCPSocket.getListener) != GetterType)
@compileLog("Expected TCPSocket.getListener to be a getter");
@@ -121,20 +121,20 @@ pub const JSTCPSocket = struct {
@compileLog("Expected TCPSocket.getReadyState to be a getter");
if (@TypeOf(TCPSocket.ref) != CallbackType)
- @compileLog("Expected TCPSocket.ref to be a callback");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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" });
@@ -256,9 +256,9 @@ pub const JSTLSSocket = struct {
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");
+ @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");
+ @compileLog("Expected TLSSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.flush)));
if (@TypeOf(TLSSocket.getListener) != GetterType)
@compileLog("Expected TLSSocket.getListener to be a getter");
@@ -269,20 +269,20 @@ pub const JSTLSSocket = struct {
@compileLog("Expected TLSSocket.getReadyState to be a getter");
if (@TypeOf(TLSSocket.ref) != CallbackType)
- @compileLog("Expected TLSSocket.ref to be a callback");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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" });
@@ -410,16 +410,16 @@ pub const JSListener = struct {
@compileLog("Expected Listener.getPort to be a getter");
if (@TypeOf(Listener.ref) != CallbackType)
- @compileLog("Expected Listener.ref to be a callback");
+ @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");
+ @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");
+ @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");
+ @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" });
@@ -558,7 +558,7 @@ pub const JSSubprocess = struct {
@compileLog("Expected Subprocess.getExited to be a getter");
if (@TypeOf(Subprocess.kill) != CallbackType)
- @compileLog("Expected Subprocess.kill to be a callback");
+ @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");
@@ -569,7 +569,7 @@ pub const JSSubprocess = struct {
@compileLog("Expected Subprocess.getStdout to be a getter");
if (@TypeOf(Subprocess.doRef) != CallbackType)
- @compileLog("Expected Subprocess.doRef to be a callback");
+ @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");
@@ -583,7 +583,7 @@ pub const JSSubprocess = struct {
@compileLog("Expected Subprocess.getStdout to be a getter");
if (@TypeOf(Subprocess.doUnref) != CallbackType)
- @compileLog("Expected Subprocess.doUnref to be a callback");
+ @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");
@@ -670,9 +670,9 @@ pub const JSSHA1 = struct {
@compileLog("Expected SHA1.getByteLength to be a getter");
if (@TypeOf(SHA1.digest) != CallbackType)
- @compileLog("Expected SHA1.digest to be a callback");
+ @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");
+ @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");
@@ -755,9 +755,9 @@ pub const JSMD5 = struct {
@compileLog("Expected MD5.getByteLength to be a getter");
if (@TypeOf(MD5.digest) != CallbackType)
- @compileLog("Expected MD5.digest to be a callback");
+ @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");
+ @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");
@@ -840,9 +840,9 @@ pub const JSMD4 = struct {
@compileLog("Expected MD4.getByteLength to be a getter");
if (@TypeOf(MD4.digest) != CallbackType)
- @compileLog("Expected MD4.digest to be a callback");
+ @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");
+ @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");
@@ -925,9 +925,9 @@ pub const JSSHA224 = struct {
@compileLog("Expected SHA224.getByteLength to be a getter");
if (@TypeOf(SHA224.digest) != CallbackType)
- @compileLog("Expected SHA224.digest to be a callback");
+ @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");
+ @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");
@@ -1010,9 +1010,9 @@ pub const JSSHA512 = struct {
@compileLog("Expected SHA512.getByteLength to be a getter");
if (@TypeOf(SHA512.digest) != CallbackType)
- @compileLog("Expected SHA512.digest to be a callback");
+ @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");
+ @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");
@@ -1095,9 +1095,9 @@ pub const JSSHA384 = struct {
@compileLog("Expected SHA384.getByteLength to be a getter");
if (@TypeOf(SHA384.digest) != CallbackType)
- @compileLog("Expected SHA384.digest to be a callback");
+ @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");
+ @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");
@@ -1180,9 +1180,9 @@ pub const JSSHA256 = struct {
@compileLog("Expected SHA256.getByteLength to be a getter");
if (@TypeOf(SHA256.digest) != CallbackType)
- @compileLog("Expected SHA256.digest to be a callback");
+ @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");
+ @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");
@@ -1265,9 +1265,9 @@ pub const JSSHA512_256 = struct {
@compileLog("Expected SHA512_256.getByteLength to be a getter");
if (@TypeOf(SHA512_256.digest) != CallbackType)
- @compileLog("Expected SHA512_256.digest to be a callback");
+ @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");
+ @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");
@@ -1396,28 +1396,28 @@ pub const JSServerWebSocket = struct {
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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
@@ -1425,19 +1425,19 @@ pub const JSServerWebSocket = struct {
@compileLog("Expected ServerWebSocket.getRemoteAddress to be a getter");
if (@TypeOf(ServerWebSocket.send) != CallbackType)
- @compileLog("Expected ServerWebSocket.send to be a callback");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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" });
@@ -1595,12 +1595,12 @@ pub const JSFileSystemRouter = struct {
}
if (@TypeOf(FileSystemRouter.match) != CallbackType)
- @compileLog("Expected FileSystemRouter.match to be a callback");
+ @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");
+ @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");
@@ -1972,73 +1972,73 @@ pub const JSExpect = struct {
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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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");
+ @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)
@@ -2214,7 +2214,7 @@ pub const JSTextDecoder = struct {
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");
+ @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");
@@ -2364,9 +2364,9 @@ pub const JSRequest = struct {
}
if (@TypeOf(Request.getArrayBuffer) != CallbackType)
- @compileLog("Expected Request.getArrayBuffer to be a callback");
+ @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");
+ @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");
@@ -2377,7 +2377,7 @@ pub const JSRequest = struct {
@compileLog("Expected Request.getCache to be a getter");
if (@TypeOf(Request.doClone) != CallbackType)
- @compileLog("Expected Request.doClone to be a callback");
+ @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");
@@ -2391,7 +2391,7 @@ pub const JSRequest = struct {
@compileLog("Expected Request.getIntegrity to be a getter");
if (@TypeOf(Request.getJSON) != CallbackType)
- @compileLog("Expected Request.getJSON to be a callback");
+ @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");
@@ -2408,7 +2408,7 @@ pub const JSRequest = struct {
@compileLog("Expected Request.getReferrerPolicy to be a getter");
if (@TypeOf(Request.getText) != CallbackType)
- @compileLog("Expected Request.getText to be a callback");
+ @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");
@@ -2592,9 +2592,9 @@ pub const JSResponse = struct {
}
if (@TypeOf(Response.getArrayBuffer) != CallbackType)
- @compileLog("Expected Response.getArrayBuffer to be a callback");
+ @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");
+ @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");
@@ -2602,12 +2602,12 @@ pub const JSResponse = struct {
@compileLog("Expected Response.getBodyUsed to be a getter");
if (@TypeOf(Response.doClone) != CallbackType)
- @compileLog("Expected Response.doClone to be a callback");
+ @compileLog("Expected Response.doClone to be a callback but received " ++ @typeName(@TypeOf(Response.doClone)));
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");
+ @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");
@@ -2621,7 +2621,7 @@ pub const JSResponse = struct {
@compileLog("Expected Response.getStatusText to be a getter");
if (@TypeOf(Response.getText) != CallbackType)
- @compileLog("Expected Response.getText to be a callback");
+ @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");
@@ -2721,25 +2721,25 @@ pub const JSBlob = struct {
}
if (@TypeOf(Blob.getArrayBuffer) != CallbackType)
- @compileLog("Expected Blob.getArrayBuffer to be a callback");
+ @compileLog("Expected Blob.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Blob.getArrayBuffer)));
if (@TypeOf(Blob.getJSON) != CallbackType)
- @compileLog("Expected Blob.getJSON to be a callback");
+ @compileLog("Expected Blob.getJSON to be a callback but received " ++ @typeName(@TypeOf(Blob.getJSON)));
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");
+ @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");
+ @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");
+ @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.setType) != SetterType)
@compileLog("Expected Blob.setType to be a setter");
if (@TypeOf(Blob.getWriter) != CallbackType)
- @compileLog("Expected Blob.getWriter to be a callback");
+ @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" });
@@ -2755,6 +2755,428 @@ pub const JSBlob = struct {
}
}
};
+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;
+
+ /// Return the pointer to the wrapped object.
+ /// If the object does not match the type, return null.
+ pub fn fromJS(value: JSC.JSValue) ?*Dirent {
+ JSC.markBinding(@src());
+ return Dirent__fromJS(value);
+ }
+
+ 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);
+ }
+
+ /// `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;
+ }
+
+ /// 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());
+ if (comptime Environment.allow_assert) {
+ const value__ = Dirent__create(globalObject, this);
+ std.debug.assert(value__.as(Dirent).? == this); // If this fails, likely a C ABI issue.
+ return value__;
+ } else {
+ return Dirent__create(globalObject, this);
+ }
+ }
+
+ /// 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);
+ }
+
+ /// Detach the ptr from the thisValue
+ pub fn detachPtr(_: *Dirent, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ std.debug.assert(Dirent__dangerouslySetPtr(value, null));
+ }
+
+ extern fn Dirent__fromJS(JSC.JSValue) ?*Dirent;
+ extern fn Dirent__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
+
+ extern fn Dirent__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Dirent) JSC.JSValue;
+
+ 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 (!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" });
+ }
+ }
+};
+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;
+
+ /// Return the pointer to the wrapped object.
+ /// If the object does not match the type, return null.
+ pub fn fromJS(value: JSC.JSValue) ?*NodeJSFS {
+ JSC.markBinding(@src());
+ 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());
+ if (comptime Environment.allow_assert) {
+ const value__ = NodeJSFS__create(globalObject, this);
+ std.debug.assert(value__.as(NodeJSFS).? == this); // If this fails, likely a C ABI issue.
+ return value__;
+ } else {
+ return NodeJSFS__create(globalObject, this);
+ }
+ }
+
+ /// 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);
+ }
+
+ /// Detach the ptr from the thisValue
+ pub fn detachPtr(_: *NodeJSFS, value: JSC.JSValue) void {
+ JSC.markBinding(@src());
+ std.debug.assert(NodeJSFS__dangerouslySetPtr(value, null));
+ }
+
+ extern fn NodeJSFS__fromJS(JSC.JSValue) ?*NodeJSFS;
+ extern fn NodeJSFS__getConstructor(*JSC.JSGlobalObject) JSC.JSValue;
+
+ extern fn NodeJSFS__create(globalObject: *JSC.JSGlobalObject, ptr: ?*NodeJSFS) JSC.JSValue;
+
+ 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.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.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" });
+ }
+ }
+};
comptime {
_ = JSTCPSocket;
@@ -2777,4 +3199,6 @@ comptime {
_ = JSRequest;
_ = JSResponse;
_ = JSBlob;
+ _ = JSDirent;
+ _ = JSNodeJSFS;
}
diff --git a/src/bun.js/bindings/generated_classes_list.zig b/src/bun.js/bindings/generated_classes_list.zig
index 1c7dfc5ad..53019d178 100644
--- a/src/bun.js/bindings/generated_classes_list.zig
+++ b/src/bun.js/bindings/generated_classes_list.zig
@@ -21,4 +21,6 @@ pub const Classes = struct {
pub const Expect = JSC.Jest.Expect;
pub const FileSystemRouter = JSC.API.FileSystemRouter;
pub const MatchedRoute = JSC.API.MatchedRoute;
+ pub const Dirent = JSC.Node.Dirent;
+ pub const NodeJSFS = JSC.Node.NodeJSFS;
};
diff --git a/src/bun.js/bindings/header-gen.zig b/src/bun.js/bindings/header-gen.zig
index 57f0189d9..fcc0f60fd 100644
--- a/src/bun.js/bindings/header-gen.zig
+++ b/src/bun.js/bindings/header-gen.zig
@@ -1,10 +1,10 @@
const std = @import("std");
const Dir = std.fs.Dir;
-const FnMeta = std.builtin.TypeInfo.Fn;
-const FnDecl = std.builtin.TypeInfo.Declaration.Data.FnDecl;
-const StructMeta = std.builtin.TypeInfo.Struct;
-const EnumMeta = std.builtin.TypeInfo.Enum;
-const UnionMeta = std.builtin.TypeInfo.Union;
+const FnMeta = std.builtin.Type.Fn;
+const FnDecl = std.builtin.Type.Declaration.Data.FnDecl;
+const StructMeta = std.builtin.Type.Struct;
+const EnumMeta = std.builtin.Type.Enum;
+const UnionMeta = std.builtin.Type.Union;
const warn = std.debug.warn;
const StaticExport = @import("./static_export.zig");
const typeBaseName = @import("../../meta.zig").typeBaseName;
@@ -43,28 +43,28 @@ pub fn cTypeLabel(comptime Type: type) ?[]const u8 {
f32 => "float",
*anyopaque => "void*",
*const anyopaque => "const void*",
- [*]bool => "bool*",
- [*]usize => "size_t*",
- [*]isize => "int*",
+ [*c]bool, [*]bool => "bool*",
+ [*c]usize, [*]usize => "size_t*",
+ [*c]isize, [*]isize => "int*",
[*]u8 => "unsigned char*",
- [*]u16 => "uint16_t*",
- [*]u32 => "uint32_t*",
- [*]u64 => "uint64_t*",
- [*]i8 => "int8_t*",
- [*]i16 => "int16_t*",
- [*]i32 => "int32_t*",
- [*]i64 => "int64_t*",
- [*]const bool => "const bool*",
- [*]const usize => "const size_t*",
- [*]const isize => "const int*",
+ [*c]u16, [*]u16 => "uint16_t*",
+ [*c]u32, [*]u32 => "uint32_t*",
+ [*c]u64, [*]u64 => "uint64_t*",
+ [*c]i8, [*]i8 => "int8_t*",
+ [*c]i16, [*]i16 => "int16_t*",
+ [*c]i32, [*]i32 => "int32_t*",
+ [*c]i64, [*]i64 => "int64_t*",
+ [*c]const bool, [*]const bool => "const bool*",
+ [*c]const usize, [*]const usize => "const size_t*",
+ [*c]const isize, [*]const isize => "const int*",
[*c]const u8, [*]const u8 => "const unsigned char*",
- [*]const u16 => "const uint16_t*",
- [*]const u32 => "const uint32_t*",
- [*]const u64 => "const uint64_t*",
- [*]const i8 => "const int8_t*",
- [*]const i16 => "const int16_t*",
- [*]const i32 => "const int32_t*",
- [*]const i64 => "const int64_t*",
+ [*c]const u16, [*]const u16 => "const uint16_t*",
+ [*c]const u32, [*]const u32 => "const uint32_t*",
+ [*c]const u64, [*]const u64 => "const uint64_t*",
+ [*c]const i8, [*]const i8 => "const int8_t*",
+ [*c]const i16, [*]const i16 => "const int16_t*",
+ [*c]const i32, [*]const i32 => "const int32_t*",
+ [*c]const i64, [*]const i64 => "const int64_t*",
else => null,
};
}
@@ -145,24 +145,32 @@ pub const C_Generator = struct {
}
}
- inline for (meta.args) |arg, i| {
- const ArgType = comptime arg.arg_type.?;
+ comptime var nonnull = std.BoundedArray(u8, 32).init(0) catch unreachable;
- switch (@typeInfo(ArgType)) {
+ inline for (meta.params) |arg, i| {
+ const ArgType = comptime arg.type.?;
+
+ switch (comptime @typeInfo(ArgType)) {
.Fn => {
- self.gen_closure(comptime arg.arg_type.?, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i}));
+ self.gen_closure(comptime arg.type.?, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i}));
+ comptime nonnull.append(i) catch unreachable;
},
- else => {
- self.writeType(comptime arg.arg_type.?);
+ else => |info| {
+ if (comptime info == .Pointer and @typeInfo(info.Pointer.child) == .Fn) {
+ self.gen_closure(comptime info.Pointer.child, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i}));
+ comptime nonnull.append(i) catch unreachable;
+ } else {
+ self.writeType(comptime arg.type.?);
- switch (@typeInfo(ArgType)) {
- .Enum => {
- self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i }));
- },
+ switch (@typeInfo(ArgType)) {
+ .Enum => {
+ self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i }));
+ },
- else => {
- self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
- },
+ else => {
+ self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
+ },
+ }
}
},
}
@@ -172,13 +180,23 @@ pub const C_Generator = struct {
// } else {
//TODO: Figure out how to get arg names; for now just do arg0..argN
- if (i != meta.args.len - 1)
+ if (i != meta.params.len - 1)
self.write(", ");
}
self.write(")");
+ const nonnull_slice = comptime nonnull.slice();
+ if (comptime nonnull_slice.len > 0) {
+ self.write(" __attribute__((nonnull (");
+ inline for (comptime nonnull_slice) |i, j| {
+ self.write(comptime std.fmt.comptimePrint("{d}", .{i}));
+ if (j != nonnull_slice.len - 1)
+ self.write(", ");
+ }
+ self.write(")))");
+ }
defer self.write(";\n");
- // const ReturnTypeInfo: std.builtin.TypeInfo = comptime @typeInfo(func.return_type);
+ // const ReturnTypeInfo: std.builtin.Type = comptime @typeInfo(func.return_type);
// switch (comptime ReturnTypeInfo) {
// .Pointer => |Pointer| {
// self.write(" __attribute__((returns_nonnull))");
@@ -193,15 +211,15 @@ pub const C_Generator = struct {
comptime Function: type,
comptime name: []const u8,
) void {
- const func: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn;
+ const func: std.builtin.Type.Fn = @typeInfo(Function).Fn;
self.writeType(func.return_type orelse void);
- self.write(" (*" ++ name ++ ")(");
- inline for (func.args) |arg, i| {
- self.writeType(arg.arg_type.?);
+ self.write("(*" ++ name ++ ")(");
+ inline for (func.params) |arg, i| {
+ self.writeType(arg.type.?);
// if (comptime func.arg_names.len > 0 and func.arg_names.len > i) {
// self.write(comptime arg_names[i]);
// } else {
- const ArgType = arg.arg_type.?;
+ const ArgType = arg.type.?;
if (@typeInfo(ArgType) == .Enum) {
self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i }));
} else {
@@ -210,12 +228,12 @@ pub const C_Generator = struct {
// }
//TODO: Figure out how to get arg names; for now just do arg0..argN
- if (i != func.args.len - 1)
+ if (i != func.params.len - 1)
self.write(", ");
}
self.write(")");
- // const ReturnTypeInfo: std.builtin.TypeInfo = comptime @typeInfo(func.return_type);
+ // const ReturnTypeInfo: std.builtin.Type = comptime @typeInfo(func.return_type);
// switch (comptime ReturnTypeInfo) {
// .Pointer => |Pointer| {
// self.write(" __attribute__((returns_nonnull))");
@@ -241,7 +259,7 @@ pub const C_Generator = struct {
inline for (meta.fields) |field| {
self.write(" ");
- const info = @typeInfo(field.field_type);
+ const info = @typeInfo(field.type);
if (info == .Array) {
const PrintType = comptime brk: {
@@ -257,12 +275,12 @@ pub const C_Generator = struct {
} else {
const PrintType = comptime brk: {
for (static_types) |static_type| {
- if (static_type.Type == field.field_type) {
+ if (static_type.Type == field.type) {
break :brk static_type.Type;
}
}
- break :brk field.field_type;
+ break :brk field.type;
};
self.writeType(PrintType);
}
@@ -554,7 +572,7 @@ pub fn HeaderGen(comptime first_import: type, comptime second_import: type, comp
_: anytype,
gen: *C_Generator,
comptime ParentType: type,
- comptime _: std.builtin.TypeInfo.Declaration,
+ comptime _: std.builtin.Type.Declaration,
comptime name: []const u8,
comptime prefix: []const u8,
) void {
@@ -722,7 +740,7 @@ pub fn HeaderGen(comptime first_import: type, comptime second_import: type, comp
@setEvalBranchQuota(99999);
const Type = @field(BaseType, _decls.name);
if (@TypeOf(Type) == type) {
- const TypeTypeInfo: std.builtin.TypeInfo = @typeInfo(@field(BaseType, _decls.name));
+ const TypeTypeInfo: std.builtin.Type = @typeInfo(@field(BaseType, _decls.name));
const is_container_type = switch (TypeTypeInfo) {
.Opaque, .Struct, .Enum => true,
else => false,
diff --git a/src/bun.js/bindings/headers-cpp.h b/src/bun.js/bindings/headers-cpp.h
index 0e43e86de..1c2fe28e5 100644
--- a/src/bun.js/bindings/headers-cpp.h
+++ b/src/bun.js/bindings/headers-cpp.h
@@ -1,4 +1,4 @@
-//-- AUTOGENERATED FILE -- 1671518642
+//-- AUTOGENERATED FILE -- 1672085644
// clang-format off
#pragma once
diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h
index 31f5dc22a..6bb3a6fb5 100644
--- a/src/bun.js/bindings/headers.h
+++ b/src/bun.js/bindings/headers.h
@@ -1,5 +1,5 @@
// clang-format off
-//-- AUTOGENERATED FILE -- 1671518642
+//-- AUTOGENERATED FILE -- 1672085644
#pragma once
#include <stddef.h>
@@ -128,18 +128,18 @@ typedef void* JSClassRef;
#pragma mark - JSC::JSObject
-CPP_DECL JSC__JSValue JSC__JSObject__create(JSC__JSGlobalObject* arg0, size_t arg1, void* arg2, void (* ArgFn3)(void* arg0, JSC__JSObject* arg1, JSC__JSGlobalObject* arg2));
+CPP_DECL JSC__JSValue JSC__JSObject__create(JSC__JSGlobalObject* arg0, size_t arg1, void* arg2, void(* ArgFn3)(void* arg0, JSC__JSObject* arg1, JSC__JSGlobalObject* arg2)) __attribute__((nonnull (3)));
CPP_DECL size_t JSC__JSObject__getArrayLength(JSC__JSObject* arg0);
CPP_DECL JSC__JSValue JSC__JSObject__getDirect(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, const ZigString* arg2);
CPP_DECL JSC__JSValue JSC__JSObject__getIndex(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2);
CPP_DECL void JSC__JSObject__putRecord(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4);
-CPP_DECL JSC__JSValue ZigString__external(const ZigString* arg0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(void* arg0, void* arg1, size_t arg2));
+CPP_DECL JSC__JSValue ZigString__external(const ZigString* arg0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(void* arg0, void* arg1, size_t arg2)) __attribute__((nonnull (3)));
CPP_DECL JSC__JSValue ZigString__to16BitValue(const ZigString* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL JSC__JSValue ZigString__toAtomicValue(const ZigString* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL JSC__JSValue ZigString__toErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL JSC__JSValue ZigString__toExternalU16(const uint16_t* arg0, size_t arg1, JSC__JSGlobalObject* arg2);
CPP_DECL JSC__JSValue ZigString__toExternalValue(const ZigString* arg0, JSC__JSGlobalObject* arg1);
-CPP_DECL JSC__JSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC__JSGlobalObject* arg1, void (* ArgFn2)(void* arg0, void* arg1, size_t arg2));
+CPP_DECL JSC__JSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC__JSGlobalObject* arg1, void(* ArgFn2)(void* arg0, void* arg1, size_t arg2)) __attribute__((nonnull (2)));
CPP_DECL JSC__JSValue ZigString__toValue(const ZigString* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL JSC__JSValue ZigString__toValueGC(const ZigString* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL WebCore__DOMURL* WebCore__DOMURL__cast_(JSC__JSValue JSValue0, JSC__VM* arg1);
@@ -241,7 +241,7 @@ CPP_DECL JSC__VM* JSC__JSGlobalObject__vm(JSC__JSGlobalObject* arg0);
#pragma mark - JSC::JSValue
-CPP_DECL void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__JSValue (* ArgFn3)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1), JSC__JSValue (* ArgFn4)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1));
+CPP_DECL void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__JSValue(* ArgFn3)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1), JSC__JSValue(* ArgFn4)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1)) __attribute__((nonnull (3, 4)));
CPP_DECL bool JSC__JSValue__asArrayBuffer_(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, Bun__ArrayBuffer* arg2);
CPP_DECL unsigned char JSC__JSValue__asBigIntCompare(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
CPP_DECL JSC__JSCell* JSC__JSValue__asCell(JSC__JSValue JSValue0);
@@ -264,8 +264,8 @@ CPP_DECL bool JSC__JSValue__deepEquals(JSC__JSValue JSValue0, JSC__JSValue JSVal
CPP_DECL bool JSC__JSValue__eqlCell(JSC__JSValue JSValue0, JSC__JSCell* arg1);
CPP_DECL bool JSC__JSValue__eqlValue(JSC__JSValue JSValue0, JSC__JSValue JSValue1);
CPP_DECL JSC__JSValue JSC__JSValue__fastGet_(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, unsigned char arg2);
-CPP_DECL void JSC__JSValue__forEach(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(JSC__VM* arg0, JSC__JSGlobalObject* arg1, void* arg2, JSC__JSValue JSValue3));
-CPP_DECL void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__JSValue JSValue3, bool arg4));
+CPP_DECL void JSC__JSValue__forEach(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__VM* arg0, JSC__JSGlobalObject* arg1, void* arg2, JSC__JSValue JSValue3)) __attribute__((nonnull (3)));
+CPP_DECL void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__JSValue JSValue3, bool arg4)) __attribute__((nonnull (3)));
CPP_DECL JSC__JSValue JSC__JSValue__fromEntries(JSC__JSGlobalObject* arg0, ZigString* arg1, ZigString* arg2, size_t arg3, bool arg4);
CPP_DECL JSC__JSValue JSC__JSValue__fromInt64NoTruncate(JSC__JSGlobalObject* arg0, int64_t arg1);
CPP_DECL JSC__JSValue JSC__JSValue__fromUInt64NoTruncate(JSC__JSGlobalObject* arg0, uint64_t arg1);
@@ -344,7 +344,7 @@ CPP_DECL size_t JSC__VM__blockBytesAllocated(JSC__VM* arg0);
CPP_DECL void JSC__VM__clearExecutionTimeLimit(JSC__VM* arg0);
CPP_DECL void JSC__VM__collectAsync(JSC__VM* arg0);
CPP_DECL JSC__VM* JSC__VM__create(unsigned char HeapType0);
-CPP_DECL void JSC__VM__deferGC(JSC__VM* arg0, void* arg1, void (* ArgFn2)(void* arg0));
+CPP_DECL void JSC__VM__deferGC(JSC__VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)) __attribute__((nonnull (2)));
CPP_DECL void JSC__VM__deinit(JSC__VM* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL void JSC__VM__deleteAllCode(JSC__VM* arg0, JSC__JSGlobalObject* arg1);
CPP_DECL void JSC__VM__doWork(JSC__VM* arg0);
@@ -352,7 +352,7 @@ CPP_DECL void JSC__VM__drainMicrotasks(JSC__VM* arg0);
CPP_DECL bool JSC__VM__executionForbidden(JSC__VM* arg0);
CPP_DECL size_t JSC__VM__externalMemorySize(JSC__VM* arg0);
CPP_DECL size_t JSC__VM__heapSize(JSC__VM* arg0);
-CPP_DECL void JSC__VM__holdAPILock(JSC__VM* arg0, void* arg1, void (* ArgFn2)(void* arg0));
+CPP_DECL void JSC__VM__holdAPILock(JSC__VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)) __attribute__((nonnull (2)));
CPP_DECL bool JSC__VM__isEntered(JSC__VM* arg0);
CPP_DECL bool JSC__VM__isJITEnabled();
CPP_DECL void JSC__VM__releaseWeakRefs(JSC__VM* arg0);
@@ -362,7 +362,7 @@ CPP_DECL void JSC__VM__setExecutionTimeLimit(JSC__VM* arg0, double arg1);
CPP_DECL void JSC__VM__shrinkFootprint(JSC__VM* arg0);
CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2);
-CPP_DECL void JSC__VM__whenIdle(JSC__VM* arg0, void (* ArgFn1)());
+CPP_DECL void JSC__VM__whenIdle(JSC__VM* arg0, void(* ArgFn1)()) __attribute__((nonnull (1)));
#pragma mark - JSC::ThrowScope
diff --git a/src/bun.js/bindings/headers.zig b/src/bun.js/bindings/headers.zig
index 7e5dca6e2..61f6c6612 100644
--- a/src/bun.js/bindings/headers.zig
+++ b/src/bun.js/bindings/headers.zig
@@ -80,34 +80,34 @@ pub const JSC__JSCell = bJSC__JSCell;
pub const JSC__JSInternalPromise = bJSC__JSInternalPromise;
pub const JSC__Exception = bJSC__Exception;
pub const JSC__JSString = bJSC__JSString;
-pub extern fn JSC__JSObject__create(arg0: ?*JSC__JSGlobalObject, arg1: usize, arg2: ?*anyopaque, ArgFn3: ?fn (?*anyopaque, [*c]JSC__JSObject, ?*JSC__JSGlobalObject) callconv(.C) void) JSC__JSValue;
-pub extern fn JSC__JSObject__getArrayLength(arg0: [*c]JSC__JSObject) usize;
-pub extern fn JSC__JSObject__getDirect(arg0: [*c]JSC__JSObject, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const ZigString) JSC__JSValue;
-pub extern fn JSC__JSObject__getIndex(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u32) JSC__JSValue;
-pub extern fn JSC__JSObject__putRecord(arg0: [*c]JSC__JSObject, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void;
-pub extern fn ZigString__external(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue;
-pub extern fn ZigString__to16BitValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toAtomicValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toErrorInstance(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toExternalU16(arg0: [*c]const u16, arg1: usize, arg2: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toExternalValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toExternalValueWithCallback(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject, ArgFn2: ?fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue;
-pub extern fn ZigString__toValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn ZigString__toValueGC(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn WebCore__DOMURL__cast_(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) ?*bindings.DOMURL;
+pub extern fn JSC__JSObject__create(arg0: *bindings.JSGlobalObject, arg1: usize, arg2: ?*anyopaque, ArgFn3: ?*const fn (?*anyopaque, [*c]bindings.JSObject, *bindings.JSGlobalObject) callconv(.C) void) JSC__JSValue;
+pub extern fn JSC__JSObject__getArrayLength(arg0: [*c]bindings.JSObject) usize;
+pub extern fn JSC__JSObject__getDirect(arg0: [*c]bindings.JSObject, arg1: *bindings.JSGlobalObject, arg2: [*c]const ZigString) JSC__JSValue;
+pub extern fn JSC__JSObject__getIndex(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u32) JSC__JSValue;
+pub extern fn JSC__JSObject__putRecord(arg0: [*c]bindings.JSObject, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void;
+pub extern fn ZigString__external(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue;
+pub extern fn ZigString__to16BitValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toAtomicValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toErrorInstance(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toExternalU16(arg0: [*c]const u16, arg1: usize, arg2: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toExternalValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toExternalValueWithCallback(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject, ArgFn2: ?*const fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue;
+pub extern fn ZigString__toValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn ZigString__toValueGC(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn WebCore__DOMURL__cast_(JSValue0: JSC__JSValue, arg1: *bindings.VM) ?*bindings.DOMURL;
pub extern fn WebCore__DOMURL__href_(arg0: ?*bindings.DOMURL, arg1: [*c]ZigString) void;
pub extern fn WebCore__DOMURL__pathname_(arg0: ?*bindings.DOMURL, arg1: [*c]ZigString) void;
pub extern fn WebCore__FetchHeaders__append(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString, arg2: [*c]const ZigString) void;
-pub extern fn WebCore__FetchHeaders__cast_(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) ?*bindings.FetchHeaders;
-pub extern fn WebCore__FetchHeaders__clone(arg0: ?*bindings.FetchHeaders, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
+pub extern fn WebCore__FetchHeaders__cast_(JSValue0: JSC__JSValue, arg1: *bindings.VM) ?*bindings.FetchHeaders;
+pub extern fn WebCore__FetchHeaders__clone(arg0: ?*bindings.FetchHeaders, arg1: *bindings.JSGlobalObject) JSC__JSValue;
pub extern fn WebCore__FetchHeaders__cloneThis(arg0: ?*bindings.FetchHeaders) ?*bindings.FetchHeaders;
pub extern fn WebCore__FetchHeaders__copyTo(arg0: ?*bindings.FetchHeaders, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]u8) void;
pub extern fn WebCore__FetchHeaders__count(arg0: ?*bindings.FetchHeaders, arg1: [*c]u32, arg2: [*c]u32) void;
pub extern fn WebCore__FetchHeaders__createEmpty(...) ?*bindings.FetchHeaders;
-pub extern fn WebCore__FetchHeaders__createFromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.FetchHeaders;
+pub extern fn WebCore__FetchHeaders__createFromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.FetchHeaders;
pub extern fn WebCore__FetchHeaders__createFromPicoHeaders_(arg0: ?*const anyopaque) ?*bindings.FetchHeaders;
-pub extern fn WebCore__FetchHeaders__createFromUWS(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) ?*bindings.FetchHeaders;
-pub extern fn WebCore__FetchHeaders__createValue(arg0: ?*JSC__JSGlobalObject, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]const ZigString, arg4: u32) JSC__JSValue;
+pub extern fn WebCore__FetchHeaders__createFromUWS(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) ?*bindings.FetchHeaders;
+pub extern fn WebCore__FetchHeaders__createValue(arg0: *bindings.JSGlobalObject, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]const ZigString, arg4: u32) JSC__JSValue;
pub extern fn WebCore__FetchHeaders__deref(arg0: ?*bindings.FetchHeaders) void;
pub extern fn WebCore__FetchHeaders__fastGet_(arg0: ?*bindings.FetchHeaders, arg1: u8, arg2: [*c]ZigString) void;
pub extern fn WebCore__FetchHeaders__fastHas_(arg0: ?*bindings.FetchHeaders, arg1: u8) bool;
@@ -116,114 +116,114 @@ pub extern fn WebCore__FetchHeaders__get_(arg0: ?*bindings.FetchHeaders, arg1: [
pub extern fn WebCore__FetchHeaders__has(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString) bool;
pub extern fn WebCore__FetchHeaders__put_(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString, arg2: [*c]const ZigString) void;
pub extern fn WebCore__FetchHeaders__remove(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString) void;
-pub extern fn WebCore__FetchHeaders__toJS(arg0: ?*bindings.FetchHeaders, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
+pub extern fn WebCore__FetchHeaders__toJS(arg0: ?*bindings.FetchHeaders, arg1: *bindings.JSGlobalObject) JSC__JSValue;
pub extern fn WebCore__FetchHeaders__toUWSResponse(arg0: ?*bindings.FetchHeaders, arg1: bool, arg2: ?*anyopaque) void;
-pub extern fn SystemError__toErrorInstance(arg0: [*c]const SystemError, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSCell__getObject(arg0: [*c]JSC__JSCell) [*c]JSC__JSObject;
-pub extern fn JSC__JSCell__getType(arg0: [*c]JSC__JSCell) u8;
-pub extern fn JSC__JSString__eql(arg0: [*c]const JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__JSString) bool;
+pub extern fn SystemError__toErrorInstance(arg0: [*c]const SystemError, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSCell__getObject(arg0: [*c]bindings.JSCell) [*c]bindings.JSObject;
+pub extern fn JSC__JSCell__getType(arg0: [*c]bindings.JSCell) u8;
+pub extern fn JSC__JSString__eql(arg0: [*c]const JSC__JSString, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.JSString) bool;
pub extern fn JSC__JSString__is8Bit(arg0: [*c]const JSC__JSString) bool;
-pub extern fn JSC__JSString__iterator(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque) void;
+pub extern fn JSC__JSString__iterator(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque) void;
pub extern fn JSC__JSString__length(arg0: [*c]const JSC__JSString) usize;
-pub extern fn JSC__JSString__toObject(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSObject;
-pub extern fn JSC__JSString__toZigString(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void;
-pub extern fn JSC__JSModuleLoader__evaluate(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const u8, arg2: usize, arg3: [*c]const u8, arg4: usize, arg5: [*c]const u8, arg6: usize, JSValue7: JSC__JSValue, arg8: [*c]JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSModuleLoader__loadAndEvaluateModule(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString) [*c]JSC__JSInternalPromise;
-pub extern fn JSC__JSPromise__asValue(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSPromise__create(arg0: ?*JSC__JSGlobalObject) [*c]JSC__JSPromise;
-pub extern fn JSC__JSPromise__isHandled(arg0: [*c]const JSC__JSPromise, arg1: [*c]JSC__VM) bool;
-pub extern fn JSC__JSPromise__reject(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSPromise__rejectAsHandled(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSPromise__rejectAsHandledException(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__Exception) void;
-pub extern fn JSC__JSPromise__rejectedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSPromise;
-pub extern fn JSC__JSPromise__rejectedPromiseValue(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSPromise__rejectWithCaughtException(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, arg2: bJSC__ThrowScope) void;
-pub extern fn JSC__JSPromise__resolve(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSPromise__resolvedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSPromise;
-pub extern fn JSC__JSPromise__resolvedPromiseValue(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSPromise__result(arg0: [*c]JSC__JSPromise, arg1: [*c]JSC__VM) JSC__JSValue;
-pub extern fn JSC__JSPromise__status(arg0: [*c]const JSC__JSPromise, arg1: [*c]JSC__VM) u32;
-pub extern fn JSC__JSInternalPromise__create(arg0: ?*JSC__JSGlobalObject) [*c]JSC__JSInternalPromise;
-pub extern fn JSC__JSInternalPromise__isHandled(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) bool;
-pub extern fn JSC__JSInternalPromise__reject(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSInternalPromise__rejectAsHandled(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSInternalPromise__rejectAsHandledException(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__Exception) void;
-pub extern fn JSC__JSInternalPromise__rejectedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSInternalPromise;
-pub extern fn JSC__JSInternalPromise__rejectWithCaughtException(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, arg2: bJSC__ThrowScope) void;
-pub extern fn JSC__JSInternalPromise__resolve(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__JSInternalPromise__resolvedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSInternalPromise;
-pub extern fn JSC__JSInternalPromise__result(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) JSC__JSValue;
-pub extern fn JSC__JSInternalPromise__status(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) u32;
+pub extern fn JSC__JSString__toObject(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject) [*c]bindings.JSObject;
+pub extern fn JSC__JSString__toZigString(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void;
+pub extern fn JSC__JSModuleLoader__evaluate(arg0: *bindings.JSGlobalObject, arg1: [*c]const u8, arg2: usize, arg3: [*c]const u8, arg4: usize, arg5: [*c]const u8, arg6: usize, JSValue7: JSC__JSValue, arg8: [*c]bindings.JSValue) JSC__JSValue;
+pub extern fn JSC__JSModuleLoader__loadAndEvaluateModule(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString) [*c]bindings.JSInternalPromise;
+pub extern fn JSC__JSPromise__asValue(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSPromise__create(arg0: *bindings.JSGlobalObject) ?*bindings.JSPromise;
+pub extern fn JSC__JSPromise__isHandled(arg0: [*c]const JSC__JSPromise, arg1: *bindings.VM) bool;
+pub extern fn JSC__JSPromise__reject(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSPromise__rejectAsHandled(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSPromise__rejectAsHandledException(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.Exception) void;
+pub extern fn JSC__JSPromise__rejectedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.JSPromise;
+pub extern fn JSC__JSPromise__rejectedPromiseValue(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue;
+pub extern fn JSC__JSPromise__rejectWithCaughtException(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, arg2: bJSC__ThrowScope) void;
+pub extern fn JSC__JSPromise__resolve(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSPromise__resolvedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.JSPromise;
+pub extern fn JSC__JSPromise__resolvedPromiseValue(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue;
+pub extern fn JSC__JSPromise__result(arg0: ?*bindings.JSPromise, arg1: *bindings.VM) JSC__JSValue;
+pub extern fn JSC__JSPromise__status(arg0: [*c]const JSC__JSPromise, arg1: *bindings.VM) u32;
+pub extern fn JSC__JSInternalPromise__create(arg0: *bindings.JSGlobalObject) [*c]bindings.JSInternalPromise;
+pub extern fn JSC__JSInternalPromise__isHandled(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) bool;
+pub extern fn JSC__JSInternalPromise__reject(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSInternalPromise__rejectAsHandled(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSInternalPromise__rejectAsHandledException(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.Exception) void;
+pub extern fn JSC__JSInternalPromise__rejectedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) [*c]bindings.JSInternalPromise;
+pub extern fn JSC__JSInternalPromise__rejectWithCaughtException(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, arg2: bJSC__ThrowScope) void;
+pub extern fn JSC__JSInternalPromise__resolve(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__JSInternalPromise__resolvedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) [*c]bindings.JSInternalPromise;
+pub extern fn JSC__JSInternalPromise__result(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) JSC__JSValue;
+pub extern fn JSC__JSInternalPromise__status(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) u32;
pub extern fn JSC__JSFunction__optimizeSoon(JSValue0: JSC__JSValue) void;
-pub extern fn JSC__JSGlobalObject__bunVM(arg0: ?*JSC__JSGlobalObject) ?*bindings.VirtualMachine;
-pub extern fn JSC__JSGlobalObject__createAggregateError(arg0: ?*JSC__JSGlobalObject, arg1: [*c]*anyopaque, arg2: u16, arg3: [*c]const ZigString) JSC__JSValue;
-pub extern fn JSC__JSGlobalObject__createSyntheticModule_(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: [*c]JSC__JSValue, arg4: usize) void;
-pub extern fn JSC__JSGlobalObject__deleteModuleRegistryEntry(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString) void;
-pub extern fn JSC__JSGlobalObject__generateHeapSnapshot(arg0: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSGlobalObject__getCachedObject(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString) JSC__JSValue;
-pub extern fn JSC__JSGlobalObject__handleRejectedPromises(arg0: ?*JSC__JSGlobalObject) void;
-pub extern fn JSC__JSGlobalObject__putCachedObject(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString, JSValue2: JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSGlobalObject__reload(arg0: ?*JSC__JSGlobalObject) void;
-pub extern fn JSC__JSGlobalObject__startRemoteInspector(arg0: ?*JSC__JSGlobalObject, arg1: [*c]u8, arg2: u16) bool;
-pub extern fn JSC__JSGlobalObject__vm(arg0: ?*JSC__JSGlobalObject) [*c]JSC__VM;
-pub extern fn JSC__JSValue___then(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue, ArgFn3: ?fn (?*JSC__JSGlobalObject, ?*bindings.CallFrame) callconv(.C) JSC__JSValue, ArgFn4: ?fn (?*JSC__JSGlobalObject, ?*bindings.CallFrame) callconv(.C) JSC__JSValue) void;
-pub extern fn JSC__JSValue__asArrayBuffer_(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*Bun__ArrayBuffer) bool;
-pub extern fn JSC__JSValue__asBigIntCompare(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) u8;
-pub extern fn JSC__JSValue__asCell(JSValue0: JSC__JSValue) [*c]JSC__JSCell;
-pub extern fn JSC__JSValue__asInternalPromise(JSValue0: JSC__JSValue) [*c]JSC__JSInternalPromise;
+pub extern fn JSC__JSGlobalObject__bunVM(arg0: *bindings.JSGlobalObject) ?*bindings.VirtualMachine;
+pub extern fn JSC__JSGlobalObject__createAggregateError(arg0: *bindings.JSGlobalObject, arg1: [*c]*anyopaque, arg2: u16, arg3: [*c]const ZigString) JSC__JSValue;
+pub extern fn JSC__JSGlobalObject__createSyntheticModule_(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: [*c]bindings.JSValue, arg4: usize) void;
+pub extern fn JSC__JSGlobalObject__deleteModuleRegistryEntry(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString) void;
+pub extern fn JSC__JSGlobalObject__generateHeapSnapshot(arg0: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSGlobalObject__getCachedObject(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString) JSC__JSValue;
+pub extern fn JSC__JSGlobalObject__handleRejectedPromises(arg0: *bindings.JSGlobalObject) void;
+pub extern fn JSC__JSGlobalObject__putCachedObject(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString, JSValue2: JSC__JSValue) JSC__JSValue;
+pub extern fn JSC__JSGlobalObject__reload(arg0: *bindings.JSGlobalObject) void;
+pub extern fn JSC__JSGlobalObject__startRemoteInspector(arg0: *bindings.JSGlobalObject, arg1: [*c]u8, arg2: u16) bool;
+pub extern fn JSC__JSGlobalObject__vm(arg0: *bindings.JSGlobalObject) *bindings.VM;
+pub extern fn JSC__JSValue___then(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue, ArgFn3: ?*const fn (*bindings.JSGlobalObject, *bindings.CallFrame) callconv(.C) JSC__JSValue, ArgFn4: ?*const fn (*bindings.JSGlobalObject, *bindings.CallFrame) callconv(.C) JSC__JSValue) void;
+pub extern fn JSC__JSValue__asArrayBuffer_(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*Bun__ArrayBuffer) bool;
+pub extern fn JSC__JSValue__asBigIntCompare(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) u8;
+pub extern fn JSC__JSValue__asCell(JSValue0: JSC__JSValue) [*c]bindings.JSCell;
+pub extern fn JSC__JSValue__asInternalPromise(JSValue0: JSC__JSValue) [*c]bindings.JSInternalPromise;
pub extern fn JSC__JSValue__asNumber(JSValue0: JSC__JSValue) f64;
pub extern fn JSC__JSValue__asObject(JSValue0: JSC__JSValue) bJSC__JSObject;
-pub extern fn JSC__JSValue__asPromise(JSValue0: JSC__JSValue) [*c]JSC__JSPromise;
-pub extern fn JSC__JSValue__asString(JSValue0: JSC__JSValue) [*c]JSC__JSString;
-pub extern fn JSC__JSValue__coerceToInt32(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) i32;
-pub extern fn JSC__JSValue__createEmptyObject(arg0: ?*JSC__JSGlobalObject, arg1: usize) JSC__JSValue;
-pub extern fn JSC__JSValue__createInternalPromise(arg0: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__createObject2(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString, arg2: [*c]const ZigString, JSValue3: JSC__JSValue, JSValue4: JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSValue__createRangeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__createRopeString(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__createStringArray(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: bool) JSC__JSValue;
-pub extern fn JSC__JSValue__createTypeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__createUninitializedUint8Array(arg0: ?*JSC__JSGlobalObject, arg1: usize) JSC__JSValue;
-pub extern fn JSC__JSValue__deepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool;
-pub extern fn JSC__JSValue__eqlCell(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSCell) bool;
+pub extern fn JSC__JSValue__asPromise(JSValue0: JSC__JSValue) ?*bindings.JSPromise;
+pub extern fn JSC__JSValue__asString(JSValue0: JSC__JSValue) [*c]bindings.JSString;
+pub extern fn JSC__JSValue__coerceToInt32(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) i32;
+pub extern fn JSC__JSValue__createEmptyObject(arg0: *bindings.JSGlobalObject, arg1: usize) JSC__JSValue;
+pub extern fn JSC__JSValue__createInternalPromise(arg0: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__createObject2(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString, arg2: [*c]const ZigString, JSValue3: JSC__JSValue, JSValue4: JSC__JSValue) JSC__JSValue;
+pub extern fn JSC__JSValue__createRangeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__createRopeString(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__createStringArray(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: bool) JSC__JSValue;
+pub extern fn JSC__JSValue__createTypeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__createUninitializedUint8Array(arg0: *bindings.JSGlobalObject, arg1: usize) JSC__JSValue;
+pub extern fn JSC__JSValue__deepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool;
+pub extern fn JSC__JSValue__eqlCell(JSValue0: JSC__JSValue, arg1: [*c]bindings.JSCell) bool;
pub extern fn JSC__JSValue__eqlValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__fastGet_(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u8) JSC__JSValue;
-pub extern fn JSC__JSValue__forEach(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn ([*c]JSC__VM, ?*JSC__JSGlobalObject, ?*anyopaque, JSC__JSValue) callconv(.C) void) void;
-pub extern fn JSC__JSValue__forEachProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn (?*JSC__JSGlobalObject, ?*anyopaque, [*c]ZigString, JSC__JSValue, bool) callconv(.C) void) void;
-pub extern fn JSC__JSValue__fromEntries(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: [*c]ZigString, arg3: usize, arg4: bool) JSC__JSValue;
-pub extern fn JSC__JSValue__fromInt64NoTruncate(arg0: ?*JSC__JSGlobalObject, arg1: i64) JSC__JSValue;
-pub extern fn JSC__JSValue__fromUInt64NoTruncate(arg0: ?*JSC__JSGlobalObject, arg1: u64) JSC__JSValue;
-pub extern fn JSC__JSValue__getClassName(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void;
-pub extern fn JSC__JSValue__getErrorsProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__getIfPropertyExistsFromPath(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) JSC__JSValue;
-pub extern fn JSC__JSValue__getIfPropertyExistsImpl(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const u8, arg3: u32) JSC__JSValue;
-pub extern fn JSC__JSValue__getLengthOfArray(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) u64;
-pub extern fn JSC__JSValue__getNameProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void;
-pub extern fn JSC__JSValue__getPrototype(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__getSymbolDescription(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void;
-pub extern fn JSC__JSValue__isAggregateError(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool;
+pub extern fn JSC__JSValue__fastGet_(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u8) JSC__JSValue;
+pub extern fn JSC__JSValue__forEach(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (*bindings.VM, *bindings.JSGlobalObject, ?*anyopaque, JSC__JSValue) callconv(.C) void) void;
+pub extern fn JSC__JSValue__forEachProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (*bindings.JSGlobalObject, ?*anyopaque, [*c]ZigString, JSC__JSValue, bool) callconv(.C) void) void;
+pub extern fn JSC__JSValue__fromEntries(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: [*c]ZigString, arg3: usize, arg4: bool) JSC__JSValue;
+pub extern fn JSC__JSValue__fromInt64NoTruncate(arg0: *bindings.JSGlobalObject, arg1: i64) JSC__JSValue;
+pub extern fn JSC__JSValue__fromUInt64NoTruncate(arg0: *bindings.JSGlobalObject, arg1: u64) JSC__JSValue;
+pub extern fn JSC__JSValue__getClassName(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void;
+pub extern fn JSC__JSValue__getErrorsProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__getIfPropertyExistsFromPath(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) JSC__JSValue;
+pub extern fn JSC__JSValue__getIfPropertyExistsImpl(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]const u8, arg3: u32) JSC__JSValue;
+pub extern fn JSC__JSValue__getLengthOfArray(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) u64;
+pub extern fn JSC__JSValue__getNameProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void;
+pub extern fn JSC__JSValue__getPrototype(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__getSymbolDescription(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void;
+pub extern fn JSC__JSValue__isAggregateError(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool;
pub extern fn JSC__JSValue__isAnyInt(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isBigInt(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isBigInt32(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isBoolean(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isCallable(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool;
+pub extern fn JSC__JSValue__isCallable(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool;
pub extern fn JSC__JSValue__isCell(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isClass(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool;
+pub extern fn JSC__JSValue__isClass(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool;
pub extern fn JSC__JSValue__isCustomGetterSetter(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isError(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isException(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool;
+pub extern fn JSC__JSValue__isException(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool;
pub extern fn JSC__JSValue__isGetterSetter(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isHeapBigInt(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isInt32(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isInt32AsAnyInt(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isIterable(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool;
+pub extern fn JSC__JSValue__isIterable(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool;
pub extern fn JSC__JSValue__isNumber(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isObject(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isPrimitive(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isSameValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool;
+pub extern fn JSC__JSValue__isSameValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool;
pub extern fn JSC__JSValue__isString(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__isSymbol(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__isTerminationException(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool;
+pub extern fn JSC__JSValue__isTerminationException(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool;
pub extern fn JSC__JSValue__isUInt32AsAnyInt(JSValue0: JSC__JSValue) bool;
pub extern fn JSC__JSValue__jsBoolean(arg0: bool) JSC__JSValue;
pub extern fn JSC__JSValue__jsDoubleNumber(arg0: f64) JSC__JSValue;
@@ -232,102 +232,102 @@ pub extern fn JSC__JSValue__jsNumberFromChar(arg0: u8) JSC__JSValue;
pub extern fn JSC__JSValue__jsNumberFromDouble(arg0: f64) JSC__JSValue;
pub extern fn JSC__JSValue__jsNumberFromInt64(arg0: i64) JSC__JSValue;
pub extern fn JSC__JSValue__jsNumberFromU16(arg0: u16) JSC__JSValue;
-pub extern fn JSC__JSValue__jsonStringify(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u32, arg3: [*c]ZigString) void;
+pub extern fn JSC__JSValue__jsonStringify(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u32, arg3: [*c]ZigString) void;
pub extern fn JSC__JSValue__jsTDZValue(...) JSC__JSValue;
pub extern fn JSC__JSValue__jsType(JSValue0: JSC__JSValue) u8;
pub extern fn JSC__JSValue__jsUndefined(...) JSC__JSValue;
-pub extern fn JSC__JSValue__makeWithNameAndPrototype(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque, arg2: ?*anyopaque, arg3: [*c]const ZigString) JSC__JSValue;
-pub extern fn JSC__JSValue__parseJSON(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
-pub extern fn JSC__JSValue__put(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const ZigString, JSValue3: JSC__JSValue) void;
-pub extern fn JSC__JSValue__putRecord(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void;
-pub extern fn JSC__JSValue__strictDeepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool;
-pub extern fn JSC__JSValue__symbolFor(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString) JSC__JSValue;
-pub extern fn JSC__JSValue__symbolKeyFor(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) bool;
+pub extern fn JSC__JSValue__makeWithNameAndPrototype(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque, arg2: ?*anyopaque, arg3: [*c]const ZigString) JSC__JSValue;
+pub extern fn JSC__JSValue__parseJSON(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__put(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]const ZigString, JSValue3: JSC__JSValue) void;
+pub extern fn JSC__JSValue__putRecord(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void;
+pub extern fn JSC__JSValue__strictDeepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool;
+pub extern fn JSC__JSValue__symbolFor(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString) JSC__JSValue;
+pub extern fn JSC__JSValue__symbolKeyFor(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) bool;
pub extern fn JSC__JSValue__toBoolean(JSValue0: JSC__JSValue) bool;
-pub extern fn JSC__JSValue__toBooleanSlow(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool;
-pub extern fn JSC__JSValue__toError(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue;
+pub extern fn JSC__JSValue__toBooleanSlow(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool;
+pub extern fn JSC__JSValue__toError(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue;
pub extern fn JSC__JSValue__toInt32(JSValue0: JSC__JSValue) i32;
pub extern fn JSC__JSValue__toInt64(JSValue0: JSC__JSValue) i64;
-pub extern fn JSC__JSValue__toObject(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSObject;
-pub extern fn JSC__JSValue__toString(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSString;
-pub extern fn JSC__JSValue__toStringOrNull(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSString;
+pub extern fn JSC__JSValue__toObject(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSObject;
+pub extern fn JSC__JSValue__toString(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSString;
+pub extern fn JSC__JSValue__toStringOrNull(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSString;
pub extern fn JSC__JSValue__toUInt64NoTruncate(JSValue0: JSC__JSValue) u64;
-pub extern fn JSC__JSValue__toZigException(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigException) void;
-pub extern fn JSC__JSValue__toZigString(JSValue0: JSC__JSValue, arg1: [*c]ZigString, arg2: ?*JSC__JSGlobalObject) void;
-pub extern fn JSC__Exception__create(arg0: ?*JSC__JSGlobalObject, arg1: [*c]JSC__JSObject, StackCaptureAction2: u8) [*c]JSC__Exception;
-pub extern fn JSC__Exception__getStackTrace(arg0: [*c]JSC__Exception, arg1: [*c]ZigStackTrace) void;
-pub extern fn JSC__Exception__value(arg0: [*c]JSC__Exception) JSC__JSValue;
-pub extern fn JSC__VM__blockBytesAllocated(arg0: [*c]JSC__VM) usize;
-pub extern fn JSC__VM__clearExecutionTimeLimit(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__collectAsync(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__create(HeapType0: u8) [*c]JSC__VM;
-pub extern fn JSC__VM__deferGC(arg0: [*c]JSC__VM, arg1: ?*anyopaque, ArgFn2: ?fn (?*anyopaque) callconv(.C) void) void;
-pub extern fn JSC__VM__deinit(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject) void;
-pub extern fn JSC__VM__deleteAllCode(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject) void;
-pub extern fn JSC__VM__doWork(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__drainMicrotasks(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__executionForbidden(arg0: [*c]JSC__VM) bool;
-pub extern fn JSC__VM__externalMemorySize(arg0: [*c]JSC__VM) usize;
-pub extern fn JSC__VM__heapSize(arg0: [*c]JSC__VM) usize;
-pub extern fn JSC__VM__holdAPILock(arg0: [*c]JSC__VM, arg1: ?*anyopaque, ArgFn2: ?fn (?*anyopaque) callconv(.C) void) void;
-pub extern fn JSC__VM__isEntered(arg0: [*c]JSC__VM) bool;
+pub extern fn JSC__JSValue__toZigException(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigException) void;
+pub extern fn JSC__JSValue__toZigString(JSValue0: JSC__JSValue, arg1: [*c]ZigString, arg2: *bindings.JSGlobalObject) void;
+pub extern fn JSC__Exception__create(arg0: *bindings.JSGlobalObject, arg1: [*c]bindings.JSObject, StackCaptureAction2: u8) [*c]bindings.Exception;
+pub extern fn JSC__Exception__getStackTrace(arg0: [*c]bindings.Exception, arg1: [*c]ZigStackTrace) void;
+pub extern fn JSC__Exception__value(arg0: [*c]bindings.Exception) JSC__JSValue;
+pub extern fn JSC__VM__blockBytesAllocated(arg0: *bindings.VM) usize;
+pub extern fn JSC__VM__clearExecutionTimeLimit(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__collectAsync(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__create(HeapType0: u8) *bindings.VM;
+pub extern fn JSC__VM__deferGC(arg0: *bindings.VM, arg1: ?*anyopaque, ArgFn2: ?*const fn (?*anyopaque) callconv(.C) void) void;
+pub extern fn JSC__VM__deinit(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject) void;
+pub extern fn JSC__VM__deleteAllCode(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject) void;
+pub extern fn JSC__VM__doWork(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__drainMicrotasks(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__executionForbidden(arg0: *bindings.VM) bool;
+pub extern fn JSC__VM__externalMemorySize(arg0: *bindings.VM) usize;
+pub extern fn JSC__VM__heapSize(arg0: *bindings.VM) usize;
+pub extern fn JSC__VM__holdAPILock(arg0: *bindings.VM, arg1: ?*anyopaque, ArgFn2: ?*const fn (?*anyopaque) callconv(.C) void) void;
+pub extern fn JSC__VM__isEntered(arg0: *bindings.VM) bool;
pub extern fn JSC__VM__isJITEnabled(...) bool;
-pub extern fn JSC__VM__releaseWeakRefs(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__runGC(arg0: [*c]JSC__VM, arg1: bool) JSC__JSValue;
-pub extern fn JSC__VM__setExecutionForbidden(arg0: [*c]JSC__VM, arg1: bool) void;
-pub extern fn JSC__VM__setExecutionTimeLimit(arg0: [*c]JSC__VM, arg1: f64) void;
-pub extern fn JSC__VM__shrinkFootprint(arg0: [*c]JSC__VM) void;
-pub extern fn JSC__VM__throwError(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void;
-pub extern fn JSC__VM__whenIdle(arg0: [*c]JSC__VM, ArgFn1: ?fn (...) callconv(.C) void) void;
-pub extern fn JSC__ThrowScope__clearException(arg0: [*c]JSC__ThrowScope) void;
-pub extern fn JSC__ThrowScope__declare(arg0: [*c]JSC__VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__ThrowScope;
-pub extern fn JSC__ThrowScope__exception(arg0: [*c]JSC__ThrowScope) [*c]JSC__Exception;
-pub extern fn JSC__ThrowScope__release(arg0: [*c]JSC__ThrowScope) void;
-pub extern fn JSC__CatchScope__clearException(arg0: [*c]JSC__CatchScope) void;
-pub extern fn JSC__CatchScope__declare(arg0: [*c]JSC__VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__CatchScope;
-pub extern fn JSC__CatchScope__exception(arg0: [*c]JSC__CatchScope) [*c]JSC__Exception;
-pub extern fn FFI__ptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__u8__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__u16__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__u32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__ptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__i8__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__i16__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__i32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__f32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__f64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__i64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__u64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Reader__intptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Crypto__getRandomValues__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Crypto__randomUUID__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Crypto__timingSafeEqual__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void;
-pub extern fn Zig__GlobalObject__create(arg0: [*c]JSClassRef, arg1: i32, arg2: ?*anyopaque) ?*JSC__JSGlobalObject;
-pub extern fn Zig__GlobalObject__getModuleRegistryMap(arg0: ?*JSC__JSGlobalObject) ?*anyopaque;
-pub extern fn Zig__GlobalObject__resetModuleRegistryMap(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) bool;
-pub extern fn Bun__Path__create(arg0: ?*JSC__JSGlobalObject, arg1: bool) JSC__JSValue;
-pub extern fn ArrayBufferSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
-pub extern fn ArrayBufferSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
+pub extern fn JSC__VM__releaseWeakRefs(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__runGC(arg0: *bindings.VM, arg1: bool) JSC__JSValue;
+pub extern fn JSC__VM__setExecutionForbidden(arg0: *bindings.VM, arg1: bool) void;
+pub extern fn JSC__VM__setExecutionTimeLimit(arg0: *bindings.VM, arg1: f64) void;
+pub extern fn JSC__VM__shrinkFootprint(arg0: *bindings.VM) void;
+pub extern fn JSC__VM__throwError(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void;
+pub extern fn JSC__VM__whenIdle(arg0: *bindings.VM, ArgFn1: ?*const fn (...) callconv(.C) void) void;
+pub extern fn JSC__ThrowScope__clearException(arg0: [*c]bindings.ThrowScope) void;
+pub extern fn JSC__ThrowScope__declare(arg0: *bindings.VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__ThrowScope;
+pub extern fn JSC__ThrowScope__exception(arg0: [*c]bindings.ThrowScope) [*c]bindings.Exception;
+pub extern fn JSC__ThrowScope__release(arg0: [*c]bindings.ThrowScope) void;
+pub extern fn JSC__CatchScope__clearException(arg0: [*c]bindings.CatchScope) void;
+pub extern fn JSC__CatchScope__declare(arg0: *bindings.VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__CatchScope;
+pub extern fn JSC__CatchScope__exception(arg0: [*c]bindings.CatchScope) [*c]bindings.Exception;
+pub extern fn FFI__ptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__u8__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__u16__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__u32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__ptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__i8__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__i16__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__i32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__f32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__f64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__i64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__u64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Reader__intptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Crypto__getRandomValues__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Crypto__randomUUID__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Crypto__timingSafeEqual__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void;
+pub extern fn Zig__GlobalObject__create(arg0: [*c]JSClassRef, arg1: i32, arg2: ?*anyopaque) *bindings.JSGlobalObject;
+pub extern fn Zig__GlobalObject__getModuleRegistryMap(arg0: *bindings.JSGlobalObject) ?*anyopaque;
+pub extern fn Zig__GlobalObject__resetModuleRegistryMap(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) bool;
+pub extern fn Bun__Path__create(arg0: *bindings.JSGlobalObject, arg1: bool) JSC__JSValue;
+pub extern fn ArrayBufferSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
+pub extern fn ArrayBufferSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
pub extern fn ArrayBufferSink__detachPtr(JSValue0: JSC__JSValue) void;
-pub extern fn ArrayBufferSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
+pub extern fn ArrayBufferSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
pub extern fn ArrayBufferSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void;
pub extern fn ArrayBufferSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void;
-pub extern fn HTTPSResponseSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
-pub extern fn HTTPSResponseSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
+pub extern fn HTTPSResponseSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
+pub extern fn HTTPSResponseSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
pub extern fn HTTPSResponseSink__detachPtr(JSValue0: JSC__JSValue) void;
-pub extern fn HTTPSResponseSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
+pub extern fn HTTPSResponseSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
pub extern fn HTTPSResponseSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void;
pub extern fn HTTPSResponseSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void;
-pub extern fn HTTPResponseSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
-pub extern fn HTTPResponseSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
+pub extern fn HTTPResponseSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
+pub extern fn HTTPResponseSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
pub extern fn HTTPResponseSink__detachPtr(JSValue0: JSC__JSValue) void;
-pub extern fn HTTPResponseSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
+pub extern fn HTTPResponseSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
pub extern fn HTTPResponseSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void;
pub extern fn HTTPResponseSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void;
-pub extern fn FileSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
-pub extern fn FileSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
+pub extern fn FileSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue;
+pub extern fn FileSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue;
pub extern fn FileSink__detachPtr(JSValue0: JSC__JSValue) void;
-pub extern fn FileSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
+pub extern fn FileSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque;
pub extern fn FileSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void;
pub extern fn FileSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void;
-pub extern fn ZigException__fromException(arg0: [*c]JSC__Exception) ZigException;
+pub extern fn ZigException__fromException(arg0: [*c]bindings.Exception) ZigException;
diff --git a/src/bun.js/bindings/shimmer.zig b/src/bun.js/bindings/shimmer.zig
index f31c894cb..cde7712c5 100644
--- a/src/bun.js/bindings/shimmer.zig
+++ b/src/bun.js/bindings/shimmer.zig
@@ -36,7 +36,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp
// return FromType;
// }
- // var ReturnTypeInfo: std.builtin.TypeInfo = @typeInfo(FromType);
+ // var ReturnTypeInfo: std.builtin.Type = @typeInfo(FromType);
// if (ReturnTypeInfo == .Pointer and NewReturnType != *anyopaque) {
// NewReturnType = ReturnTypeInfo.Pointer.child;
@@ -110,7 +110,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp
if (@typeInfo(Function) != .Fn) {
@compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to be a function but received " ++ @tagName(@typeInfo(Function)));
}
- var Fn: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn;
+ var Fn: std.builtin.Type.Fn = @typeInfo(Function).Fn;
if (Fn.calling_convention != .C) {
@compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to have a C Calling Convention.");
}
@@ -139,7 +139,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp
if (@typeInfo(Function) != .Fn) {
@compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to be a function but received " ++ @tagName(@typeInfo(Function)));
}
- var Fn: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn;
+ var Fn: std.builtin.Type.Fn = @typeInfo(Function).Fn;
if (Fn.calling_convention != .C) {
@compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to have a C Calling Convention.");
}
@@ -182,17 +182,17 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp
unreachable;
} else {
const Fn = comptime @field(headers, symbolName(typeName));
- if (@typeInfo(@TypeOf(Fn)).Fn.args.len > 0)
+ if (@typeInfo(@TypeOf(Fn)).Fn.params.len > 0)
return matchNullable(
comptime @typeInfo(@TypeOf(@field(Parent, typeName))).Fn.return_type.?,
comptime @typeInfo(@TypeOf(Fn)).Fn.return_type.?,
- @call(.{}, Fn, @bitCast(std.meta.ArgsTuple(@TypeOf(Fn)), args)),
+ @call(.auto, Fn, args),
);
return matchNullable(
comptime @typeInfo(@TypeOf(@field(Parent, typeName))).Fn.return_type.?,
comptime @typeInfo(@TypeOf(Fn)).Fn.return_type.?,
- @call(.{}, Fn, .{}),
+ @call(.auto, Fn, .{}),
);
}
}
diff --git a/src/bun.js/bindings/sizes.zig b/src/bun.js/bindings/sizes.zig
index 136eb9f61..795159e49 100644
--- a/src/bun.js/bindings/sizes.zig
+++ b/src/bun.js/bindings/sizes.zig
@@ -6,13 +6,13 @@
// 1. We can't dynamically link JavaScriptCore
// 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change.
// Failure to do so will lead to undefined behavior and probably some frustrated people.
-// --- Regenerate this: ---
+// --- Regenerate this: ---
// 1. "make headers"
// 2. "make sizegen"
// 3. "make headers"
// ------------------------
// You can verify the numbers written in this file at runtime via the `extern`d types
-// Run "headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values.
+// Run "headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values.
pub const JSC__JSObject = 16;
pub const JSC__JSObject_align = 8;
pub const WebCore__DOMURL = 112;
diff --git a/src/bun.js/bindings/static_export.zig b/src/bun.js/bindings/static_export.zig
index f8936f0df..a3d47e56e 100644
--- a/src/bun.js/bindings/static_export.zig
+++ b/src/bun.js/bindings/static_export.zig
@@ -5,7 +5,7 @@ local_name: []const u8,
Parent: type,
-pub fn Decl(comptime this: *const @This()) std.builtin.TypeInfo.Declaration {
+pub fn Decl(comptime this: *const @This()) std.builtin.Type.Declaration {
return comptime std.meta.declarationInfo(this.Parent, this.local_name);
}
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index b770fe3e4..56e68cce0 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -28,7 +28,7 @@ pub fn ConcurrentPromiseTask(comptime Context: type) type {
return struct {
const This = @This();
ctx: *Context,
- task: WorkPoolTask = .{ .callback = runFromThreadPool },
+ task: WorkPoolTask = .{ .callback = &runFromThreadPool },
event_loop: *JSC.EventLoop,
allocator: std.mem.Allocator,
promise: JSC.JSPromise.Strong = .{},
@@ -41,7 +41,7 @@ pub fn ConcurrentPromiseTask(comptime Context: type) type {
pub fn createOnJSThread(allocator: std.mem.Allocator, globalThis: *JSGlobalObject, value: *Context) !*This {
var this = try allocator.create(This);
this.* = .{
- .event_loop = VirtualMachine.vm.event_loop,
+ .event_loop = VirtualMachine.get().event_loop,
.ctx = value,
.allocator = allocator,
.globalThis = globalThis,
@@ -86,7 +86,7 @@ pub fn IOTask(comptime Context: type) type {
return struct {
const This = @This();
ctx: *Context,
- task: NetworkThread.Task = .{ .callback = runFromThreadPool },
+ task: NetworkThread.Task = .{ .callback = &runFromThreadPool },
event_loop: *JSC.EventLoop,
allocator: std.mem.Allocator,
globalThis: *JSGlobalObject,
@@ -140,7 +140,7 @@ pub fn IOTask(comptime Context: type) type {
pub const AnyTask = struct {
ctx: ?*anyopaque,
- callback: fn (*anyopaque) void,
+ callback: *const (fn (*anyopaque) void),
pub fn run(this: *AnyTask) void {
@setRuntimeSafety(false);
@@ -586,7 +586,7 @@ pub const EventLoop = struct {
var task = Task.from(timer.as(*anyopaque));
timer.deinit();
- JSC.VirtualMachine.vm.enqueueTask(task);
+ JSC.VirtualMachine.get().enqueueTask(task);
}
pub fn ensureWaker(this: *EventLoop) void {
diff --git a/src/bun.js/http.exports.js b/src/bun.js/http.exports.js
index 9db81a3a7..6e2eedacb 100644
--- a/src/bun.js/http.exports.js
+++ b/src/bun.js/http.exports.js
@@ -178,25 +178,37 @@ export class IncomingMessage extends Readable {
if (this.#noBody) {
this.push(null);
this.complete = true;
- } else if (this.#bodyStream === null) {
+ } else if (this.#bodyStream == null) {
const contentLength = this.#req.headers.get("content-length");
- var remaining = contentLength ? parseInt(contentLength, 10) : 0;
+ let remaining = contentLength ? parseInt(contentLength, 10) : 0;
this.#bodyStream = Readable.fromWeb(this.#req.body, {
highWaterMark: Number.isFinite(remaining)
? Math.min(remaining, 16384)
: 16384,
});
- this.#bodyStream.on("data", (chunk) => {
- this.push(chunk);
- remaining -= chunk?.byteLength ?? 0;
- if (remaining <= 0) {
+ const isBodySizeKnown = remaining > 0 && Number.isSafeInteger(remaining);
+
+ if (isBodySizeKnown) {
+ this.#bodyStream.on("data", (chunk) => {
+ this.push(chunk);
+ // when we are streaming a known body size, automatically close the stream when we have read enough
+ remaining -= chunk?.byteLength ?? 0;
+ if (remaining <= 0) {
+ this.#closeBodyStream();
+ }
+ });
+ } else {
+ this.#bodyStream.on("data", (chunk) => {
+ this.push(chunk);
+ });
+ }
+
+ // this can be closed by the time we get here if enough data was synchronously available
+ this.#bodyStream &&
+ this.#bodyStream.on("end", () => {
this.#closeBodyStream();
- }
- });
- this.#bodyStream.on("end", () => {
- this.#closeBodyStream();
- });
+ });
} else {
// this.#bodyStream.read(size);
}
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index c0740b735..e0b8a5376 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -115,12 +115,12 @@ const Blob = @import("../blob.zig");
pub const Buffer = MarkedArrayBuffer;
const Lock = @import("../lock.zig").Lock;
-pub const OpaqueCallback = fn (current: ?*anyopaque) callconv(.C) void;
+pub const OpaqueCallback = *const fn (current: ?*anyopaque) callconv(.C) void;
pub fn OpaqueWrap(comptime Context: type, comptime Function: fn (this: *Context) void) OpaqueCallback {
return struct {
pub fn callback(ctx: ?*anyopaque) callconv(.C) void {
var context: *Context = @ptrCast(*Context, @alignCast(@alignOf(Context), ctx.?));
- @call(.{}, Function, .{context});
+ @call(.auto, Function, .{context});
}
}.callback;
}
@@ -246,15 +246,16 @@ pub const SavedSourceMap = struct {
const uws = @import("bun").uws;
pub export fn Bun__getDefaultGlobal() *JSGlobalObject {
- return JSC.VirtualMachine.vm.global;
+ _ = @sizeOf(JSC.VirtualMachine) + 1;
+ return JSC.VirtualMachine.get().global;
}
pub export fn Bun__getVM() *JSC.VirtualMachine {
- return JSC.VirtualMachine.vm;
+ return JSC.VirtualMachine.get();
}
pub export fn Bun__drainMicrotasks() void {
- JSC.VirtualMachine.vm.eventLoop().tick();
+ JSC.VirtualMachine.get().eventLoop().tick();
}
export fn Bun__readOriginTimer(vm: *JSC.VirtualMachine) u64 {
@@ -263,25 +264,23 @@ export fn Bun__readOriginTimer(vm: *JSC.VirtualMachine) u64 {
export fn Bun__readOriginTimerStart(vm: *JSC.VirtualMachine) f64 {
// timespce to milliseconds
- // use f128 to reduce precision loss when converting to f64
- return @floatCast(f64, (@intToFloat(f128, vm.origin_timestamp) + JSC.VirtualMachine.origin_relative_epoch) / 1_000_000.0);
+ return @floatCast(f64, (@intToFloat(f64, vm.origin_timestamp) + JSC.VirtualMachine.origin_relative_epoch) / 1_000_000.0);
}
-comptime {
- if (!JSC.is_bindgen) {
- _ = Bun__getDefaultGlobal;
- _ = Bun__getVM;
- _ = Bun__drainMicrotasks;
- _ = Bun__queueTask;
- _ = Bun__queueTaskConcurrently;
- _ = Bun__handleRejectedPromise;
- _ = Bun__readOriginTimer;
- _ = Bun__onDidAppendPlugin;
- _ = Bun__readOriginTimerStart;
- _ = Bun__reportUnhandledError;
- _ = Bun__queueTaskWithTimeout;
- }
-}
+// comptime {
+// if (!JSC.is_bindgen) {
+// _ = Bun__getDefaultGlobal;
+// _ = Bun__getVM;
+// _ = Bun__drainMicrotasks;
+// _ = Bun__queueTask;
+// _ = Bun__queueTaskConcurrently;
+// _ = Bun__handleRejectedPromise;
+// _ = Bun__readOriginTimer;
+// _ = Bun__onDidAppendPlugin;
+// _ = Bun__readOriginTimerStart;
+// _ = Bun__reportUnhandledError;
+// }
+// }
/// This function is called on the main thread
/// The bunVM() call will assert this
@@ -430,7 +429,7 @@ pub const VirtualMachine = struct {
auto_install_dependencies: bool = false,
load_builtins_from_path: []const u8 = "",
- onUnhandledRejection: fn (*VirtualMachine, globalObject: *JSC.JSGlobalObject, JSC.JSValue) void = defaultOnUnhandledRejection,
+ onUnhandledRejection: *const fn (*VirtualMachine, globalObject: *JSC.JSGlobalObject, JSC.JSValue) void = defaultOnUnhandledRejection,
onUnhandledRejectionCtx: ?*anyopaque = null,
unhandled_error_counter: usize = 0,
@@ -439,6 +438,14 @@ pub const VirtualMachine = struct {
gc_controller: JSC.GarbageCollectionController = .{},
+ const VMHolder = struct {
+ pub threadlocal var vm: ?*VirtualMachine = null;
+ };
+
+ pub inline fn get() *VirtualMachine {
+ return VMHolder.vm.?;
+ }
+
pub const GCLevel = enum(u3) {
none = 0,
mild = 1,
@@ -574,15 +581,6 @@ pub const VirtualMachine = struct {
pub const MacroMap = std.AutoArrayHashMap(i32, js.JSObjectRef);
- /// Threadlocals are slow on macOS
- pub threadlocal var vm_loaded = false;
-
- /// Threadlocals are slow on macOS
- /// Consider using `globalThis.bunVM()` instead.
- /// There may be a time where we run multiple VMs in the same thread
- /// At that point, this threadlocal will be a problem.
- pub threadlocal var vm: *VirtualMachine = undefined;
-
pub fn enableMacroMode(this: *VirtualMachine) void {
if (!this.has_enabled_macro_mode) {
this.has_enabled_macro_mode = true;
@@ -621,16 +619,16 @@ pub const VirtualMachine = struct {
pub fn getAPIConstructors(globalObject: *JSGlobalObject) []const JSC.JSValue {
if (is_bindgen)
return &[_]JSC.JSValue{};
- const is_first = !VirtualMachine.vm.has_loaded_constructors;
+ const is_first = !VirtualMachine.get().has_loaded_constructors;
if (is_first) {
- VirtualMachine.vm.global = globalObject;
- VirtualMachine.vm.has_loaded_constructors = true;
+ VirtualMachine.get().global = globalObject;
+ VirtualMachine.get().has_loaded_constructors = true;
}
var slice = if (is_first)
- @as([]JSC.JSValue, &JSC.VirtualMachine.vm.global_api_constructors)
+ @as([]JSC.JSValue, &JSC.VirtualMachine.get().global_api_constructors)
else
- VirtualMachine.vm.allocator.alloc(JSC.JSValue, GlobalConstructors.len) catch unreachable;
+ VirtualMachine.get().allocator.alloc(JSC.JSValue, GlobalConstructors.len) catch unreachable;
inline for (GlobalConstructors) |Class, i| {
var ref = Class.constructor(globalObject.ref()).?;
@@ -656,7 +654,7 @@ pub const VirtualMachine = struct {
@intCast(
u128,
// handle if they set their system clock to be before epoch
- @maximum(
+ @max(
std.time.nanoTimestamp(),
origin_relative_epoch,
),
@@ -664,6 +662,10 @@ pub const VirtualMachine = struct {
);
}
+ pub inline fn isLoaded() bool {
+ return VMHolder.vm != null;
+ }
+
pub fn init(
allocator: std.mem.Allocator,
_args: Api.TransformOptions,
@@ -679,7 +681,7 @@ pub const VirtualMachine = struct {
log.* = logger.Log.init(allocator);
}
- VirtualMachine.vm = try allocator.create(VirtualMachine);
+ VMHolder.vm = try allocator.create(VirtualMachine);
var console = try allocator.create(ZigConsoleClient);
console.* = ZigConsoleClient.init(Output.errorWriter(), Output.writer());
const bundler = try Bundler.init(
@@ -690,7 +692,9 @@ pub const VirtualMachine = struct {
env_loader,
);
- VirtualMachine.vm.* = VirtualMachine{
+ var vm = VMHolder.vm.?;
+
+ vm.* = VirtualMachine{
.global = undefined,
.allocator = allocator,
.entry_point = ServerEntryPoint{},
@@ -705,49 +709,48 @@ pub const VirtualMachine = struct {
.saved_source_map_table = SavedSourceMap.HashTable.init(allocator),
.source_mappings = undefined,
.macros = MacroMap.init(allocator),
- .macro_entry_points = @TypeOf(VirtualMachine.vm.macro_entry_points).init(allocator),
+ .macro_entry_points = @TypeOf(vm.macro_entry_points).init(allocator),
.origin_timer = std.time.Timer.start() catch @panic("Please don't mess with timers."),
.origin_timestamp = getOriginTimestamp(),
.ref_strings = JSC.RefString.Map.init(allocator),
.file_blobs = JSC.WebCore.Blob.Store.Map.init(allocator),
};
- VirtualMachine.vm.source_mappings = .{ .map = &VirtualMachine.vm.saved_source_map_table };
- VirtualMachine.vm.regular_event_loop.tasks = EventLoop.Queue.init(
+ vm.source_mappings = .{ .map = &vm.saved_source_map_table };
+ vm.regular_event_loop.tasks = EventLoop.Queue.init(
default_allocator,
);
- VirtualMachine.vm.regular_event_loop.tasks.ensureUnusedCapacity(64) catch unreachable;
- VirtualMachine.vm.regular_event_loop.concurrent_tasks = .{};
- VirtualMachine.vm.event_loop = &VirtualMachine.vm.regular_event_loop;
+ vm.regular_event_loop.tasks.ensureUnusedCapacity(64) catch unreachable;
+ vm.regular_event_loop.concurrent_tasks = .{};
+ vm.event_loop = &vm.regular_event_loop;
vm.bundler.macro_context = null;
- VirtualMachine.vm.bundler.resolver.onWakePackageManager = .{
- .context = &VirtualMachine.vm.modules,
+ vm.bundler.resolver.onWakePackageManager = .{
+ .context = &vm.modules,
.handler = ModuleLoader.AsyncModule.Queue.onWakeHandler,
.onDependencyError = JSC.ModuleLoader.AsyncModule.Queue.onDependencyError,
};
- VirtualMachine.vm.bundler.configureLinker();
- try VirtualMachine.vm.bundler.configureFramework(false);
+ vm.bundler.configureLinker();
+ try vm.bundler.configureFramework(false);
vm.bundler.macro_context = js_ast.Macro.MacroContext.init(&vm.bundler);
if (_args.serve orelse false) {
- VirtualMachine.vm.bundler.linker.onImportCSS = Bun.onImportCSS;
+ vm.bundler.linker.onImportCSS = Bun.onImportCSS;
}
var global_classes: [GlobalClasses.len]js.JSClassRef = undefined;
inline for (GlobalClasses) |Class, i| {
global_classes[i] = Class.get().*;
}
- VirtualMachine.vm.global = ZigGlobalObject.create(
+ vm.global = ZigGlobalObject.create(
&global_classes,
@intCast(i32, global_classes.len),
vm.console,
);
- VirtualMachine.vm.regular_event_loop.global = VirtualMachine.vm.global;
- VirtualMachine.vm.regular_event_loop.virtual_machine = VirtualMachine.vm;
- VirtualMachine.vm_loaded = true;
+ vm.regular_event_loop.global = vm.global;
+ vm.regular_event_loop.virtual_machine = vm;
if (source_code_printer == null) {
var writer = try js_printer.BufferWriter.init(allocator);
@@ -756,7 +759,7 @@ pub const VirtualMachine = struct {
source_code_printer.?.ctx.append_null_byte = false;
}
- return VirtualMachine.vm;
+ return vm;
}
// dynamic import
@@ -767,7 +770,7 @@ pub const VirtualMachine = struct {
pub threadlocal var source_code_printer: ?*js_printer.BufferPrinter = null;
pub fn clearRefString(_: *anyopaque, ref_string: *JSC.RefString) void {
- _ = VirtualMachine.vm.ref_strings.remove(ref_string.hash);
+ _ = VirtualMachine.get().ref_strings.remove(ref_string.hash);
}
pub fn refCountedResolvedSource(this: *VirtualMachine, code: []const u8, specifier: []const u8, source_url: []const u8, hash_: ?u32) ResolvedSource {
@@ -836,7 +839,7 @@ pub const VirtualMachine = struct {
ret: *ErrorableResolvedSource,
comptime flags: FetchFlags,
) !ResolvedSource {
- std.debug.assert(VirtualMachine.vm_loaded);
+ std.debug.assert(VirtualMachine.isLoaded());
if (try ModuleLoader.fetchBuiltinModule(jsc_vm, _specifier, log, comptime flags.disableTranspiling())) |builtin| {
return builtin;
@@ -881,11 +884,11 @@ pub const VirtualMachine = struct {
comptime is_a_file_path: bool,
comptime realpath: bool,
) !void {
- std.debug.assert(VirtualMachine.vm_loaded);
+ std.debug.assert(VirtualMachine.isLoaded());
// macOS threadlocal vars are very slow
// we won't change threads in this function
// so we can copy it here
- var jsc_vm = vm;
+ var jsc_vm = VirtualMachine.get();
if (jsc_vm.node_modules == null and strings.eqlComptime(std.fs.path.basename(specifier), Runtime.Runtime.Imports.alt_name)) {
ret.path = Runtime.Runtime.Imports.Name;
@@ -989,7 +992,7 @@ pub const VirtualMachine = struct {
microtask: *Microtask,
) void {
if (comptime Environment.allow_assert)
- std.debug.assert(VirtualMachine.vm_loaded);
+ std.debug.assert(VirtualMachine.isLoaded());
var vm_ = globalObject.bunVM();
if (vm_.global == globalObject) {
@@ -1013,7 +1016,7 @@ pub const VirtualMachine = struct {
pub fn resolveMaybeNeedsTrailingSlash(res: *ErrorableZigString, global: *JSGlobalObject, specifier: ZigString, source: ZigString, comptime is_a_file_path: bool, comptime realpath: bool) void {
var result = ResolveFunctionResult{ .path = "", .result = null };
- var jsc_vm = vm;
+ var jsc_vm = VirtualMachine.get();
if (jsc_vm.plugin_runner) |plugin_runner| {
if (PluginRunner.couldBePlugin(specifier.slice())) {
const namespace = PluginRunner.extractNamespace(specifier.slice());
@@ -1076,7 +1079,7 @@ pub const VirtualMachine = struct {
};
{
- res.* = ErrorableZigString.err(err, @ptrCast(*anyopaque, ResolveError.create(global, vm.allocator, msg, source.slice())));
+ res.* = ErrorableZigString.err(err, @ptrCast(*anyopaque, ResolveError.create(global, VirtualMachine.get().allocator, msg, source.slice())));
}
return;
@@ -1088,8 +1091,8 @@ pub const VirtualMachine = struct {
// // This double prints
// pub fn promiseRejectionTracker(global: *JSGlobalObject, promise: *JSPromise, _: JSPromiseRejectionOperation) callconv(.C) JSValue {
// const result = promise.result(global.vm());
- // if (@enumToInt(VirtualMachine.vm.last_error_jsvalue) != @enumToInt(result)) {
- // VirtualMachine.vm.runErrorHandler(result, null);
+ // if (@enumToInt(VirtualMachine.get().last_error_jsvalue) != @enumToInt(result)) {
+ // VirtualMachine.get().runErrorHandler(result, null);
// }
// return JSValue.jsUndefined();
@@ -1099,18 +1102,18 @@ pub const VirtualMachine = struct {
pub fn fetch(ret: *ErrorableResolvedSource, global: *JSGlobalObject, specifier: ZigString, source: ZigString) callconv(.C) void {
var jsc_vm: *VirtualMachine = if (comptime Environment.isLinux)
- vm
+ VirtualMachine.get()
else
global.bunVM();
- var log = logger.Log.init(vm.bundler.allocator);
+ var log = logger.Log.init(jsc_vm.bundler.allocator);
var spec = specifier.toSlice(jsc_vm.allocator);
defer spec.deinit();
var refer = source.toSlice(jsc_vm.allocator);
defer refer.deinit();
const result = if (!jsc_vm.bundler.options.disable_transpilation)
- @call(.{ .modifier = .always_inline }, fetchWithoutOnLoadPlugins, .{ jsc_vm, global, spec.slice(), refer.slice(), &log, ret, .transpile }) catch |err| {
+ @call(.always_inline, fetchWithoutOnLoadPlugins, .{ jsc_vm, global, spec.slice(), refer.slice(), &log, ret, .transpile }) catch |err| {
processFetchLog(global, specifier, source, &log, ret, err);
return;
}
@@ -1143,11 +1146,12 @@ pub const VirtualMachine = struct {
}
ret.result.value = result;
+ var vm = get();
if (vm.blobs) |blobs| {
const specifier_blob = brk: {
- if (strings.hasPrefix(spec.slice(), VirtualMachine.vm.bundler.fs.top_level_dir)) {
- break :brk spec.slice()[VirtualMachine.vm.bundler.fs.top_level_dir.len..];
+ if (strings.hasPrefix(spec.slice(), VirtualMachine.get().bundler.fs.top_level_dir)) {
+ break :brk spec.slice()[VirtualMachine.get().bundler.fs.top_level_dir.len..];
}
break :brk spec.slice();
};
@@ -1171,17 +1175,17 @@ pub const VirtualMachine = struct {
.data = logger.rangeData(
null,
logger.Range.None,
- std.fmt.allocPrint(vm.allocator, "Unexpected pending import in \"{s}\". To automatically install npm packages with Bun, please use an import statement instead of require() or dynamic import().\nThis error can also happen if dependencies import packages which are not referenced anywhere. Worst case, run `bun install` and opt-out of the node_modules folder until we come up with a better way to handle this error.", .{specifier.slice()}) catch unreachable,
+ std.fmt.allocPrint(globalThis.allocator(), "Unexpected pending import in \"{s}\". To automatically install npm packages with Bun, please use an import statement instead of require() or dynamic import().\nThis error can also happen if dependencies import packages which are not referenced anywhere. Worst case, run `bun install` and opt-out of the node_modules folder until we come up with a better way to handle this error.", .{specifier.slice()}) catch unreachable,
),
};
}
break :brk logger.Msg{
- .data = logger.rangeData(null, logger.Range.None, std.fmt.allocPrint(vm.allocator, "{s} while building {s}", .{ @errorName(err), specifier.slice() }) catch unreachable),
+ .data = logger.rangeData(null, logger.Range.None, std.fmt.allocPrint(globalThis.allocator(), "{s} while building {s}", .{ @errorName(err), specifier.slice() }) catch unreachable),
};
};
{
- ret.* = ErrorableResolvedSource.err(err, @ptrCast(*anyopaque, BuildError.create(globalThis, vm.bundler.allocator, msg)));
+ ret.* = ErrorableResolvedSource.err(err, @ptrCast(*anyopaque, BuildError.create(globalThis, globalThis.allocator(), msg)));
}
return;
},
@@ -1189,10 +1193,10 @@ pub const VirtualMachine = struct {
1 => {
const msg = log.msgs.items[0];
ret.* = ErrorableResolvedSource.err(err, switch (msg.metadata) {
- .build => BuildError.create(globalThis, vm.bundler.allocator, msg).?,
+ .build => BuildError.create(globalThis, globalThis.allocator(), msg).?,
.resolve => ResolveError.create(
globalThis,
- vm.bundler.allocator,
+ globalThis.allocator(),
msg,
referrer.slice(),
).?,
@@ -1202,14 +1206,14 @@ pub const VirtualMachine = struct {
else => {
var errors_stack: [256]*anyopaque = undefined;
- var errors = errors_stack[0..@minimum(log.msgs.items.len, errors_stack.len)];
+ var errors = errors_stack[0..@min(log.msgs.items.len, errors_stack.len)];
for (log.msgs.items) |msg, i| {
errors[i] = switch (msg.metadata) {
- .build => BuildError.create(globalThis, vm.bundler.allocator, msg).?,
+ .build => BuildError.create(globalThis, globalThis.allocator(), msg).?,
.resolve => ResolveError.create(
globalThis,
- vm.bundler.allocator,
+ globalThis.allocator(),
msg,
referrer.slice(),
).?,
@@ -1222,7 +1226,7 @@ pub const VirtualMachine = struct {
errors.ptr,
@intCast(u16, errors.len),
&ZigString.init(
- std.fmt.allocPrint(vm.bundler.allocator, "{d} errors building \"{s}\"", .{
+ std.fmt.allocPrint(globalThis.allocator(), "{d} errors building \"{s}\"", .{
errors.len,
specifier.slice(),
}) catch unreachable,
@@ -1378,7 +1382,7 @@ pub const VirtualMachine = struct {
path: string,
promise: *JSInternalPromise = undefined,
pub fn load(this: *MacroEntryPointLoader) void {
- this.promise = vm._loadMacroEntryPoint(this.path);
+ this.promise = VirtualMachine.get()._loadMacroEntryPoint(this.path);
}
};
@@ -1448,7 +1452,7 @@ pub const VirtualMachine = struct {
}
inline fn iterator(_: [*c]VM, _: [*c]JSGlobalObject, nextValue: JSValue, ctx: ?*anyopaque, comptime color: bool) void {
var this_ = @intToPtr(*@This(), @ptrToInt(ctx));
- VirtualMachine.vm.printErrorlikeObject(nextValue, null, this_.current_exception_list, Writer, this_.writer, color);
+ VirtualMachine.get().printErrorlikeObject(nextValue, null, this_.current_exception_list, Writer, this_.writer, color);
}
};
var iter = AggregateErrorIterator{ .writer = writer, .current_exception_list = exception_list };
@@ -1554,6 +1558,7 @@ pub const VirtualMachine = struct {
pub fn printStackTrace(comptime Writer: type, writer: Writer, trace: ZigStackTrace, comptime allow_ansi_colors: bool) !void {
const stack = trace.frames();
if (stack.len > 0) {
+ var vm = VirtualMachine.get();
var i: i16 = 0;
const origin: ?*const URL = if (vm.is_from_devserver) &vm.origin else null;
const dir = vm.bundler.fs.top_level_dir;
@@ -1616,8 +1621,8 @@ pub const VirtualMachine = struct {
if (frames[i].position.isInvalid()) continue;
if (this.source_mappings.resolveMapping(
frames[i].source_url.slice(),
- @maximum(frames[i].position.line, 0),
- @maximum(frames[i].position.column_start, 0),
+ @max(frames[i].position.line, 0),
+ @max(frames[i].position.column_start, 0),
)) |mapping| {
frames[i].position.line = mapping.original.lines;
frames[i].position.column_start = mapping.original.columns;
@@ -1674,8 +1679,8 @@ pub const VirtualMachine = struct {
var top = &frames[0];
if (this.source_mappings.resolveMapping(
top.source_url.slice(),
- @maximum(top.position.line, 0),
- @maximum(top.position.column_start, 0),
+ @max(top.position.line, 0),
+ @max(top.position.column_start, 0),
)) |mapping| {
var log = logger.Log.init(default_allocator);
var errorable: ErrorableResolvedSource = undefined;
@@ -1702,7 +1707,7 @@ pub const VirtualMachine = struct {
std.mem.set(ZigString, source_lines, ZigString.Empty);
std.mem.set(i32, source_line_numbers, 0);
- var lines_ = lines[0..@minimum(lines.len, source_lines.len)];
+ var lines_ = lines[0..@min(lines.len, source_lines.len)];
for (lines_) |line, j| {
source_lines[(lines_.len - 1) - j] = ZigString.init(line);
source_line_numbers[j] = top.position.line - @intCast(i32, j) + 1;
@@ -1724,8 +1729,8 @@ pub const VirtualMachine = struct {
if (frame.position.isInvalid()) continue;
if (this.source_mappings.resolveMapping(
frame.source_url.slice(),
- @maximum(frame.position.line, 0),
- @maximum(frame.position.column_start, 0),
+ @max(frame.position.line, 0),
+ @max(frame.position.column_start, 0),
)) |mapping| {
frame.position.line = mapping.original.lines;
frame.remapped = true;
@@ -1743,7 +1748,7 @@ pub const VirtualMachine = struct {
var line_numbers = exception.stack.source_lines_numbers[0..exception.stack.source_lines_len];
var max_line: i32 = -1;
- for (line_numbers) |line| max_line = @maximum(max_line, line);
+ for (line_numbers) |line| max_line = @max(max_line, line);
const max_line_number_pad = std.fmt.count("{d}", .{max_line});
var source_lines = exception.stack.sourceLineIterator();
@@ -1942,14 +1947,14 @@ pub const VirtualMachine = struct {
}
};
-const GetterFn = fn (
+const GetterFn = *const fn (
this: anytype,
ctx: js.JSContextRef,
thisObject: js.JSValueRef,
prop: js.JSStringRef,
exception: js.ExceptionRef,
) js.JSValueRef;
-const SetterFn = fn (
+const SetterFn = *const fn (
this: anytype,
ctx: js.JSContextRef,
thisObject: js.JSValueRef,
@@ -2071,10 +2076,10 @@ pub const EventListenerMixin = struct {
defer name_slice.deinit();
const name = name_slice.slice();
const event = EventType.match(name) orelse return js.JSValueMakeUndefined(ctx);
- var entry = VirtualMachine.vm.event_listeners.getOrPut(event) catch unreachable;
+ var entry = VirtualMachine.get().event_listeners.getOrPut(event) catch unreachable;
if (!entry.found_existing) {
- entry.value_ptr.* = List.initCapacity(VirtualMachine.vm.allocator, 1) catch unreachable;
+ entry.value_ptr.* = List.initCapacity(VirtualMachine.get().allocator, 1) catch unreachable;
}
var callback = arguments[arguments.len - 1];
@@ -2092,7 +2097,7 @@ pub const EventListenerMixin = struct {
.read_only = true,
},
.{
- .@"callAsFunction" = .{
+ .callAsFunction = .{
.rfn = Handler.addListener,
},
},
@@ -2177,35 +2182,35 @@ pub const ResolveError = struct {
},
.{
.toString = .{ .rfn = toString },
- .convertToType = .{ .rfn = convertToType },
+ .convertToType = .{ .rfn = &convertToType },
},
.{
- .@"referrer" = .{
- .@"get" = getReferrer,
+ .referrer = .{
+ .get = getReferrer,
.ro = true,
},
- .@"code" = .{
- .@"get" = getCode,
+ .code = .{
+ .get = getCode,
.ro = true,
},
- .@"message" = .{
- .@"get" = getMessage,
+ .message = .{
+ .get = getMessage,
.ro = true,
},
- .@"name" = .{
- .@"get" = getName,
+ .name = .{
+ .get = getName,
.ro = true,
},
- .@"specifier" = .{
- .@"get" = getSpecifier,
+ .specifier = .{
+ .get = getSpecifier,
.ro = true,
},
- .@"importKind" = .{
- .@"get" = getImportKind,
+ .importKind = .{
+ .get = getImportKind,
.ro = true,
},
- .@"position" = .{
- .@"get" = getPosition,
+ .position = .{
+ .get = getPosition,
.ro = true,
},
},
@@ -2325,17 +2330,17 @@ pub const BuildError = struct {
.toString = .{ .rfn = toString },
},
.{
- .@"message" = .{
- .@"get" = getMessage,
+ .message = .{
+ .get = getMessage,
.ro = true,
},
- .@"name" = .{
- .@"get" = getName,
+ .name = .{
+ .get = getName,
.ro = true,
},
// This is called "position" instead of "location" because "location" may be confused with Location.
- .@"position" = .{
- .@"get" = getPosition,
+ .position = .{
+ .get = getPosition,
.ro = true,
},
},
@@ -2534,7 +2539,7 @@ pub const HotReloader = struct {
javascript_callback: JSC.Strong,
zig_callback: struct {
ptr: *anyopaque,
- function: FunctionSignature,
+ function: *const FunctionSignature,
},
};
}
diff --git a/src/bun.js/javascript_core_c_api.zig b/src/bun.js/javascript_core_c_api.zig
index 13e96f22a..dd2efd014 100644
--- a/src/bun.js/javascript_core_c_api.zig
+++ b/src/bun.js/javascript_core_c_api.zig
@@ -3,7 +3,7 @@ const std = @import("std");
const cpp = @import("./bindings/bindings.zig");
const generic = opaque {
pub fn value(this: *const @This()) cpp.JSValue {
- return @bitCast(cpp.JSValue.Type, @ptrToInt(this));
+ return @intToEnum(cpp.JSValue, @bitCast(cpp.JSValue.Type, @ptrToInt(this)));
}
pub inline fn bunVM(this: *@This()) *@import("bun").JSC.VirtualMachine {
@@ -66,8 +66,8 @@ pub const OpaqueJSString = opaque {
if (zig_str.isUTF8()) {
return JSValueToStringCopy(
- bun.JSC.VirtualMachine.vm.global,
- zig_str.toValueGC(bun.JSC.VirtualMachine.vm.global).asObjectRef(),
+ bun.JSC.VirtualMachine.get().global,
+ zig_str.toValueGC(bun.JSC.VirtualMachine.get().global).asObjectRef(),
null,
);
}
@@ -98,7 +98,7 @@ pub const JSPropertyNameArray = opaque {
pub const JSPropertyNameArrayRef = ?*JSPropertyNameArray;
pub const struct_OpaqueJSPropertyNameAccumulator = generic;
pub const JSPropertyNameAccumulatorRef = ?*struct_OpaqueJSPropertyNameAccumulator;
-pub const JSTypedArrayBytesDeallocator = ?fn (*anyopaque, *anyopaque) callconv(.C) void;
+pub const JSTypedArrayBytesDeallocator = ?*const fn (*anyopaque, *anyopaque) callconv(.C) void;
pub const OpaqueJSValue = generic;
pub const JSValueRef = ?*OpaqueJSValue;
pub const JSObjectRef = ?*OpaqueJSValue;
@@ -218,15 +218,15 @@ pub const JSClassAttributes = enum(c_uint) {
pub const kJSClassAttributeNone = @enumToInt(JSClassAttributes.kJSClassAttributeNone);
pub const kJSClassAttributeNoAutomaticPrototype = @enumToInt(JSClassAttributes.kJSClassAttributeNoAutomaticPrototype);
-pub const JSObjectInitializeCallback = ?fn (JSContextRef, JSObjectRef) callconv(.C) void;
-pub const JSObjectFinalizeCallback = ?fn (JSObjectRef) callconv(.C) void;
-pub const JSObjectHasPropertyCallback = ?fn (JSContextRef, JSObjectRef, JSStringRef) callconv(.C) bool;
-pub const JSObjectGetPropertyCallback = ?fn (JSContextRef, JSObjectRef, JSStringRef, ExceptionRef) callconv(.C) JSValueRef;
-pub const JSObjectSetPropertyCallback = ?fn (JSContextRef, JSObjectRef, JSStringRef, JSValueRef, ExceptionRef) callconv(.C) bool;
-pub const JSObjectDeletePropertyCallback = ?fn (JSContextRef, JSObjectRef, JSStringRef, ExceptionRef) callconv(.C) bool;
-pub const JSObjectGetPropertyNamesCallback = ?fn (JSContextRef, JSObjectRef, JSPropertyNameAccumulatorRef) callconv(.C) void;
+pub const JSObjectInitializeCallback = *const fn (JSContextRef, JSObjectRef) callconv(.C) void;
+pub const JSObjectFinalizeCallback = *const fn (JSObjectRef) callconv(.C) void;
+pub const JSObjectHasPropertyCallback = *const fn (JSContextRef, JSObjectRef, JSStringRef) callconv(.C) bool;
+pub const JSObjectGetPropertyCallback = *const fn (JSContextRef, JSObjectRef, JSStringRef, ExceptionRef) callconv(.C) JSValueRef;
+pub const JSObjectSetPropertyCallback = *const fn (JSContextRef, JSObjectRef, JSStringRef, JSValueRef, ExceptionRef) callconv(.C) bool;
+pub const JSObjectDeletePropertyCallback = *const fn (JSContextRef, JSObjectRef, JSStringRef, ExceptionRef) callconv(.C) bool;
+pub const JSObjectGetPropertyNamesCallback = *const fn (JSContextRef, JSObjectRef, JSPropertyNameAccumulatorRef) callconv(.C) void;
pub const ExceptionRef = [*c]JSValueRef;
-pub const JSObjectCallAsFunctionCallback = ?fn (
+pub const JSObjectCallAsFunctionCallback = *const fn (
ctx: JSContextRef,
function: JSObjectRef,
thisObject: JSObjectRef,
@@ -234,38 +234,38 @@ pub const JSObjectCallAsFunctionCallback = ?fn (
arguments: [*c]const JSValueRef,
exception: ExceptionRef,
) callconv(.C) JSValueRef;
-pub const JSObjectCallAsConstructorCallback = ?fn (JSContextRef, JSObjectRef, usize, [*c]const JSValueRef, ExceptionRef) callconv(.C) JSObjectRef;
-pub const JSObjectHasInstanceCallback = ?fn (JSContextRef, JSObjectRef, JSValueRef, ExceptionRef) callconv(.C) bool;
-pub const JSObjectConvertToTypeCallback = ?fn (JSContextRef, JSObjectRef, JSType, ExceptionRef) callconv(.C) JSValueRef;
+pub const JSObjectCallAsConstructorCallback = *const fn (JSContextRef, JSObjectRef, usize, [*c]const JSValueRef, ExceptionRef) callconv(.C) JSObjectRef;
+pub const JSObjectHasInstanceCallback = *const fn (JSContextRef, JSObjectRef, JSValueRef, ExceptionRef) callconv(.C) bool;
+pub const JSObjectConvertToTypeCallback = *const fn (JSContextRef, JSObjectRef, JSType, ExceptionRef) callconv(.C) JSValueRef;
pub const JSStaticValue = extern struct {
- name: [*c]const u8,
- getProperty: JSObjectGetPropertyCallback,
- setProperty: JSObjectSetPropertyCallback,
- attributes: JSPropertyAttributes,
+ name: [*c]const u8 = null,
+ getProperty: ?JSObjectGetPropertyCallback = null,
+ setProperty: ?JSObjectSetPropertyCallback = null,
+ attributes: JSPropertyAttributes = .kJSPropertyAttributeNone,
};
pub const JSStaticFunction = extern struct {
- name: [*c]const u8,
- callAsFunction: JSObjectCallAsFunctionCallback,
- attributes: JSPropertyAttributes,
+ name: [*c]const u8 = null,
+ callAsFunction: ?JSObjectCallAsFunctionCallback = null,
+ attributes: JSPropertyAttributes = .kJSPropertyAttributeNone,
};
pub const JSClassDefinition = extern struct {
- version: c_int,
- attributes: JSClassAttributes,
- className: [*c]const u8,
- parentClass: JSClassRef,
- staticValues: [*c]const JSStaticValue,
- staticFunctions: [*c]const JSStaticFunction,
- initialize: JSObjectInitializeCallback,
- finalize: JSObjectFinalizeCallback,
- hasProperty: JSObjectHasPropertyCallback,
- getProperty: JSObjectGetPropertyCallback,
- setProperty: JSObjectSetPropertyCallback,
- deleteProperty: JSObjectDeletePropertyCallback,
- getPropertyNames: JSObjectGetPropertyNamesCallback,
- callAsFunction: JSObjectCallAsFunctionCallback,
- callAsConstructor: JSObjectCallAsConstructorCallback,
- hasInstance: JSObjectHasInstanceCallback,
- convertToType: JSObjectConvertToTypeCallback,
+ version: c_int = 0,
+ attributes: JSClassAttributes = .kJSClassAttributeNone,
+ className: [*:0]const u8 = "",
+ parentClass: JSClassRef = null,
+ staticValues: [*c]const JSStaticValue = null,
+ staticFunctions: [*c]const JSStaticFunction = null,
+ initialize: ?JSObjectInitializeCallback = null,
+ finalize: ?JSObjectFinalizeCallback = null,
+ hasProperty: ?JSObjectHasPropertyCallback = null,
+ getProperty: ?JSObjectGetPropertyCallback = null,
+ setProperty: ?JSObjectSetPropertyCallback = null,
+ deleteProperty: ?JSObjectDeletePropertyCallback = null,
+ getPropertyNames: ?JSObjectGetPropertyNamesCallback = null,
+ callAsFunction: ?JSObjectCallAsFunctionCallback = null,
+ callAsConstructor: ?JSObjectCallAsConstructorCallback = null,
+ hasInstance: ?JSObjectHasInstanceCallback = null,
+ convertToType: ?JSObjectConvertToTypeCallback = null,
};
pub extern const kJSClassDefinitionEmpty: JSClassDefinition;
pub extern "c" fn JSClassCreate(definition: [*c]const JSClassDefinition) JSClassRef;
@@ -486,7 +486,7 @@ pub const CellType = enum(u8) {
};
}
};
-pub const ExternalStringFinalizer = fn (finalize_ptr: ?*anyopaque, ref: JSStringRef, buffer: *anyopaque, byteLength: usize) callconv(.C) void;
+pub const ExternalStringFinalizer = *const fn (finalize_ptr: ?*anyopaque, ref: JSStringRef, buffer: *anyopaque, byteLength: usize) callconv(.C) void;
pub extern fn JSStringCreate(string: UTF8Ptr, length: usize) JSStringRef;
pub extern fn JSStringCreateStatic(string: UTF8Ptr, length: usize) JSStringRef;
pub extern fn JSStringCreateExternal(string: UTF8Ptr, length: usize, finalize_ptr: ?*anyopaque, finalizer: ExternalStringFinalizer) JSStringRef;
@@ -497,8 +497,8 @@ pub extern fn JSCellType(cell: JSCellValue) CellType;
pub extern fn JSStringIsStatic(ref: JSStringRef) bool;
pub extern fn JSStringIsExternal(ref: JSStringRef) bool;
-pub const JStringIteratorAppendCallback = fn (ctx: *JSStringIterator_, ptr: *anyopaque, length: u32) callconv(.C) anyopaque;
-pub const JStringIteratorWriteCallback = fn (ctx: *JSStringIterator_, ptr: *anyopaque, length: u32, offset: u32) callconv(.C) anyopaque;
+pub const JStringIteratorAppendCallback = *const fn (ctx: *JSStringIterator_, ptr: *anyopaque, length: u32) callconv(.C) anyopaque;
+pub const JStringIteratorWriteCallback = *const fn (ctx: *JSStringIterator_, ptr: *anyopaque, length: u32, offset: u32) callconv(.C) anyopaque;
const JSStringIterator_ = extern struct {
ctx: *anyopaque,
stop: u8,
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index 85db973ce..f9379e107 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -88,12 +88,11 @@ const PackageManager = @import("../install/install.zig").PackageManager;
const Install = @import("../install/install.zig");
const VirtualMachine = JSC.VirtualMachine;
const Dependency = @import("../install/dependency.zig");
-
// This exists to make it so we can reload these quicker in development
fn jsModuleFromFile(from_path: string, comptime input: string) string {
- const absolute_path = comptime std.fs.path.dirname(@src().file).? ++ "/" ++ input;
+ const absolute_path = comptime (bun.Environment.base_path ++ std.fs.path.dirname(@src().file).?) ++ "/" ++ input;
const Holder = struct {
- pub const file = @embedFile(absolute_path);
+ pub const file = @embedFile(input);
};
if (comptime !Environment.allow_assert) {
@@ -152,18 +151,18 @@ inline fn jsSyntheticModule(comptime name: ResolvedSource.Tag) ResolvedSource {
fn dumpSource(specifier: string, printer: anytype) !void {
const BunDebugHolder = struct {
- pub var dir: ?std.fs.Dir = null;
+ pub var dir: ?std.fs.IterableDir = null;
};
if (BunDebugHolder.dir == null) {
- BunDebugHolder.dir = try std.fs.cwd().makeOpenPath("/tmp/bun-debug-src/", .{ .iterate = true });
+ BunDebugHolder.dir = try std.fs.cwd().makeOpenPathIterable("/tmp/bun-debug-src/", .{});
}
if (std.fs.path.dirname(specifier)) |dir_path| {
- var parent = try BunDebugHolder.dir.?.makeOpenPath(dir_path[1..], .{ .iterate = true });
+ var parent = try BunDebugHolder.dir.?.dir.makeOpenPathIterable(dir_path[1..], .{});
defer parent.close();
- try parent.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
+ try parent.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
} else {
- try BunDebugHolder.dir.?.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
+ try BunDebugHolder.dir.?.dir.writeFile(std.fs.path.basename(specifier), printer.ctx.getWritten());
}
}
@@ -772,7 +771,7 @@ pub const ModuleLoader = struct {
debug("resumeLoadingModule: {s}", .{this.specifier});
var parse_result = this.parse_result;
var path = this.path;
- var jsc_vm = JSC.VirtualMachine.vm;
+ var jsc_vm = JSC.VirtualMachine.get();
var specifier = this.specifier;
var old_log = jsc_vm.log;
@@ -1451,7 +1450,7 @@ pub const ModuleLoader = struct {
const after_namespace = if (namespace.len == 0)
specifier
else
- specifier[@minimum(namespace.len + 1, specifier.len)..];
+ specifier[@min(namespace.len + 1, specifier.len)..];
return globalObject.runOnLoadPlugins(ZigString.init(namespace), ZigString.init(after_namespace), .bun) orelse return JSValue.zero;
}
@@ -1755,7 +1754,7 @@ pub const ModuleLoader = struct {
.hash = 0,
};
},
- .@"ws" => {
+ .ws => {
return ResolvedSource{
.allocator = null,
.source_code = ZigString.init(
@@ -1821,7 +1820,7 @@ pub const ModuleLoader = struct {
.hash = 0,
};
},
- .@"undici" => {
+ .undici => {
return ResolvedSource{
.allocator = null,
.source_code = ZigString.init(
@@ -1854,7 +1853,7 @@ pub const ModuleLoader = struct {
.hash = 0,
};
},
- .@"depd" => {
+ .depd => {
return ResolvedSource{
.allocator = null,
.source_code = ZigString.init(
@@ -1970,7 +1969,7 @@ pub const HardcodedModule = enum {
@"bun:jsc",
@"bun:main",
@"bun:sqlite",
- @"depd",
+ depd,
@"detect-libc",
@"node:assert",
@"node:buffer",
@@ -1998,8 +1997,8 @@ pub const HardcodedModule = enum {
@"node:url",
@"node:util",
@"node:util/types",
- @"undici",
- @"ws",
+ undici,
+ ws,
/// Already resolved modules go in here.
/// This does not remap the module name, it is just a hash table.
/// Do not put modules that have aliases in here
@@ -2012,7 +2011,7 @@ pub const HardcodedModule = enum {
.{ "bun:jsc", HardcodedModule.@"bun:jsc" },
.{ "bun:main", HardcodedModule.@"bun:main" },
.{ "bun:sqlite", HardcodedModule.@"bun:sqlite" },
- .{ "depd", HardcodedModule.@"depd" },
+ .{ "depd", HardcodedModule.depd },
.{ "detect-libc", HardcodedModule.@"detect-libc" },
.{ "node:assert", HardcodedModule.@"node:assert" },
.{ "node:buffer", HardcodedModule.@"node:buffer" },
@@ -2040,8 +2039,8 @@ pub const HardcodedModule = enum {
.{ "node:url", HardcodedModule.@"node:url" },
.{ "node:util", HardcodedModule.@"node:util" },
.{ "node:util/types", HardcodedModule.@"node:util/types" },
- .{ "undici", HardcodedModule.@"undici" },
- .{ "ws", HardcodedModule.@"ws" },
+ .{ "undici", HardcodedModule.undici },
+ .{ "ws", HardcodedModule.ws },
},
);
pub const Aliases = bun.ComptimeStringMap(
diff --git a/src/bun.js/node/buffer.zig b/src/bun.js/node/buffer.zig
index b796109e3..5637e45b6 100644
--- a/src/bun.js/node/buffer.zig
+++ b/src/bun.js/node/buffer.zig
@@ -77,7 +77,7 @@ pub const BufferVectorized = struct {
const minimum_contents = contents;
while (buf.len >= contents.len) {
- const min_len = @minimum(contents.len, buf.len);
+ const min_len = @min(contents.len, buf.len);
std.mem.copy(u8, buf[0..min_len], contents[0..min_len]);
if (buf.len <= contents.len) {
break;
@@ -87,7 +87,7 @@ pub const BufferVectorized = struct {
}
while (buf.len > 0) {
- const to_fill = @minimum(minimum_contents.len, buf.len);
+ const to_fill = @min(minimum_contents.len, buf.len);
std.mem.copy(u8, buf[0..to_fill], minimum_contents[0..to_fill]);
buf = buf[to_fill..];
}
diff --git a/src/bun.js/node/dir_iterator.zig b/src/bun.js/node/dir_iterator.zig
index c309e0d67..7db7facc7 100644
--- a/src/bun.js/node/dir_iterator.zig
+++ b/src/bun.js/node/dir_iterator.zig
@@ -1,4 +1,4 @@
-// This is copied from std.fs.Dir.Iterator
+// This is copied from std.fs.IterableDir.Iterator
// The differences are:
// - it returns errors in the expected format
// - doesn't mark BADF as unreachable
@@ -19,7 +19,7 @@ const Maybe = JSC.Maybe;
const File = std.fs.File;
const Result = Maybe(?Entry);
-const Entry = JSC.Node.DirEnt;
+const Entry = JSC.Node.Dirent;
pub const Iterator = switch (builtin.os.tag) {
.macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => struct {
diff --git a/src/bun.js/node/node.classes.ts b/src/bun.js/node/node.classes.ts
new file mode 100644
index 000000000..355b5847e
--- /dev/null
+++ b/src/bun.js/node/node.classes.ts
@@ -0,0 +1,156 @@
+import { define } from "../scripts/class-definitions";
+
+export default [
+ define({
+ name: "Dirent",
+ construct: true,
+ finalize: true,
+
+ klass: {},
+
+ proto: {
+ isBlockDevice: {
+ fn: "isBlockDevice",
+ length: 0,
+ },
+ isCharacterDevice: {
+ fn: "isCharacterDevice",
+ length: 0,
+ },
+ isDirectory: {
+ fn: "isDirectory",
+ length: 0,
+ },
+ isFIFO: {
+ fn: "isFIFO",
+ length: 0,
+ },
+ isFile: {
+ fn: "isFile",
+ length: 0,
+ },
+ isSocket: {
+ fn: "isSocket",
+ length: 0,
+ },
+ isSymbolicLink: {
+ fn: "isSymbolicLink",
+ length: 0,
+ },
+ name: {
+ getter: "getName",
+ cache: true,
+ },
+ },
+ }),
+ define({
+ name: "NodeJSFS",
+ construct: true,
+ finalize: false,
+
+ klass: {},
+ proto: {
+ appendFile: { fn: "appendFile", length: 4 },
+ appendFileSync: { fn: "appendFileSync", length: 3 },
+ access: { fn: "access", length: 3 },
+ accessSync: { fn: "accessSync", length: 2 },
+ chown: { fn: "chown", length: 4 },
+ chownSync: { fn: "chownSync", length: 3 },
+ chmod: { fn: "chmod", length: 3 },
+ chmodSync: { fn: "chmodSync", length: 2 },
+ close: { fn: "close", length: 1 },
+ closeSync: { fn: "closeSync", length: 1 },
+ copyFile: { fn: "copyFile", length: 4 },
+ copyFileSync: { fn: "copyFileSync", length: 3 },
+
+ // TODO:
+ // cp: { fn: "cp", length: 4 },
+ // cpSync: { fn: "cpSync", length: 3 },
+
+ exists: { fn: "exists", length: 2 },
+ existsSync: { fn: "existsSync", length: 1 },
+ fchown: { fn: "fchown", length: 4 },
+ fchownSync: { fn: "fchownSync", length: 3 },
+ fchmod: { fn: "fchmod", length: 3 },
+ fchmodSync: { fn: "fchmodSync", length: 2 },
+ fdatasync: { fn: "fdatasync", length: 2 },
+ fdatasyncSync: { fn: "fdatasyncSync", length: 1 },
+ fstat: { fn: "fstat", length: 1 },
+ fstatSync: { fn: "fstatSync", length: 1 },
+ fsync: { fn: "fsync", length: 2 },
+ fsyncSync: { fn: "fsyncSync", length: 1 },
+ ftruncate: { fn: "ftruncate", length: 1 },
+ ftruncateSync: { fn: "ftruncateSync", length: 1 },
+ futimes: { fn: "futimes", length: 4 },
+ futimesSync: { fn: "futimesSync", length: 3 },
+ lchown: { fn: "lchown", length: 4 },
+ lchownSync: { fn: "lchownSync", length: 3 },
+ lchmod: { fn: "lchmod", length: 3 },
+ lchmodSync: { fn: "lchmodSync", length: 2 },
+ link: { fn: "link", length: 3 },
+ linkSync: { fn: "linkSync", length: 2 },
+ lstat: { fn: "lstat", length: 1 },
+ lstatSync: { fn: "lstatSync", length: 1 },
+ lutimes: { fn: "lutimes", length: 4 },
+ lutimesSync: { fn: "lutimesSync", length: 3 },
+ mkdir: { fn: "mkdir", length: 3 },
+ mkdirSync: { fn: "mkdirSync", length: 2 },
+ mkdtemp: { fn: "mkdtemp", length: 3 },
+ mkdtempSync: { fn: "mkdtempSync", length: 2 },
+ open: { fn: "open", length: 4 },
+ openSync: { fn: "openSync", length: 3 },
+ opendir: { fn: "opendir", length: 3 },
+ opendirSync: { fn: "opendirSync", length: 2 },
+ readdir: { fn: "readdir", length: 3 },
+ readdirSync: { fn: "readdirSync", length: 2 },
+ read: { fn: "read", length: 6 },
+ readSync: { fn: "readSync", length: 5 },
+ readv: { fn: "readv", length: 4 },
+ readvSync: { fn: "readvSync", length: 3 },
+ readFile: { fn: "readFile", length: 3 },
+ readFileSync: { fn: "readFileSync", length: 2 },
+ readlink: { fn: "readlink", length: 3 },
+ readlinkSync: { fn: "readlinkSync", length: 2 },
+ realpath: { fn: "realpath", length: 3 },
+ realpathSync: { fn: "realpathSync", length: 2 },
+ rename: { fn: "rename", length: 3 },
+ renameSync: { fn: "renameSync", length: 2 },
+ rm: { fn: "rm", length: 3 },
+ rmSync: { fn: "rmSync", length: 2 },
+ rmdir: { fn: "rmdir", length: 3 },
+ rmdirSync: { fn: "rmdirSync", length: 2 },
+ stat: { fn: "stat", length: 1 },
+ statSync: { fn: "statSync", length: 1 },
+ symlink: { fn: "symlink", length: 4 },
+ symlinkSync: { fn: "symlinkSync", length: 3 },
+ truncate: { fn: "truncate", length: 3 },
+ truncateSync: { fn: "truncateSync", length: 2 },
+ // TODO:
+ // unwatchFile: { fn: "unwatchFile", length: 2 },
+ unlink: { fn: "unlink", length: 2 },
+ unlinkSync: { fn: "unlinkSync", length: 1 },
+ utimes: { fn: "utimes", length: 4 },
+ utimesSync: { fn: "utimesSync", length: 3 },
+ // TODO:
+ // watch: { fn: "watch", length: 3 },
+ // watchFile: { fn: "watchFile", length: 3 },
+ writeFile: { fn: "writeFile", length: 4 },
+ writeFileSync: { fn: "writeFileSync", length: 3 },
+ write: { fn: "write", length: 6 },
+ writeSync: { fn: "writeSync", length: 5 },
+ writev: { fn: "writev", length: 4 },
+ writevSync: { fn: "writevSync", length: 3 },
+ // TODO:
+ // Dir: { fn: 'Dir', length: 3 },
+ Dirent: { getter: "getDirent" },
+ // Stats: { fn: 'Stats', length: 14 },
+ // ReadStream: { fn: 'ReadStream', length: 2 },
+ // WriteStream: { fn: 'WriteStream', length: 2 },
+ // FileReadStream: { fn: 'FileReadStream', length: 2 },
+ // FileWriteStream: { fn: 'FileWriteStream', length: 2 },
+ // _toUnixTimestamp: { fn: '_toUnixTimestamp', length: 1 }
+ // createReadStream: { fn: "createReadStream", length: 2 },
+ // createWriteStream: { fn: "createWriteStream", length: 2 },
+ },
+ }),
+];
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig
index 75b50efed..5f36532ca 100644
--- a/src/bun.js/node/node_fs.zig
+++ b/src/bun.js/node/node_fs.zig
@@ -40,7 +40,7 @@ const ReadPosition = u63;
const Stats = JSC.Node.Stats;
const BigIntStats = JSC.Node.BigIntStats;
-const DirEnt = JSC.Node.DirEnt;
+const Dirent = JSC.Node.Dirent;
pub const FlavoredIO = struct {
io: *AsyncIO,
@@ -993,7 +993,7 @@ const Arguments = struct {
pub const Open = struct {
path: PathLike,
- flags: FileSystemFlags = FileSystemFlags.@"r",
+ flags: FileSystemFlags = FileSystemFlags.r,
mode: Mode = default_permission,
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Open {
@@ -1011,7 +1011,7 @@ const Arguments = struct {
if (exception.* != null) return null;
- var flags = FileSystemFlags.@"r";
+ var flags = FileSystemFlags.r;
var mode: Mode = default_permission;
if (arguments.next()) |val| {
@@ -1445,7 +1445,7 @@ const Arguments = struct {
path: PathOrFileDescriptor,
encoding: Encoding = Encoding.utf8,
- flag: FileSystemFlags = FileSystemFlags.@"r",
+ flag: FileSystemFlags = FileSystemFlags.r,
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?ReadFile {
const path = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse {
@@ -1463,7 +1463,7 @@ const Arguments = struct {
if (exception.* != null) return null;
var encoding = Encoding.buffer;
- var flag = FileSystemFlags.@"r";
+ var flag = FileSystemFlags.r;
if (arguments.next()) |arg| {
arguments.eat();
@@ -1523,8 +1523,8 @@ const Arguments = struct {
pub const WriteFile = struct {
encoding: Encoding = Encoding.utf8,
- flag: FileSystemFlags = FileSystemFlags.@"w",
- mode: Mode = 0666,
+ flag: FileSystemFlags = FileSystemFlags.w,
+ mode: Mode = 0o666,
file: PathOrFileDescriptor,
data: StringOrBuffer,
@@ -1569,7 +1569,7 @@ const Arguments = struct {
arguments.eat();
var encoding = Encoding.buffer;
- var flag = FileSystemFlags.@"w";
+ var flag = FileSystemFlags.w;
var mode: Mode = default_permission;
if (arguments.next()) |arg| {
@@ -1752,7 +1752,7 @@ const Arguments = struct {
pub const Access = struct {
path: PathLike,
- mode: FileSystemFlags = FileSystemFlags.@"r",
+ mode: FileSystemFlags = FileSystemFlags.r,
pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Access {
const path = PathLike.fromJS(ctx, arguments, exception) orelse {
@@ -1769,7 +1769,7 @@ const Arguments = struct {
if (exception.* != null) return null;
- var mode = FileSystemFlags.@"r";
+ var mode = FileSystemFlags.r;
if (arguments.next()) |arg| {
arguments.eat();
@@ -1797,7 +1797,7 @@ const Arguments = struct {
pub const CreateReadStream = struct {
file: PathOrFileDescriptor,
- flags: FileSystemFlags = FileSystemFlags.@"r",
+ flags: FileSystemFlags = FileSystemFlags.r,
encoding: Encoding = Encoding.utf8,
mode: Mode = default_permission,
autoClose: bool = true,
@@ -1932,7 +1932,7 @@ const Arguments = struct {
pub const CreateWriteStream = struct {
file: PathOrFileDescriptor,
- flags: FileSystemFlags = FileSystemFlags.@"w",
+ flags: FileSystemFlags = FileSystemFlags.w,
encoding: Encoding = Encoding.utf8,
mode: Mode = default_permission,
autoClose: bool = true,
@@ -2153,7 +2153,7 @@ const Arguments = struct {
};
pub const Copy = struct {
- pub const FilterCallback = fn (source: string, destination: string) bool;
+ pub const FilterCallback = *const fn (source: string, destination: string) bool;
/// Dereference symlinks
/// @default false
dereference: bool = false,
@@ -2255,8 +2255,8 @@ const Return = struct {
bytes_read: u52,
buffer_val: JSC.JSValue = JSC.JSValue.zero,
const fields = .{
- .@"bytesRead" = JSC.ZigString.init("bytesRead"),
- .@"buffer" = JSC.ZigString.init("buffer"),
+ .bytesRead = JSC.ZigString.init("bytesRead"),
+ .buffer = JSC.ZigString.init("buffer"),
};
pub fn toJS(this: Read, ctx: JSC.C.JSContextRef, _: JSC.C.ExceptionRef) JSC.C.JSValueRef {
defer if (!this.buffer_val.isEmptyOrUndefinedOrNull())
@@ -2266,7 +2266,7 @@ const Return = struct {
ctx.ptr(),
&fields.bytesRead,
&fields.buffer,
- JSC.JSValue.jsNumberFromUint64(@intCast(u52, @minimum(std.math.maxInt(u52), this.bytes_read))),
+ JSC.JSValue.jsNumberFromUint64(@intCast(u52, @min(std.math.maxInt(u52), this.bytes_read))),
this.buffer_val,
).asObjectRef();
}
@@ -2277,8 +2277,8 @@ const Return = struct {
buffer: StringOrBuffer,
buffer_val: JSC.JSValue = JSC.JSValue.zero,
const fields = .{
- .@"bytesWritten" = JSC.ZigString.init("bytesWritten"),
- .@"buffer" = JSC.ZigString.init("buffer"),
+ .bytesWritten = JSC.ZigString.init("bytesWritten"),
+ .buffer = JSC.ZigString.init("buffer"),
};
// Excited for the issue that's like "cannot read file bigger than 2 GB"
@@ -2290,7 +2290,7 @@ const Return = struct {
ctx.ptr(),
&fields.bytesWritten,
&fields.buffer,
- JSC.JSValue.jsNumberFromUint64(@intCast(u52, @minimum(std.math.maxInt(u52), this.bytes_written))),
+ JSC.JSValue.jsNumberFromUint64(@intCast(u52, @min(std.math.maxInt(u52), this.bytes_written))),
if (this.buffer == .buffer)
this.buffer_val
else
@@ -2301,7 +2301,7 @@ const Return = struct {
pub const Write = struct {
bytes_written: u52,
const fields = .{
- .@"bytesWritten" = JSC.ZigString.init("bytesWritten"),
+ .bytesWritten = JSC.ZigString.init("bytesWritten"),
};
// Excited for the issue that's like "cannot read file bigger than 2 GB"
@@ -2311,7 +2311,7 @@ const Return = struct {
};
pub const Readdir = union(Tag) {
- with_file_types: []const DirEnt,
+ with_file_types: []Dirent,
buffers: []const Buffer,
files: []const PathString,
@@ -2323,7 +2323,7 @@ const Return = struct {
pub fn toJS(this: Readdir, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) JSC.C.JSValueRef {
return switch (this) {
- .with_file_types => JSC.To.JS.withType([]const DirEnt, this.with_file_types, ctx, exception),
+ .with_file_types => JSC.To.JS.withType([]const Dirent, this.with_file_types, ctx, exception),
.buffers => JSC.To.JS.withType([]const Buffer, this.buffers, ctx, exception),
.files => JSC.To.JS.withTypeClone([]const PathString, this.files, ctx, exception, true),
};
@@ -2386,7 +2386,6 @@ pub const NodeFS = struct {
return Maybe(Return.AppendFile).success;
},
else => {
- _ = this;
@compileError("Not implemented yet");
},
}
@@ -2395,7 +2394,7 @@ pub const NodeFS = struct {
const path = path_.sliceZ(&this.sync_error_buf);
switch (comptime flavor) {
.sync => {
- const fd = switch (Syscall.open(path, @enumToInt(FileSystemFlags.@"a"), 000666)) {
+ const fd = switch (Syscall.open(path, @enumToInt(FileSystemFlags.a), 0o000666)) {
.result => |result| result,
.err => |err| return .{ .err = err },
};
@@ -2415,7 +2414,6 @@ pub const NodeFS = struct {
return Maybe(Return.AppendFile).success;
},
else => {
- _ = this;
@compileError("Not implemented yet");
},
}
@@ -2425,14 +2423,12 @@ pub const NodeFS = struct {
return Maybe(Return.AppendFile).todo;
}
- pub fn close(this: *NodeFS, args: Arguments.Close, comptime flavor: Flavor) Maybe(Return.Close) {
+ pub fn close(_: *NodeFS, args: Arguments.Close, comptime flavor: Flavor) Maybe(Return.Close) {
switch (comptime flavor) {
.sync => {
return if (Syscall.close(args.fd)) |err| .{ .err = err } else Maybe(Return.Close).success;
},
- else => {
- _ = this;
- },
+ else => {},
}
return .{ .err = Syscall.Error.todo };
@@ -2442,7 +2438,7 @@ pub const NodeFS = struct {
/// https://github.com/pnpm/pnpm/issues/2761
/// https://github.com/libuv/libuv/pull/2578
/// https://github.com/nodejs/node/issues/34624
- pub fn copyFile(this: *NodeFS, args: Arguments.CopyFile, comptime flavor: Flavor) Maybe(Return.CopyFile) {
+ pub fn copyFile(_: *NodeFS, args: Arguments.CopyFile, comptime flavor: Flavor) Maybe(Return.CopyFile) {
const ret = Maybe(Return.CopyFile);
switch (comptime flavor) {
@@ -2480,7 +2476,7 @@ pub const NodeFS = struct {
return ret.success;
}
} else {
- const src_fd = switch (Syscall.open(src, std.os.O.RDONLY, 0644)) {
+ const src_fd = switch (Syscall.open(src, std.os.O.RDONLY, 0o644)) {
.result => |result| result,
.err => |err| return .{ .err = err.withPath(args.src.slice()) },
};
@@ -2509,9 +2505,9 @@ pub const NodeFS = struct {
// 16 KB is high end of what is okay to use for stack space
// good thing we ask for absurdly large stack sizes
var buf: [16384]u8 = undefined;
- var remain = @intCast(u64, @maximum(stat_.size, 0));
+ var remain = @intCast(u64, @max(stat_.size, 0));
toplevel: while (remain > 0) {
- const amt = switch (Syscall.read(src_fd, buf[0..@minimum(buf.len, remain)])) {
+ const amt = switch (Syscall.read(src_fd, buf[0..@min(buf.len, remain)])) {
.result => |result| result,
.err => |err| return Maybe(Return.CopyFile){ .err = err.withPath(src) },
};
@@ -2579,7 +2575,7 @@ pub const NodeFS = struct {
return Maybe(Return.CopyFile).todo;
}
- const src_fd = switch (Syscall.open(src, std.os.O.RDONLY, 0644)) {
+ const src_fd = switch (Syscall.open(src, std.os.O.RDONLY, 0o644)) {
.result => |result| result,
.err => |err| return .{ .err = err },
};
@@ -2607,7 +2603,7 @@ pub const NodeFS = struct {
.err => |err| return Maybe(Return.CopyFile){ .err = err },
};
- var size = @intCast(usize, @maximum(stat_.size, 0));
+ var size = @intCast(usize, @max(stat_.size, 0));
defer {
_ = linux.ftruncate(dest_fd, @intCast(i64, @truncate(u63, wrote)));
@@ -2653,11 +2649,7 @@ pub const NodeFS = struct {
return ret.success;
}
},
- else => {
- _ = args;
- _ = this;
- _ = flavor;
- },
+ else => {},
}
return Maybe(Return.CopyFile).todo;
@@ -2676,9 +2668,7 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Ret.todo;
}
@@ -2689,9 +2679,7 @@ pub const NodeFS = struct {
.sync => return Syscall.chown(path, args.uid, args.gid),
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Chown).todo;
}
@@ -2706,26 +2694,22 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Chmod).todo;
}
/// This should almost never be async
- pub fn fchmod(this: *NodeFS, args: Arguments.FChmod, comptime flavor: Flavor) Maybe(Return.Fchmod) {
+ pub fn fchmod(_: *NodeFS, args: Arguments.FChmod, comptime flavor: Flavor) Maybe(Return.Fchmod) {
switch (comptime flavor) {
.sync => {
return Syscall.fchmod(args.fd, args.mode);
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Fchmod).todo;
}
- pub fn fchown(this: *NodeFS, args: Arguments.Fchown, comptime flavor: Flavor) Maybe(Return.Fchown) {
+ pub fn fchown(_: *NodeFS, args: Arguments.Fchown, comptime flavor: Flavor) Maybe(Return.Fchown) {
switch (comptime flavor) {
.sync => {
return Maybe(Return.Fchown).errnoSys(C.fchown(args.fd, args.uid, args.gid), .fchown) orelse
@@ -2733,24 +2717,19 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Fchown).todo;
}
- pub fn fdatasync(this: *NodeFS, args: Arguments.FdataSync, comptime flavor: Flavor) Maybe(Return.Fdatasync) {
+ pub fn fdatasync(_: *NodeFS, args: Arguments.FdataSync, comptime flavor: Flavor) Maybe(Return.Fdatasync) {
switch (comptime flavor) {
.sync => return Maybe(Return.Fdatasync).errnoSys(system.fdatasync(args.fd), .fdatasync) orelse
Maybe(Return.Fdatasync).success,
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Fdatasync).todo;
}
- pub fn fstat(this: *NodeFS, args: Arguments.Fstat, comptime flavor: Flavor) Maybe(Return.Fstat) {
+ pub fn fstat(_: *NodeFS, args: Arguments.Fstat, comptime flavor: Flavor) Maybe(Return.Fstat) {
if (args.big_int) return Maybe(Return.Fstat).todo;
switch (comptime flavor) {
@@ -2763,38 +2742,29 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Fstat).todo;
}
- pub fn fsync(this: *NodeFS, args: Arguments.Fsync, comptime flavor: Flavor) Maybe(Return.Fsync) {
+ pub fn fsync(_: *NodeFS, args: Arguments.Fsync, comptime flavor: Flavor) Maybe(Return.Fsync) {
switch (comptime flavor) {
.sync => return Maybe(Return.Fsync).errnoSys(system.fsync(args.fd), .fsync) orelse
Maybe(Return.Fsync).success,
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Fsync).todo;
}
- pub fn ftruncate(this: *NodeFS, args: Arguments.FTruncate, comptime flavor: Flavor) Maybe(Return.Ftruncate) {
+ pub fn ftruncate(_: *NodeFS, args: Arguments.FTruncate, comptime flavor: Flavor) Maybe(Return.Ftruncate) {
switch (comptime flavor) {
.sync => return Maybe(Return.Ftruncate).errnoSys(system.ftruncate(args.fd, args.len orelse 0), .ftruncate) orelse
Maybe(Return.Ftruncate).success,
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Ftruncate).todo;
}
- pub fn futimes(this: *NodeFS, args: Arguments.Futimes, comptime flavor: Flavor) Maybe(Return.Futimes) {
+ pub fn futimes(_: *NodeFS, args: Arguments.Futimes, comptime flavor: Flavor) Maybe(Return.Futimes) {
var times = [2]std.os.timespec{
.{
.tv_sec = args.mtime,
@@ -2814,9 +2784,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Futimes).todo;
}
@@ -2830,9 +2797,7 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Lchmod).todo;
}
@@ -2846,9 +2811,7 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Lchown).todo;
}
pub fn link(this: *NodeFS, args: Arguments.Link, comptime flavor: Flavor) Maybe(Return.Link) {
@@ -2864,9 +2827,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Link).todo;
}
pub fn lstat(this: *NodeFS, args: Arguments.Lstat, comptime flavor: Flavor) Maybe(Return.Lstat) {
@@ -2886,9 +2846,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Lstat).todo;
}
@@ -2907,9 +2864,7 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Mkdir).todo;
}
@@ -3044,15 +2999,12 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Mkdir).todo;
}
- pub fn mkdtemp(this: *NodeFS, args: Arguments.MkdirTemp, comptime flavor: Flavor) Maybe(Return.Mkdtemp) {
+ pub fn mkdtemp(this: *NodeFS, args: Arguments.MkdirTemp, comptime _: Flavor) Maybe(Return.Mkdtemp) {
var prefix_buf = &this.sync_error_buf;
- const len = @minimum(args.prefix.len, prefix_buf.len - 7);
+ const len = @min(args.prefix.len, prefix_buf.len - 7);
if (len > 0) {
@memcpy(prefix_buf, args.prefix.ptr, len);
}
@@ -3065,8 +3017,6 @@ pub const NodeFS = struct {
else => |errno| return .{ .err = Syscall.Error{ .errno = @truncate(Syscall.Error.Int, @enumToInt(errno)), .syscall = .mkdtemp } },
}
- _ = this;
- _ = flavor;
return .{
.result = PathString.init(bun.default_allocator.dupe(u8, std.mem.span(rc.?)) catch unreachable),
};
@@ -3086,30 +3036,21 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Open).todo;
}
- pub fn openDir(this: *NodeFS, args: Arguments.OpenDir, comptime flavor: Flavor) Maybe(Return.OpenDir) {
- _ = args;
- _ = this;
- _ = flavor;
+ pub fn openDir(_: *NodeFS, _: Arguments.OpenDir, comptime _: Flavor) Maybe(Return.OpenDir) {
return Maybe(Return.OpenDir).todo;
}
- fn _read(this: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
- _ = args;
- _ = this;
- _ = flavor;
+ fn _read(_: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
if (Environment.allow_assert) std.debug.assert(args.position == null);
switch (comptime flavor) {
// The sync version does no allocation except when returning the path
.sync => {
var buf = args.buffer.slice();
- buf = buf[@minimum(args.offset, buf.len)..];
- buf = buf[0..@minimum(buf.len, args.length)];
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
return switch (Syscall.read(args.fd, buf)) {
.err => |err| .{
@@ -3128,14 +3069,12 @@ pub const NodeFS = struct {
return Maybe(Return.Read).todo;
}
- fn _pread(this: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
- _ = this;
-
+ fn _pread(_: *NodeFS, args: Arguments.Read, comptime flavor: Flavor) Maybe(Return.Read) {
switch (comptime flavor) {
.sync => {
var buf = args.buffer.slice();
- buf = buf[@minimum(args.offset, buf.len)..];
- buf = buf[0..@minimum(buf.len, args.length)];
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
return switch (Syscall.pread(args.fd, buf, args.position.?)) {
.err => |err| .{
@@ -3170,16 +3109,12 @@ pub const NodeFS = struct {
pub fn write(this: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
return if (args.position != null) _pwrite(this, args, flavor) else _write(this, args, flavor);
}
- fn _write(this: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
- _ = args;
- _ = this;
- _ = flavor;
-
+ fn _write(_: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
switch (comptime flavor) {
.sync => {
var buf = args.buffer.slice();
- buf = buf[@minimum(args.offset, buf.len)..];
- buf = buf[0..@minimum(buf.len, args.length)];
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(buf.len, args.length)];
return switch (Syscall.write(args.fd, buf)) {
.err => |err| .{
@@ -3198,18 +3133,14 @@ pub const NodeFS = struct {
return Maybe(Return.Write).todo;
}
- fn _pwrite(this: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
- _ = args;
- _ = this;
- _ = flavor;
-
+ fn _pwrite(_: *NodeFS, args: Arguments.Write, comptime flavor: Flavor) Maybe(Return.Write) {
const position = args.position.?;
switch (comptime flavor) {
.sync => {
var buf = args.buffer.slice();
- buf = buf[@minimum(args.offset, buf.len)..];
- buf = buf[0..@minimum(args.length, buf.len)];
+ buf = buf[@min(args.offset, buf.len)..];
+ buf = buf[0..@min(args.length, buf.len)];
return switch (Syscall.pwrite(args.fd, buf, position)) {
.err => |err| .{
@@ -3247,7 +3178,7 @@ pub const NodeFS = struct {
return _readdir(
this,
args,
- DirEnt,
+ Dirent,
flavor,
);
},
@@ -3261,7 +3192,7 @@ pub const NodeFS = struct {
comptime flavor: Flavor,
) Maybe(Return.Readdir) {
const file_type = comptime switch (ExpectedType) {
- DirEnt => "with_file_types",
+ Dirent => "with_file_types",
PathString => "files",
Buffer => "buffers",
else => unreachable,
@@ -3289,7 +3220,7 @@ pub const NodeFS = struct {
.err => |err| {
for (entries.items) |*item| {
switch (comptime ExpectedType) {
- DirEnt => {
+ Dirent => {
bun.default_allocator.free(item.name.slice());
},
Buffer => {
@@ -3311,7 +3242,7 @@ pub const NodeFS = struct {
.result => |ent| ent,
}) |current| : (entry = iterator.next()) {
switch (comptime ExpectedType) {
- DirEnt => {
+ Dirent => {
entries.append(.{
.name = PathString.init(bun.default_allocator.dupe(u8, current.name.slice()) catch unreachable),
.kind = current.kind,
@@ -3335,9 +3266,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Readdir).todo;
}
pub fn readFile(this: *NodeFS, args: Arguments.ReadFile, comptime flavor: Flavor) Maybe(Return.ReadFile) {
@@ -3374,7 +3302,7 @@ pub const NodeFS = struct {
};
// For certain files, the size might be 0 but the file might still have contents.
- const size = @intCast(u64, @maximum(stat_.size, 0));
+ const size = @intCast(u64, @max(stat_.size, 0));
var buf = std.ArrayList(u8).init(bun.default_allocator);
buf.ensureTotalCapacityPrecise(size + 16) catch unreachable;
@@ -3457,9 +3385,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.ReadFile).todo;
}
@@ -3515,9 +3440,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.WriteFile).todo;
}
@@ -3549,9 +3471,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Readlink).todo;
}
pub fn realpath(this: *NodeFS, args: Arguments.Realpath, comptime flavor: Flavor) Maybe(Return.Realpath) {
@@ -3606,16 +3525,13 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Realpath).todo;
}
pub const realpathNative = realpath;
// pub fn realpathNative(this: *NodeFS, args: Arguments.Realpath, comptime flavor: Flavor) Maybe(Return.Realpath) {
// _ = args;
- // _ = this;
- // _ = flavor;
+ //
+ //
// return error.NotImplementedYet;
// }
pub fn rename(this: *NodeFS, args: Arguments.Rename, comptime flavor: Flavor) Maybe(Return.Rename) {
@@ -3631,9 +3547,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Rename).todo;
}
pub fn rmdir(this: *NodeFS, args: Arguments.RmDir, comptime flavor: Flavor) Maybe(Return.Rmdir) {
@@ -3644,15 +3557,10 @@ pub const NodeFS = struct {
},
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
+
return Maybe(Return.Rmdir).todo;
}
pub fn rm(this: *NodeFS, args: Arguments.RmDir, comptime flavor: Flavor) Maybe(Return.Rm) {
- _ = args;
- _ = this;
- _ = flavor;
switch (comptime flavor) {
.sync => {
if (comptime Environment.isMac) {
@@ -3832,9 +3740,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Stat).todo;
}
@@ -3851,9 +3756,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Symlink).todo;
}
fn _truncate(this: *NodeFS, path: PathLike, len: JSC.WebCore.Blob.SizeType, comptime flavor: Flavor) Maybe(Return.Truncate) {
@@ -3865,8 +3767,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = this;
- _ = flavor;
return Maybe(Return.Truncate).todo;
}
pub fn truncate(this: *NodeFS, args: Arguments.Truncate, comptime flavor: Flavor) Maybe(Return.Truncate) {
@@ -3891,15 +3791,9 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Unlink).todo;
}
- pub fn unwatchFile(this: *NodeFS, args: Arguments.UnwatchFile, comptime flavor: Flavor) Maybe(Return.UnwatchFile) {
- _ = args;
- _ = this;
- _ = flavor;
+ pub fn unwatchFile(_: *NodeFS, _: Arguments.UnwatchFile, comptime _: Flavor) Maybe(Return.UnwatchFile) {
return Maybe(Return.UnwatchFile).todo;
}
pub fn utimes(this: *NodeFS, args: Arguments.Utimes, comptime flavor: Flavor) Maybe(Return.Utimes) {
@@ -3927,9 +3821,6 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Utimes).todo;
}
@@ -3958,15 +3849,9 @@ pub const NodeFS = struct {
else => {},
}
- _ = args;
- _ = this;
- _ = flavor;
return Maybe(Return.Lutimes).todo;
}
- pub fn watch(this: *NodeFS, args: Arguments.Watch, comptime flavor: Flavor) Maybe(Return.Watch) {
- _ = args;
- _ = this;
- _ = flavor;
+ pub fn watch(_: *NodeFS, _: Arguments.Watch, comptime _: Flavor) Maybe(Return.Watch) {
return Maybe(Return.Watch).todo;
}
pub fn createReadStream(_: *NodeFS, _: Arguments.CreateReadStream, comptime _: Flavor) Maybe(Return.CreateReadStream) {
diff --git a/src/bun.js/node/node_fs_binding.zig b/src/bun.js/node/node_fs_binding.zig
index e88e0cbf7..07ecf4619 100644
--- a/src/bun.js/node/node_fs_binding.zig
+++ b/src/bun.js/node/node_fs_binding.zig
@@ -10,13 +10,10 @@ const Args = JSC.Node.NodeFS.Arguments;
const d = JSC.d;
const NodeFSFunction = fn (
- *JSC.Node.NodeFS,
- JSC.C.JSContextRef,
- JSC.C.JSObjectRef,
- JSC.C.JSObjectRef,
- []const JSC.C.JSValueRef,
- JSC.C.ExceptionRef,
-) JSC.C.JSValueRef;
+ this: *JSC.Node.NodeJSFS,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+) callconv(.C) JSC.JSValue;
pub const toJSTrait = std.meta.trait.hasFn("toJS");
pub const fromJSTrait = std.meta.trait.hasFn("fromJS");
@@ -26,45 +23,63 @@ fn callSync(comptime FunctionEnum: NodeFSFunctionEnum) NodeFSFunction {
const Function = @field(JSC.Node.NodeFS, @tagName(FunctionEnum));
const FunctionType = @TypeOf(Function);
- const function: std.builtin.TypeInfo.Fn = comptime @typeInfo(FunctionType).Fn;
- comptime if (function.args.len != 3) @compileError("Expected 3 arguments");
- const Arguments = comptime function.args[1].arg_type.?;
+ const function: std.builtin.Type.Fn = comptime @typeInfo(FunctionType).Fn;
+ comptime if (function.params.len != 3) @compileError("Expected 3 arguments");
+ const Arguments = comptime function.params[1].type.?;
const FormattedName = comptime [1]u8{std.ascii.toUpper(@tagName(FunctionEnum)[0])} ++ @tagName(FunctionEnum)[1..];
const Result = comptime JSC.Maybe(@field(JSC.Node.NodeFS.ReturnType, FormattedName));
const NodeBindingClosure = struct {
pub fn bind(
- this: *JSC.Node.NodeFS,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- arguments: []const JSC.C.JSValueRef,
- exception: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- var slice = ArgumentsSlice.init(ctx.bunVM(), @ptrCast([*]const JSC.JSValue, arguments.ptr)[0..arguments.len]);
+ this: *JSC.Node.NodeJSFS,
+ globalObject: *JSC.JSGlobalObject,
+ callframe: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ var exceptionref: JSC.C.JSValueRef = null;
+
+ var arguments = callframe.arguments(8);
+ var slice = ArgumentsSlice.init(globalObject.bunVM(), arguments.ptr[0..arguments.len]);
defer slice.deinit();
const args = if (comptime Arguments != void)
- (Arguments.fromJS(ctx, &slice, exception) orelse return null)
+ (Arguments.fromJS(globalObject, &slice, &exceptionref) orelse return .zero)
else
Arguments{};
- if (exception.* != null) return null;
+
+ const exception1 = JSC.JSValue.c(exceptionref);
+
+ if (exception1 != .zero) {
+ globalObject.throwValue(exception1);
+ return .zero;
+ }
const result: Result = Function(
- this,
+ &this.node_fs,
args,
comptime Flavor.sync,
);
- return switch (result) {
- .err => |err| brk: {
- exception.* = err.toJS(ctx);
- break :brk null;
+ switch (result) {
+ .err => |err| {
+ globalObject.throwValue(JSC.JSValue.c(err.toJS(globalObject)));
+ return .zero;
},
- .result => |res| if (comptime Result.ReturnType != void)
- JSC.To.JS.withType(Result.ReturnType, res, ctx, exception)
- else
- JSC.C.JSValueMakeUndefined(ctx),
- };
+ .result => |res| {
+ if (comptime Result.ReturnType != void) {
+ const out = JSC.JSValue.c(JSC.To.JS.withType(Result.ReturnType, res, globalObject, &exceptionref));
+ const exception = JSC.JSValue.c(exceptionref);
+ if (exception != .zero) {
+ globalObject.throwValue(exception);
+ return .zero;
+ }
+
+ return out;
+ } else {
+ return JSC.JSValue.jsUndefined();
+ }
+
+ unreachable;
+ },
+ }
}
};
@@ -75,27 +90,20 @@ fn call(comptime Function: NodeFSFunctionEnum) NodeFSFunction {
// const FunctionType = @TypeOf(Function);
_ = Function;
- // const function: std.builtin.TypeInfo.Fn = comptime @typeInfo(FunctionType).Fn;
+ // const function: std.builtin.Type.Fn = comptime @typeInfo(FunctionType).Fn;
// comptime if (function.args.len != 3) @compileError("Expected 3 arguments");
- // const Arguments = comptime function.args[2].arg_type orelse @compileError(std.fmt.comptimePrint("Function {s} expected to have an arg type at [2]", .{@typeName(FunctionType)}));
+ // const Arguments = comptime function.args[2].type orelse @compileError(std.fmt.comptimePrint("Function {s} expected to have an arg type at [2]", .{@typeName(FunctionType)}));
// const Result = comptime function.return_type.?;
// comptime if (Arguments != void and !fromJSTrait(Arguments)) @compileError(std.fmt.comptimePrint("{s} is missing fromJS()", .{@typeName(Arguments)}));
// comptime if (Result != void and !toJSTrait(Result)) @compileError(std.fmt.comptimePrint("{s} is missing toJS()", .{@typeName(Result)}));
const NodeBindingClosure = struct {
pub fn bind(
- this: *JSC.Node.NodeFS,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- arguments: []const JSC.C.JSValueRef,
- exception: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- _ = this;
- _ = ctx;
- _ = arguments;
- var err = JSC.SystemError{};
- exception.* = err.toErrorInstance(ctx.ptr()).asObjectRef();
- return null;
+ _: *JSC.Node.NodeJSFS,
+ globalObject: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ globalObject.throw("Not implemented yet", .{});
+ return .zero;
// var slice = ArgumentsSlice.init(arguments);
// defer {
@@ -130,310 +138,102 @@ fn call(comptime Function: NodeFSFunctionEnum) NodeFSFunction {
return NodeBindingClosure.bind;
}
-pub const NodeFSBindings = JSC.NewClass(
- JSC.Node.NodeFS,
- .{ .name = "fs", .ts = .{ .module = .{ .path = "fs" } } },
-
- .{
- .access = .{
- .name = "access",
- .rfn = call(.access),
- },
- .appendFile = .{
- .name = "appendFile",
- .rfn = call(.appendFile),
- },
- .close = .{
- .name = "close",
- .rfn = call(.close),
- },
- .copyFile = .{
- .name = "copyFile",
- .rfn = call(.copyFile),
- },
- .exists = .{
- .name = "exists",
- .rfn = call(.exists),
- },
- .chown = .{
- .name = "chown",
- .rfn = call(.chown),
- },
- .chmod = .{
- .name = "chmod",
- .rfn = call(.chmod),
- },
- .fchmod = .{
- .name = "fchmod",
- .rfn = call(.fchmod),
- },
- .fchown = .{
- .name = "fchown",
- .rfn = call(.fchown),
- },
- .fstat = .{
- .name = "fstat",
- .rfn = call(.fstat),
- },
- .fsync = .{
- .name = "fsync",
- .rfn = call(.fsync),
- },
- .ftruncate = .{
- .name = "ftruncate",
- .rfn = call(.ftruncate),
- },
- .futimes = .{
- .name = "futimes",
- .rfn = call(.futimes),
- },
- .lchmod = .{
- .name = "lchmod",
- .rfn = call(.lchmod),
- },
- .lchown = .{
- .name = "lchown",
- .rfn = call(.lchown),
- },
- .link = .{
- .name = "link",
- .rfn = call(.link),
- },
- .lstat = .{
- .name = "lstat",
- .rfn = call(.lstat),
- },
- .mkdir = .{
- .name = "mkdir",
- .rfn = call(.mkdir),
- },
- .mkdtemp = .{
- .name = "mkdtemp",
- .rfn = call(.mkdtemp),
- },
- .open = .{
- .name = "open",
- .rfn = call(.open),
- },
- .read = .{
- .name = "read",
- .rfn = call(.read),
- },
- .write = .{
- .name = "write",
- .rfn = call(.write),
- },
- .readdir = .{
- .name = "readdir",
- .rfn = call(.readdir),
- },
- .readFile = .{
- .name = "readFile",
- .rfn = call(.readFile),
- },
- .writeFile = .{
- .name = "writeFile",
- .rfn = call(.writeFile),
- },
- .readlink = .{
- .name = "readlink",
- .rfn = call(.readlink),
- },
- .rm = .{
- .name = "rm",
- .rfn = call(.rm),
- },
- .rmdir = .{
- .name = "rmdir",
- .rfn = call(.rmdir),
- },
- .realpath = .{
- .name = "realpath",
- .rfn = call(.realpath),
- },
- .rename = .{
- .name = "rename",
- .rfn = call(.rename),
- },
- .stat = .{
- .name = "stat",
- .rfn = call(.stat),
- },
- .symlink = .{
- .name = "symlink",
- .rfn = call(.symlink),
- },
- .truncate = .{
- .name = "truncate",
- .rfn = call(.truncate),
- },
- .unlink = .{
- .name = "unlink",
- .rfn = call(.unlink),
- },
- .utimes = .{
- .name = "utimes",
- .rfn = call(.utimes),
- },
- .lutimes = .{
- .name = "lutimes",
- .rfn = call(.lutimes),
- },
-
- .createReadStream = .{
- .name = "createReadStream",
- .rfn = if (FeatureFlags.node_streams) callSync(.createReadStream) else call(.createReadStream),
- },
-
- .createWriteStream = .{
- .name = "createWriteStream",
- .rfn = if (FeatureFlags.node_streams) callSync(.createWriteStream) else call(.createWriteStream),
- },
-
- .accessSync = .{
- .name = "accessSync",
- .rfn = callSync(.access),
- },
- .appendFileSync = .{
- .name = "appendFileSync",
- .rfn = callSync(.appendFile),
- },
- .closeSync = .{
- .name = "closeSync",
- .rfn = callSync(.close),
- },
- .copyFileSync = .{
- .name = "copyFileSync",
- .rfn = callSync(.copyFile),
- },
- .existsSync = .{
- .name = "existsSync",
- .rfn = callSync(.exists),
- },
- .chownSync = .{
- .name = "chownSync",
- .rfn = callSync(.chown),
- },
- .chmodSync = .{
- .name = "chmodSync",
- .rfn = callSync(.chmod),
- },
- .fchmodSync = .{
- .name = "fchmodSync",
- .rfn = callSync(.fchmod),
- },
- .fchownSync = .{
- .name = "fchownSync",
- .rfn = callSync(.fchown),
- },
- .fstatSync = .{
- .name = "fstatSync",
- .rfn = callSync(.fstat),
- },
- .fsyncSync = .{
- .name = "fsyncSync",
- .rfn = callSync(.fsync),
- },
- .ftruncateSync = .{
- .name = "ftruncateSync",
- .rfn = callSync(.ftruncate),
- },
- .futimesSync = .{
- .name = "futimesSync",
- .rfn = callSync(.futimes),
- },
- .lchmodSync = .{
- .name = "lchmodSync",
- .rfn = callSync(.lchmod),
- },
- .lchownSync = .{
- .name = "lchownSync",
- .rfn = callSync(.lchown),
- },
- .linkSync = .{
- .name = "linkSync",
- .rfn = callSync(.link),
- },
- .lstatSync = .{
- .name = "lstatSync",
- .rfn = callSync(.lstat),
- },
- .mkdirSync = .{
- .name = "mkdirSync",
- .rfn = callSync(.mkdir),
- },
- .mkdtempSync = .{
- .name = "mkdtempSync",
- .rfn = callSync(.mkdtemp),
- },
- .openSync = .{
- .name = "openSync",
- .rfn = callSync(.open),
- },
- .readSync = .{
- .name = "readSync",
- .rfn = callSync(.read),
- },
- .writeSync = .{
- .name = "writeSync",
- .rfn = callSync(.write),
- },
- .readdirSync = .{
- .name = "readdirSync",
- .rfn = callSync(.readdir),
- },
- .readFileSync = .{
- .name = "readFileSync",
- .rfn = callSync(.readFile),
- },
- .writeFileSync = .{
- .name = "writeFileSync",
- .rfn = callSync(.writeFile),
- },
- .readlinkSync = .{
- .name = "readlinkSync",
- .rfn = callSync(.readlink),
- },
- .realpathSync = .{
- .name = "realpathSync",
- .rfn = callSync(.realpath),
- },
- .renameSync = .{
- .name = "renameSync",
- .rfn = callSync(.rename),
- },
- .statSync = .{
- .name = "statSync",
- .rfn = callSync(.stat),
- },
- .symlinkSync = .{
- .name = "symlinkSync",
- .rfn = callSync(.symlink),
- },
- .truncateSync = .{
- .name = "truncateSync",
- .rfn = callSync(.truncate),
- },
- .unlinkSync = .{
- .name = "unlinkSync",
- .rfn = callSync(.unlink),
- },
- .utimesSync = .{
- .name = "utimesSync",
- .rfn = callSync(.utimes),
- },
- .lutimesSync = .{
- .name = "lutimesSync",
- .rfn = callSync(.lutimes),
- },
- .rmSync = .{
- .name = "rmSync",
- .rfn = callSync(.rm),
- },
- .rmdirSync = .{
- .name = "rmdirSync",
- .rfn = callSync(.rmdir),
- },
- },
- .{},
-);
+pub const NodeJSFS = struct {
+ node_fs: JSC.Node.NodeFS = undefined,
+
+ pub usingnamespace JSC.Codegen.JSNodeJSFS;
+
+ pub fn constructor(globalObject: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) ?*@This() {
+ globalObject.throw("Not a constructor", .{});
+ return null;
+ }
+
+ pub const access = call(.access);
+ pub const appendFile = call(.appendFile);
+ pub const close = call(.close);
+ pub const copyFile = call(.copyFile);
+ pub const exists = call(.exists);
+ pub const chown = call(.chown);
+ pub const chmod = call(.chmod);
+ pub const fchmod = call(.fchmod);
+ pub const fchown = call(.fchown);
+ pub const fstat = call(.fstat);
+ pub const fsync = call(.fsync);
+ pub const ftruncate = call(.ftruncate);
+ pub const futimes = call(.futimes);
+ pub const lchmod = call(.lchmod);
+ pub const lchown = call(.lchown);
+ pub const link = call(.link);
+ pub const lstat = call(.lstat);
+ pub const mkdir = call(.mkdir);
+ pub const mkdtemp = call(.mkdtemp);
+ pub const open = call(.open);
+ pub const read = call(.read);
+ pub const write = call(.write);
+ pub const readdir = call(.readdir);
+ pub const readFile = call(.readFile);
+ pub const writeFile = call(.writeFile);
+ pub const readlink = call(.readlink);
+ pub const rm = call(.rm);
+ pub const rmdir = call(.rmdir);
+ pub const realpath = call(.realpath);
+ pub const rename = call(.rename);
+ pub const stat = call(.stat);
+ pub const symlink = call(.symlink);
+ pub const truncate = call(.truncate);
+ pub const unlink = call(.unlink);
+ pub const utimes = call(.utimes);
+ pub const lutimes = call(.lutimes);
+ pub const accessSync = callSync(.access);
+ pub const appendFileSync = callSync(.appendFile);
+ pub const closeSync = callSync(.close);
+ pub const copyFileSync = callSync(.copyFile);
+ pub const existsSync = callSync(.exists);
+ pub const chownSync = callSync(.chown);
+ pub const chmodSync = callSync(.chmod);
+ pub const fchmodSync = callSync(.fchmod);
+ pub const fchownSync = callSync(.fchown);
+ pub const fstatSync = callSync(.fstat);
+ pub const fsyncSync = callSync(.fsync);
+ pub const ftruncateSync = callSync(.ftruncate);
+ pub const futimesSync = callSync(.futimes);
+ pub const lchmodSync = callSync(.lchmod);
+ pub const lchownSync = callSync(.lchown);
+ pub const linkSync = callSync(.link);
+ pub const lstatSync = callSync(.lstat);
+ pub const mkdirSync = callSync(.mkdir);
+ pub const mkdtempSync = callSync(.mkdtemp);
+ pub const openSync = callSync(.open);
+ pub const readSync = callSync(.read);
+ pub const writeSync = callSync(.write);
+ pub const readdirSync = callSync(.readdir);
+ pub const readFileSync = callSync(.readFile);
+ pub const writeFileSync = callSync(.writeFile);
+ pub const readlinkSync = callSync(.readlink);
+ pub const realpathSync = callSync(.realpath);
+ pub const renameSync = callSync(.rename);
+ pub const statSync = callSync(.stat);
+ pub const symlinkSync = callSync(.symlink);
+ pub const truncateSync = callSync(.truncate);
+ pub const unlinkSync = callSync(.unlink);
+ pub const utimesSync = callSync(.utimes);
+ pub const lutimesSync = callSync(.lutimes);
+ pub const rmSync = callSync(.rm);
+ pub const rmdirSync = callSync(.rmdir);
+
+ pub const fdatasyncSync = callSync(.fdatasync);
+ pub const fdatasync = call(.fdatasync);
+
+ pub fn getDirent(_: *NodeJSFS, globalThis: *JSC.JSGlobalObject) callconv(.C) JSC.JSValue {
+ return JSC.Node.Dirent.getConstructor(globalThis);
+ }
+
+ // Not implemented yet:
+ const notimpl = fdatasync;
+ pub const opendir = notimpl;
+ pub const opendirSync = notimpl;
+ pub const readv = notimpl;
+ pub const readvSync = notimpl;
+ pub const writev = notimpl;
+ pub const writevSync = notimpl;
+};
diff --git a/src/bun.js/node/node_os.zig b/src/bun.js/node/node_os.zig
index 3018fd138..525ee991b 100644
--- a/src/bun.js/node/node_os.zig
+++ b/src/bun.js/node/node_os.zig
@@ -32,7 +32,7 @@ pub const Os = struct {
module.put(globalObject, JSC.ZigString.static("setPriority"), JSC.NewFunction(globalObject, JSC.ZigString.static("setPriority"), 2, setPriority, true));
module.put(globalObject, JSC.ZigString.static("tmpdir"), JSC.NewFunction(globalObject, JSC.ZigString.static("tmpdir"), 0, tmpdir, true));
module.put(globalObject, JSC.ZigString.static("totalmem"), JSC.NewFunction(globalObject, JSC.ZigString.static("totalmem"), 0, totalmem, true));
- module.put(globalObject, JSC.ZigString.static("type"), JSC.NewFunction(globalObject, JSC.ZigString.static("type"), 0, Os.@"type", true));
+ module.put(globalObject, JSC.ZigString.static("type"), JSC.NewFunction(globalObject, JSC.ZigString.static("type"), 0, Os.type, true));
module.put(globalObject, JSC.ZigString.static("uptime"), JSC.NewFunction(globalObject, JSC.ZigString.static("uptime"), 0, uptime, true));
module.put(globalObject, JSC.ZigString.static("userInfo"), JSC.NewFunction(globalObject, JSC.ZigString.static("userInfo"), 0, userInfo, true));
module.put(globalObject, JSC.ZigString.static("version"), JSC.NewFunction(globalObject, JSC.ZigString.static("version"), 0, version, true));
diff --git a/src/bun.js/node/syscall.zig b/src/bun.js/node/syscall.zig
index 50ba6e33f..06b007ef1 100644
--- a/src/bun.js/node/syscall.zig
+++ b/src/bun.js/node/syscall.zig
@@ -253,7 +253,7 @@ const max_count = switch (builtin.os.tag) {
};
pub fn write(fd: os.fd_t, bytes: []const u8) Maybe(usize) {
- const adjusted_len = @minimum(max_count, bytes.len);
+ const adjusted_len = @min(max_count, bytes.len);
if (comptime Environment.isMac) {
const rc = system.@"write$NOCANCEL"(fd, bytes.ptr, adjusted_len);
@@ -290,7 +290,7 @@ else
const fcntl_symbol = system.fcntl;
pub fn pread(fd: os.fd_t, buf: []u8, offset: i64) Maybe(usize) {
- const adjusted_len = @minimum(buf.len, max_count);
+ const adjusted_len = @min(buf.len, max_count);
const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
while (true) {
const rc = pread_sym(fd, buf.ptr, adjusted_len, ioffset);
@@ -309,7 +309,7 @@ else
sys.pwrite;
pub fn pwrite(fd: os.fd_t, bytes: []const u8, offset: i64) Maybe(usize) {
- const adjusted_len = @minimum(bytes.len, max_count);
+ const adjusted_len = @min(bytes.len, max_count);
const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
while (true) {
@@ -327,7 +327,7 @@ pub fn pwrite(fd: os.fd_t, bytes: []const u8, offset: i64) Maybe(usize) {
pub fn read(fd: os.fd_t, buf: []u8) Maybe(usize) {
const debug_timer = bun.Output.DebugTimer.start();
- const adjusted_len = @minimum(buf.len, max_count);
+ const adjusted_len = @min(buf.len, max_count);
if (comptime Environment.isMac) {
const rc = system.@"read$NOCANCEL"(fd, buf.ptr, adjusted_len);
@@ -353,7 +353,7 @@ pub fn read(fd: os.fd_t, buf: []u8) Maybe(usize) {
}
pub fn recv(fd: os.fd_t, buf: []u8, flag: u32) Maybe(usize) {
- const adjusted_len = @minimum(buf.len, max_count);
+ const adjusted_len = @min(buf.len, max_count);
if (comptime Environment.isMac) {
const rc = system.@"recvfrom$NOCANCEL"(fd, buf.ptr, adjusted_len, flag, null, null);
@@ -582,7 +582,7 @@ pub fn mmapFile(path: [:0]const u8, flags: u32, wanted_size: ?usize, offset: usi
},
}), offset) catch 0;
- if (wanted_size) |size_| size = @minimum(size, size_);
+ if (wanted_size) |size_| size = @min(size, size_);
const map = switch (mmap(null, size, os.PROT.READ | os.PROT.WRITE, flags, fd, offset)) {
.result => |map| map,
@@ -612,7 +612,7 @@ pub const Error = struct {
const errno_values = std.enums.values(os.E);
var err = @enumToInt(os.E.SUCCESS);
for (errno_values) |errn| {
- err = @maximum(err, @enumToInt(errn));
+ err = @max(err, @enumToInt(errn));
}
break :brk err;
};
@@ -774,7 +774,7 @@ pub fn getMaxPipeSizeOnLinux() usize {
// we set the absolute max to 8 MB because honestly that's a huge pipe
// my current linux machine only goes up to 1 MB, so that's very unlikely to be hit
- return @minimum(@truncate(c_int, max_pipe_size -| 32), 1024 * 1024 * 8);
+ return @min(@truncate(c_int, max_pipe_size -| 32), 1024 * 1024 * 8);
}
}.once, c_int),
);
diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig
index dce75cf68..ed202830c 100644
--- a/src/bun.js/node/types.zig
+++ b/src/bun.js/node/types.zig
@@ -24,8 +24,8 @@ pub const Mode = if (Environment.isLinux) u32 else std.os.mode_t;
const heap_allocator = bun.default_allocator;
pub fn DeclEnum(comptime T: type) type {
const fieldInfos = std.meta.declarations(T);
- var enumFields: [fieldInfos.len]std.builtin.TypeInfo.EnumField = undefined;
- var decls = [_]std.builtin.TypeInfo.Declaration{};
+ var enumFields: [fieldInfos.len]std.builtin.Type.EnumField = undefined;
+ var decls = [_]std.builtin.Type.Declaration{};
inline for (fieldInfos) |field, i| {
enumFields[i] = .{
.name = field.name,
@@ -34,7 +34,6 @@ pub fn DeclEnum(comptime T: type) type {
}
return @Type(.{
.Enum = .{
- .layout = .Auto,
.tag_type = std.math.IntFittingRange(0, fieldInfos.len - 1),
.fields = &enumFields,
.decls = &decls,
@@ -787,7 +786,7 @@ pub fn timeLikeFromJS(ctx: JSC.C.JSContextRef, value_: JSC.JSValue, exception: J
return null;
}
- return @floatToInt(TimeLike, @maximum(@floor(seconds), std.math.minInt(TimeLike)));
+ return @floatToInt(TimeLike, @max(@floor(seconds), std.math.minInt(TimeLike)));
}
pub fn modeFromJS(ctx: JSC.C.JSContextRef, value: JSC.JSValue, exception: JSC.C.ExceptionRef) ?Mode {
@@ -837,7 +836,7 @@ pub const PathOrFileDescriptor = union(Tag) {
}
pub fn format(this: JSC.Node.PathOrFileDescriptor, comptime fmt: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
- if (fmt.len != 0 and fmt != "s") {
+ if (fmt.len != 0 and fmt[0] != 's') {
@compileError("Unsupported format argument: '" ++ fmt ++ "'.");
}
switch (this) {
@@ -869,7 +868,7 @@ pub const PathOrFileDescriptor = union(Tag) {
pub const FileSystemFlags = enum(Mode) {
/// Open file for appending. The file is created if it does not exist.
- @"a" = std.os.O.APPEND | std.os.O.WRONLY | std.os.O.CREAT,
+ a = std.os.O.APPEND | std.os.O.WRONLY | std.os.O.CREAT,
/// Like 'a' but fails if the path exists.
// @"ax" = std.os.O.APPEND | std.os.O.EXCL,
/// Open file for reading and appending. The file is created if it does not exist.
@@ -881,7 +880,7 @@ pub const FileSystemFlags = enum(Mode) {
/// Open file for reading and appending in synchronous mode. The file is created if it does not exist.
// @"as+" = std.os.O.APPEND | std.os.O.RDWR,
/// Open file for reading. An exception occurs if the file does not exist.
- @"r" = std.os.O.RDONLY,
+ r = std.os.O.RDONLY,
/// Open file for reading and writing. An exception occurs if the file does not exist.
// @"r+" = std.os.O.RDWR,
/// Open file for reading and writing in synchronous mode. Instructs the operating system to bypass the local file system cache.
@@ -889,7 +888,7 @@ pub const FileSystemFlags = enum(Mode) {
/// This doesn't turn fs.open() or fsPromises.open() into a synchronous blocking call. If synchronous operation is desired, something like fs.openSync() should be used.
// @"rs+" = std.os.O.RDWR,
/// Open file for writing. The file is created (if it does not exist) or truncated (if it exists).
- @"w" = std.os.O.WRONLY | std.os.O.CREAT,
+ w = std.os.O.WRONLY | std.os.O.CREAT,
/// Like 'w' but fails if the path exists.
// @"wx" = std.os.O.WRONLY | std.os.O.TRUNC,
// /// Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).
@@ -933,7 +932,7 @@ pub const FileSystemFlags = enum(Mode) {
val.toZigString(&zig_str, ctx.ptr());
var buf: [4]u8 = .{ 0, 0, 0, 0 };
- @memcpy(&buf, zig_str.ptr, @minimum(buf.len, zig_str.len));
+ @memcpy(&buf, zig_str.ptr, @min(buf.len, zig_str.len));
const Matcher = strings.ExactSizeMatcher(4);
// https://github.com/nodejs/node/blob/8c3637cd35cca352794e2c128f3bc5e6b6c41380/lib/internal/fs/utils.js#L565
@@ -989,9 +988,9 @@ pub const Date = enum(u64) {
_,
pub fn toJS(this: Date, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) JSC.C.JSValueRef {
- const seconds = @floatCast(f64, @intToFloat(f128, @enumToInt(this)) * 1000.0);
- const unix_timestamp = JSC.C.JSValueMakeNumber(ctx, seconds);
- const array: [1]JSC.C.JSValueRef = .{unix_timestamp};
+ const seconds = @floatCast(f64, @intToFloat(f64, @enumToInt(this)) * 1000.0);
+ const unix_timestamp = JSC.JSValue.jsNumber(seconds);
+ const array: [1]JSC.C.JSValueRef = .{unix_timestamp.asObjectRef()};
const obj = JSC.C.JSObjectMakeDate(ctx, 1, &array, exception);
return obj;
}
@@ -1141,9 +1140,9 @@ fn StatsLike(comptime name: [:0]const u8, comptime T: type) type {
.atime_ms = @truncate(T, @intCast(i64, if (atime.tv_nsec > 0) (@intCast(usize, atime.tv_nsec) / std.time.ns_per_ms) else 0)),
.mtime_ms = @truncate(T, @intCast(i64, if (mtime.tv_nsec > 0) (@intCast(usize, mtime.tv_nsec) / std.time.ns_per_ms) else 0)),
.ctime_ms = @truncate(T, @intCast(i64, if (ctime.tv_nsec > 0) (@intCast(usize, ctime.tv_nsec) / std.time.ns_per_ms) else 0)),
- .atime = @intToEnum(Date, @intCast(u64, @maximum(atime.tv_sec, 0))),
- .mtime = @intToEnum(Date, @intCast(u64, @maximum(mtime.tv_sec, 0))),
- .ctime = @intToEnum(Date, @intCast(u64, @maximum(ctime.tv_sec, 0))),
+ .atime = @intToEnum(Date, @intCast(u64, @max(atime.tv_sec, 0))),
+ .mtime = @intToEnum(Date, @intCast(u64, @max(mtime.tv_sec, 0))),
+ .ctime = @intToEnum(Date, @intCast(u64, @max(ctime.tv_sec, 0))),
// Linux doesn't include this info in stat
// maybe it does in statx, but do you really need birthtime? If you do please file an issue.
@@ -1155,7 +1154,7 @@ fn StatsLike(comptime name: [:0]const u8, comptime T: type) type {
.birthtime = if (Environment.isLinux)
@intToEnum(Date, 0)
else
- @intToEnum(Date, @intCast(u64, @maximum(stat_.birthtime().tv_sec, 0))),
+ @intToEnum(Date, @intCast(u64, @max(stat_.birthtime().tv_sec, 0))),
};
}
@@ -1226,121 +1225,74 @@ pub const BigIntStats = StatsLike("BigIntStats", i64);
/// When using the async iterator, the `fs.Dir` object will be automatically
/// closed after the iterator exits.
/// @since v12.12.0
-pub const DirEnt = struct {
+pub const Dirent = struct {
name: PathString,
// not publicly exposed
kind: Kind,
pub const Kind = std.fs.File.Kind;
+ pub usingnamespace JSC.Codegen.JSDirent;
+
+ pub fn constructor(globalObject: *JSC.JSGlobalObject, _: *JSC.CallFrame) callconv(.C) ?*Dirent {
+ globalObject.throw("Dirent is not a constructor", .{});
+ return null;
+ }
+
+ pub fn getName(this: *Dirent, globalObject: *JSC.JSGlobalObject) callconv(.C) JSC.JSValue {
+ return JSC.ZigString.fromUTF8(this.name.slice()).toValueGC(globalObject);
+ }
pub fn isBlockDevice(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.BlockDevice);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.BlockDevice);
}
pub fn isCharacterDevice(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.CharacterDevice);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.CharacterDevice);
}
pub fn isDirectory(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.Directory);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.Directory);
}
pub fn isFIFO(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.NamedPipe or this.kind == std.fs.File.Kind.EventPort);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.NamedPipe or this.kind == std.fs.File.Kind.EventPort);
}
pub fn isFile(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.File);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.File);
}
pub fn isSocket(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.UnixDomainSocket);
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.UnixDomainSocket);
}
pub fn isSymbolicLink(
- this: *DirEnt,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeBoolean(ctx, this.kind == std.fs.File.Kind.SymLink);
- }
-
- pub const Class = JSC.NewClass(DirEnt, .{ .name = "DirEnt" }, .{
- .isBlockDevice = .{
- .name = "isBlockDevice",
- .rfn = isBlockDevice,
- },
- .isCharacterDevice = .{
- .name = "isCharacterDevice",
- .rfn = isCharacterDevice,
- },
- .isDirectory = .{
- .name = "isDirectory",
- .rfn = isDirectory,
- },
- .isFIFO = .{
- .name = "isFIFO",
- .rfn = isFIFO,
- },
- .isFile = .{
- .name = "isFile",
- .rfn = isFile,
- },
- .isSocket = .{
- .name = "isSocket",
- .rfn = isSocket,
- },
- .isSymbolicLink = .{
- .name = "isSymbolicLink",
- .rfn = isSymbolicLink,
- },
- }, .{
- .name = .{
- .get = JSC.To.JS.Getter(DirEnt, .name),
- .name = "name",
- },
- });
+ this: *Dirent,
+ _: *JSC.JSGlobalObject,
+ _: *JSC.CallFrame,
+ ) callconv(.C) JSC.JSValue {
+ return JSC.JSValue.jsBoolean(this.kind == std.fs.File.Kind.SymLink);
+ }
- pub fn finalize(this: *DirEnt) void {
+ pub fn finalize(this: *Dirent) callconv(.C) void {
bun.default_allocator.free(this.name.slice());
bun.default_allocator.destroy(this);
}
@@ -1645,7 +1597,7 @@ pub const Path = struct {
if (u16_slice.len > 3)
buf[3] = u16_slice[3];
- return std.fs.path.isAbsoluteWindowsWTF16(buf[0..@minimum(u16_slice.len, buf.len)]);
+ return std.fs.path.isAbsoluteWindowsWTF16(buf[0..@min(u16_slice.len, buf.len)]);
}
return std.fs.path.isAbsoluteWindows(zig_str.slice());
@@ -1819,16 +1771,16 @@ pub const Path = struct {
}
pub const Export = shim.exportFunctions(.{
- .@"basename" = basename,
- .@"dirname" = dirname,
- .@"extname" = extname,
- .@"format" = format,
- .@"isAbsolute" = isAbsolute,
- .@"join" = join,
- .@"normalize" = normalize,
- .@"parse" = parse,
- .@"relative" = relative,
- .@"resolve" = resolve,
+ .basename = basename,
+ .dirname = dirname,
+ .extname = extname,
+ .format = format,
+ .isAbsolute = isAbsolute,
+ .join = join,
+ .normalize = normalize,
+ .parse = parse,
+ .relative = relative,
+ .resolve = resolve,
});
pub const Extern = [_][]const u8{"create"};
@@ -1962,14 +1914,14 @@ pub const Process = struct {
// When we update the cwd from JS, we have to update the bundler's version as well
// However, this might be called many times in a row, so we use a pre-allocated buffer
// that way we don't have to worry about garbage collector
- JSC.VirtualMachine.vm.bundler.fs.top_level_dir = std.os.getcwd(&JSC.VirtualMachine.vm.bundler.fs.top_level_dir_buf) catch {
- _ = Syscall.chdir(std.meta.assumeSentinel(JSC.VirtualMachine.vm.bundler.fs.top_level_dir, 0));
+ JSC.VirtualMachine.get().bundler.fs.top_level_dir = std.os.getcwd(&JSC.VirtualMachine.get().bundler.fs.top_level_dir_buf) catch {
+ _ = Syscall.chdir(std.meta.assumeSentinel(JSC.VirtualMachine.get().bundler.fs.top_level_dir, 0));
return JSC.toInvalidArguments("Invalid path", .{}, globalObject.ref());
};
- JSC.VirtualMachine.vm.bundler.fs.top_level_dir_buf[JSC.VirtualMachine.vm.bundler.fs.top_level_dir.len] = std.fs.path.sep;
- JSC.VirtualMachine.vm.bundler.fs.top_level_dir_buf[JSC.VirtualMachine.vm.bundler.fs.top_level_dir.len + 1] = 0;
- JSC.VirtualMachine.vm.bundler.fs.top_level_dir = JSC.VirtualMachine.vm.bundler.fs.top_level_dir_buf[0 .. JSC.VirtualMachine.vm.bundler.fs.top_level_dir.len + 1];
+ JSC.VirtualMachine.get().bundler.fs.top_level_dir_buf[JSC.VirtualMachine.get().bundler.fs.top_level_dir.len] = std.fs.path.sep;
+ JSC.VirtualMachine.get().bundler.fs.top_level_dir_buf[JSC.VirtualMachine.get().bundler.fs.top_level_dir.len + 1] = 0;
+ JSC.VirtualMachine.get().bundler.fs.top_level_dir = JSC.VirtualMachine.get().bundler.fs.top_level_dir_buf[0 .. JSC.VirtualMachine.get().bundler.fs.top_level_dir.len + 1];
return JSC.JSValue.jsUndefined();
},
@@ -1977,18 +1929,18 @@ pub const Process = struct {
}
pub fn exit(_: *JSC.JSGlobalObject, code: i32) callconv(.C) void {
- std.os.exit(@truncate(u8, @intCast(u32, @maximum(code, 0))));
- }
-
- pub export const Bun__version: [:0]const u8 = "v" ++ bun.Global.package_json_version;
- pub export const Bun__versions_mimalloc: [:0]const u8 = bun.Global.versions.mimalloc;
- pub export const Bun__versions_webkit: [:0]const u8 = bun.Global.versions.webkit;
- pub export const Bun__versions_libarchive: [:0]const u8 = bun.Global.versions.libarchive;
- pub export const Bun__versions_picohttpparser: [:0]const u8 = bun.Global.versions.picohttpparser;
- pub export const Bun__versions_boringssl: [:0]const u8 = bun.Global.versions.boringssl;
- pub export const Bun__versions_zlib: [:0]const u8 = bun.Global.versions.zlib;
- pub export const Bun__versions_zig: [:0]const u8 = bun.Global.versions.zig;
- pub export const Bun__version_sha: [:0]const u8 = bun.Environment.git_sha;
+ std.os.exit(@truncate(u8, @intCast(u32, @max(code, 0))));
+ }
+
+ pub export const Bun__version: [*:0]const u8 = "v" ++ bun.Global.package_json_version;
+ pub export const Bun__versions_mimalloc: [*:0]const u8 = bun.Global.versions.mimalloc;
+ pub export const Bun__versions_webkit: [*:0]const u8 = bun.Global.versions.webkit;
+ pub export const Bun__versions_libarchive: [*:0]const u8 = bun.Global.versions.libarchive;
+ pub export const Bun__versions_picohttpparser: [*:0]const u8 = bun.Global.versions.picohttpparser;
+ pub export const Bun__versions_boringssl: [*:0]const u8 = bun.Global.versions.boringssl;
+ pub export const Bun__versions_zlib: [*:0]const u8 = bun.Global.versions.zlib;
+ pub export const Bun__versions_zig: [*:0]const u8 = bun.Global.versions.zig;
+ pub export const Bun__version_sha: [*:0]const u8 = bun.Environment.git_sha;
};
comptime {
diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig
index 26869c19d..4f760c0d6 100644
--- a/src/bun.js/rare_data.zig
+++ b/src/bun.js/rare_data.zig
@@ -117,7 +117,7 @@ pub const CleanupHook = struct {
};
}
- pub const Function = fn (?*anyopaque) callconv(.C) void;
+ pub const Function = *const fn (?*anyopaque) callconv(.C) void;
};
pub fn pushCleanupHook(
@@ -126,7 +126,7 @@ pub fn pushCleanupHook(
ctx: ?*anyopaque,
func: CleanupHook.Function,
) void {
- var hook = JSC.VirtualMachine.vm.allocator.create(CleanupHook) catch unreachable;
+ var hook = JSC.VirtualMachine.get().allocator.create(CleanupHook) catch unreachable;
hook.* = CleanupHook.from(globalThis, ctx, func);
if (this.cleanup_hook == null) {
this.cleanup_hook = hook;
diff --git a/src/bun.js/scripts/generate-classes.ts b/src/bun.js/scripts/generate-classes.ts
index b08e573b4..01a42a5fe 100644
--- a/src/bun.js/scripts/generate-classes.ts
+++ b/src/bun.js/scripts/generate-classes.ts
@@ -8,6 +8,7 @@ const directoriesToSearch = [
resolve(`${import.meta.dir}/../api`),
resolve(`${import.meta.dir}/../test`),
resolve(`${import.meta.dir}/../webcore`),
+ resolve(`${import.meta.dir}/../node`),
];
function symbolName(typeName, name) {
@@ -1430,7 +1431,7 @@ function generateZig(
output += `
if (@TypeOf(${typeName}.${fn}) != CallbackType)
@compileLog(
- "Expected ${typeName}.${fn} to be a callback"
+ "Expected ${typeName}.${fn} to be a callback but received " ++ @typeName(@TypeOf(${typeName}.${fn}))
);`;
}
},
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig
index 7e6f59c2e..2a98d42f8 100644
--- a/src/bun.js/test/jest.zig
+++ b/src/bun.js/test/jest.zig
@@ -91,7 +91,7 @@ pub const TestRunner = struct {
this.pending_test = null;
// disable idling
- JSC.VirtualMachine.vm.uws_event_loop.?.wakeup();
+ JSC.VirtualMachine.get().uws_event_loop.?.wakeup();
}
pub fn drain(this: *TestRunner) void {
@@ -126,9 +126,9 @@ pub const TestRunner = struct {
}
pub const Callback = struct {
- pub const OnUpdateCount = fn (this: *Callback, delta: u32, total: u32) void;
- pub const OnTestStart = fn (this: *Callback, test_id: Test.ID) void;
- pub const OnTestUpdate = fn (this: *Callback, test_id: Test.ID, file: string, label: string, expectations: u32, parent: ?*DescribeScope) void;
+ pub const OnUpdateCount = *const fn (this: *Callback, delta: u32, total: u32) void;
+ pub const OnTestStart = *const fn (this: *Callback, test_id: Test.ID) void;
+ pub const OnTestUpdate = *const fn (this: *Callback, test_id: Test.ID, file: string, label: string, expectations: u32, parent: ?*DescribeScope) void;
onUpdateCount: OnUpdateCount,
onTestStart: OnTestStart,
onTestPass: OnTestUpdate,
@@ -251,7 +251,7 @@ pub const Expect = struct {
pub fn finalize(
this: *Expect,
) callconv(.C) void {
- VirtualMachine.vm.allocator.destroy(this);
+ VirtualMachine.get().allocator.destroy(this);
}
pub fn call(globalObject: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue {
@@ -1201,7 +1201,7 @@ pub const TestScope = struct {
exception: js.ExceptionRef,
is_only: bool,
) js.JSObjectRef {
- var args = bun.cast([]const JSC.JSValue, arguments[0..@minimum(arguments.len, 2)]);
+ var args = bun.cast([]const JSC.JSValue, arguments[0..@min(arguments.len, 2)]);
var label: string = "";
if (args.len == 0) {
return this;
@@ -1290,7 +1290,7 @@ pub const TestScope = struct {
task: *TestRunnerTask,
) Result {
if (comptime is_bindgen) return undefined;
- var vm = VirtualMachine.vm;
+ var vm = VirtualMachine.get();
var callback = this.callback;
defer {
js.JSValueUnprotect(vm.global, callback);
@@ -1325,7 +1325,7 @@ pub const TestScope = struct {
if (initial_value.jsType() == .JSPromise) {
if (this.promise != null) {
- return .{ .pending = .{} };
+ return .{ .pending = {} };
}
var promise: *JSC.JSPromise = initial_value.asPromise().?;
@@ -1430,13 +1430,13 @@ pub const DescribeScope = struct {
pub threadlocal var active: *DescribeScope = undefined;
pub threadlocal var module: *DescribeScope = undefined;
- const CallbackFn = fn (
- _: void,
- ctx: js.JSContextRef,
- _: js.JSObjectRef,
- _: js.JSObjectRef,
- arguments: []const js.JSValueRef,
- exception: js.ExceptionRef,
+ const CallbackFn = *const fn (
+ void,
+ js.JSContextRef,
+ js.JSObjectRef,
+ js.JSObjectRef,
+ []const js.JSValueRef,
+ js.ExceptionRef,
) js.JSObjectRef;
fn createCallback(comptime hook: LifecycleHook) CallbackFn {
@@ -1572,7 +1572,7 @@ pub const DescribeScope = struct {
var result = js.JSObjectCallAsFunctionReturnValue(ctx, callback, thisObject, 0, null);
if (result.asPromise() != null or result.asInternalPromise() != null) {
- var vm = JSC.VirtualMachine.vm;
+ var vm = JSC.VirtualMachine.get();
var promise = JSInternalPromise.resolvedPromise(ctx.ptr(), result);
vm.waitForPromise(promise);
@@ -1864,7 +1864,7 @@ pub const TestRunnerTask = struct {
}
fn deinit(this: *TestRunnerTask) void {
- var vm = JSC.VirtualMachine.vm;
+ var vm = JSC.VirtualMachine.get();
if (vm.onUnhandledRejectionCtx) |ctx| {
if (ctx == @ptrCast(*anyopaque, this)) {
vm.onUnhandledRejectionCtx = null;
diff --git a/src/bun.js/unbounded_queue.zig b/src/bun.js/unbounded_queue.zig
index fd092290d..bc609bc3b 100644
--- a/src/bun.js/unbounded_queue.zig
+++ b/src/bun.js/unbounded_queue.zig
@@ -19,8 +19,7 @@ pub const cache_line_length = switch (@import("builtin").target.cpu.arch) {
};
pub fn UnboundedQueue(comptime T: type, comptime next_field: meta.FieldEnum(T)) type {
- const next = meta.fieldInfo(T, next_field).name;
-
+ const next_name = meta.fieldInfo(T, next_field).name;
return struct {
const Self = @This();
@@ -31,7 +30,7 @@ pub fn UnboundedQueue(comptime T: type, comptime next_field: meta.FieldEnum(T))
pub fn next(self: *Self.Batch.Iterator) ?*T {
if (self.batch.count == 0) return null;
const front = self.batch.front orelse unreachable;
- self.batch.front = @field(front, next);
+ self.batch.front = @field(front, next_name);
self.batch.count -= 1;
return front;
}
@@ -45,6 +44,7 @@ pub fn UnboundedQueue(comptime T: type, comptime next_field: meta.FieldEnum(T))
return .{ .batch = self };
}
};
+ const next = next_name;
pub const queue_padding_length = cache_line_length / 2;
diff --git a/src/bun.js/webcore.zig b/src/bun.js/webcore.zig
index 2d1605049..a2aa39382 100644
--- a/src/bun.js/webcore.zig
+++ b/src/bun.js/webcore.zig
@@ -19,7 +19,7 @@ pub const Alert = struct {
void,
.{ .name = "alert" },
.{
- .@"call" = .{ .rfn = call },
+ .call = .{ .rfn = call },
},
.{},
);
@@ -41,7 +41,8 @@ pub const Alert = struct {
// 2. If the method was invoked with no arguments, then let message be the empty string; otherwise, let message be the method's first argument.
if (has_message) {
- const allocator = std.heap.stackFallback(2048, bun.default_allocator).get();
+ var state = std.heap.stackFallback(2048, bun.default_allocator);
+ const allocator = state.get();
const message = arguments[0].?.value().toSlice(ctx.ptr(), allocator);
defer message.deinit();
@@ -87,7 +88,7 @@ pub const Confirm = struct {
void,
.{ .name = "confirm" },
.{
- .@"call" = .{ .rfn = call },
+ .call = .{ .rfn = call },
},
.{},
);
@@ -108,7 +109,8 @@ pub const Confirm = struct {
const has_message = arguments.len != 0;
if (has_message) {
- const allocator = std.heap.stackFallback(1024, bun.default_allocator).get();
+ var state = std.heap.stackFallback(1024, bun.default_allocator);
+ const allocator = state.get();
// 2. Set message to the result of normalizing newlines given message.
// * Not pertinent to a server runtime so we will just let the terminal handle this.
@@ -179,7 +181,7 @@ pub const Prompt = struct {
void,
.{ .name = "prompt" },
.{
- .@"call" = .{ .rfn = call },
+ .call = .{ .rfn = call },
},
.{},
);
@@ -237,7 +239,8 @@ pub const Prompt = struct {
arguments: []const JSC.C.JSValueRef,
_: JSC.C.ExceptionRef,
) JSC.C.JSValueRef {
- var allocator = std.heap.stackFallback(2048, bun.default_allocator).get();
+ var state = std.heap.stackFallback(2048, bun.default_allocator);
+ const allocator = state.get();
var output = bun.Output.writer();
const has_message = arguments.len != 0;
const has_default = arguments.len >= 2;
@@ -366,7 +369,7 @@ pub const Crypto = struct {
.getRandomValues = JSC.DOMCall("Crypto", @This(), "getRandomValues", JSC.JSValue, JSC.DOMEffect.top),
.randomUUID = JSC.DOMCall("Crypto", @This(), "randomUUID", *JSC.JSString, JSC.DOMEffect.top),
.timingSafeEqual = JSC.DOMCall("Crypto", @This(), "timingSafeEqual", JSC.JSValue, JSC.DOMEffect.top),
- .scryptSync = .{ .rfn = JSC.wrapWithHasContainer(Crypto, "scryptSync", false, false, false) },
+ .scryptSync = .{ .rfn = &JSC.wrapWithHasContainer(Crypto, "scryptSync", false, false, false) },
},
.{},
);
diff --git a/src/bun.js/webcore/encoding.zig b/src/bun.js/webcore/encoding.zig
index c3444c71f..9573b1f3a 100644
--- a/src/bun.js/webcore/encoding.zig
+++ b/src/bun.js/webcore/encoding.zig
@@ -248,7 +248,7 @@ comptime {
/// https://encoding.spec.whatwg.org/encodings.json
pub const EncodingLabel = enum {
@"UTF-8",
- @"IBM866",
+ IBM866,
@"ISO-8859-2",
@"ISO-8859-3",
@"ISO-8859-4",
@@ -264,7 +264,7 @@ pub const EncodingLabel = enum {
@"ISO-8859-16",
@"KOI8-R",
@"KOI8-U",
- @"macintosh",
+ macintosh,
@"windows-874",
@"windows-1250",
@"windows-1251",
@@ -279,10 +279,10 @@ pub const EncodingLabel = enum {
@"windows-1257",
@"windows-1258",
@"x-mac-cyrillic",
- @"Big5",
+ Big5,
@"EUC-JP",
@"ISO-2022-JP",
- @"Shift_JIS",
+ Shift_JIS,
@"EUC-KR",
@"UTF-16BE",
@"UTF-16LE",
@@ -402,7 +402,7 @@ pub const TextDecoder = struct {
scratch_memory: []u8 = &[_]u8{},
ignore_bom: bool = false,
fatal: bool = false,
- encoding: EncodingLabel = EncodingLabel.utf8,
+ encoding: EncodingLabel = EncodingLabel.@"UTF-8",
pub fn finalize(this: *TextDecoder) callconv(.C) void {
bun.default_allocator.destroy(this);
@@ -499,7 +499,7 @@ pub const TextDecoder = struct {
var buffer = std.ArrayListAlignedUnmanaged(u16, @alignOf(@TypeOf(slice.ptr))){};
// copy the allocator to reduce the number of threadlocal accesses
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
buffer.ensureTotalCapacity(allocator, slice.len) catch unreachable;
buffer.items.len = i;
@@ -560,7 +560,7 @@ pub const TextDecoder = struct {
}
}
- var full = buffer.toOwnedSlice(allocator);
+ var full = buffer.toOwnedSlice(allocator) catch @panic("TODO");
var out = ZigString.init("");
out.ptr = @ptrCast([*]u8, full.ptr);
@@ -587,7 +587,7 @@ pub const TextDecoder = struct {
}
switch (this.encoding) {
- EncodingLabel.@"latin1" => {
+ EncodingLabel.latin1 => {
return ZigString.init(array_buffer.byteSlice()).toValueGC(globalThis);
},
EncodingLabel.@"UTF-8" => {
@@ -608,10 +608,6 @@ pub const TextDecoder = struct {
globalThis.throw("Out of memory", .{});
return JSValue.zero;
},
- else => {
- globalThis.throw("Unknown error", .{});
- return JSValue.zero;
- },
}
}
} else {
@@ -625,10 +621,6 @@ pub const TextDecoder = struct {
globalThis.throw("Out of memory", .{});
return JSValue.zero;
},
- else => {
- globalThis.throw("Unknown error", .{});
- return JSValue.zero;
- },
}
}
}
@@ -654,7 +646,7 @@ pub const TextDecoder = struct {
pub fn decodeWithoutTypeChecks(this: *TextDecoder, globalThis: *JSC.JSGlobalObject, uint8array: *JSC.JSUint8Array) callconv(.C) JSValue {
const buffer_slice = uint8array.slice();
switch (this.encoding) {
- EncodingLabel.@"latin1" => {
+ EncodingLabel.latin1 => {
return ZigString.init(buffer_slice).toValueGC(globalThis);
},
EncodingLabel.@"UTF-8" => {
@@ -673,10 +665,6 @@ pub const TextDecoder = struct {
globalThis.throw("Out of memory", .{});
return JSValue.zero;
},
- else => {
- globalThis.throw("Unknown error", .{});
- return JSValue.zero;
- },
}
}
} else {
@@ -690,10 +678,6 @@ pub const TextDecoder = struct {
globalThis.throw("Out of memory", .{});
return JSValue.zero;
},
- else => {
- globalThis.throw("Unknown error", .{});
- return JSValue.zero;
- },
}
}
}
@@ -852,7 +836,7 @@ pub const Encoder = struct {
return ZigString.Empty.toValue(global);
const input = input_ptr[0..len];
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
switch (comptime encoding) {
.ascii => {
@@ -931,13 +915,13 @@ pub const Encoder = struct {
switch (comptime encoding) {
JSC.Node.Encoding.buffer => {
- const written = @minimum(len, to_len);
+ const written = @min(len, to_len);
@memcpy(to, input, written);
return @intCast(i64, written);
},
.latin1, .ascii => {
- const written = @minimum(len, to_len);
+ const written = @min(len, to_len);
@memcpy(to, input, written);
// Hoping this gets auto vectorized
@@ -972,7 +956,7 @@ pub const Encoder = struct {
},
JSC.Node.Encoding.base64url => {
- var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.VT});
+ var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.vt});
if (slice.len == 0)
return 0;
@@ -1033,7 +1017,7 @@ pub const Encoder = struct {
.latin1, JSC.Node.Encoding.ascii, JSC.Node.Encoding.ucs2, JSC.Node.Encoding.buffer, JSC.Node.Encoding.utf16le => {
strings.copyU16IntoU8(to[0..to_len], []const u16, input[0..len]);
- return @intCast(i64, @minimum(len, to_len));
+ return @intCast(i64, @min(len, to_len));
},
JSC.Node.Encoding.hex => {
@@ -1084,7 +1068,7 @@ pub const Encoder = struct {
if (len == 0)
return &[_]u8{};
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
switch (comptime encoding) {
JSC.Node.Encoding.buffer => {
@@ -1121,7 +1105,7 @@ pub const Encoder = struct {
},
JSC.Node.Encoding.base64url => {
- var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.VT});
+ var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.vt});
if (slice.len == 0)
return &[_]u8{};
@@ -1138,7 +1122,7 @@ pub const Encoder = struct {
},
JSC.Node.Encoding.base64 => {
- var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.VT});
+ var slice = strings.trim(input[0..len], "\r\n\t " ++ [_]u8{std.ascii.control_code.vt});
var outlen = bun.base64.decodeLen(slice);
var to = allocator.alloc(u8, outlen) catch return &[_]u8{};
@@ -1153,7 +1137,7 @@ pub const Encoder = struct {
if (len == 0)
return &[_]u8{};
- const allocator = VirtualMachine.vm.allocator;
+ const allocator = VirtualMachine.get().allocator;
switch (comptime encoding) {
.utf8 => {
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig
index 333c27c40..1ed29f196 100644
--- a/src/bun.js/webcore/response.zig
+++ b/src/bun.js/webcore/response.zig
@@ -45,6 +45,7 @@ const StringJoiner = @import("../../string_joiner.zig");
const uws = @import("bun").uws;
pub const Response = struct {
+ const ResponseMixin = BodyMixin(@This());
pub usingnamespace JSC.Codegen.JSResponse;
allocator: std.mem.Allocator,
@@ -56,6 +57,13 @@ pub const Response = struct {
// We must report a consistent value for this
reported_estimated_size: ?u63 = null,
+ pub const getText = ResponseMixin.getText;
+ pub const getBody = ResponseMixin.getBody;
+ pub const getBodyUsed = ResponseMixin.getBodyUsed;
+ pub const getJSON = ResponseMixin.getJSON;
+ pub const getArrayBuffer = ResponseMixin.getArrayBuffer;
+ pub const getBlob = ResponseMixin.getBlob;
+
pub fn estimatedSize(this: *Response) callconv(.C) usize {
return this.reported_estimated_size orelse brk: {
this.reported_estimated_size = @intCast(
@@ -229,8 +237,6 @@ pub const Response = struct {
return new_response;
}
- pub usingnamespace BodyMixin(@This());
-
pub fn getStatus(
this: *Response,
_: *JSC.JSGlobalObject,
@@ -319,7 +325,7 @@ pub const Response = struct {
.init = Body.Init{
.status_code = 200,
},
- .value = Body.Value.empty,
+ .value = .{ .Empty = {} },
},
.allocator = getAllocator(globalThis),
.url = "",
@@ -351,7 +357,7 @@ pub const Response = struct {
if (args.nextEat()) |init| {
if (init.isUndefinedOrNull()) {} else if (init.isNumber()) {
- response.body.init.status_code = @intCast(u16, @minimum(@maximum(0, init.toInt32()), std.math.maxInt(u16)));
+ response.body.init.status_code = @intCast(u16, @min(@max(0, init.toInt32()), std.math.maxInt(u16)));
} else {
if (Body.Init.init(getAllocator(globalThis), globalThis, init, init.jsType()) catch null) |_init| {
response.body.init = _init;
@@ -380,7 +386,7 @@ pub const Response = struct {
.init = Body.Init{
.status_code = 302,
},
- .value = Body.Value.empty,
+ .value = .{ .Empty = {} },
},
.allocator = getAllocator(globalThis),
.url = "",
@@ -397,7 +403,7 @@ pub const Response = struct {
if (args.nextEat()) |init| {
if (init.isUndefinedOrNull()) {} else if (init.isNumber()) {
- response.body.init.status_code = @intCast(u16, @minimum(@maximum(0, init.toInt32()), std.math.maxInt(u16)));
+ response.body.init.status_code = @intCast(u16, @min(@max(0, init.toInt32()), std.math.maxInt(u16)));
} else {
if (Body.Init.init(getAllocator(globalThis), globalThis, init, init.jsType()) catch null) |_init| {
response.body.init = _init;
@@ -424,7 +430,7 @@ pub const Response = struct {
.init = Body.Init{
.status_code = 0,
},
- .value = Body.Value.empty,
+ .value = .{ .Empty = {} },
},
.allocator = getAllocator(globalThis),
.url = "",
@@ -541,7 +547,7 @@ pub const Fetch = struct {
void,
.{ .name = "fetch" },
.{
- .@"call" = .{
+ .call = .{
.rfn = Fetch.call,
.ts = d.ts{},
},
@@ -854,7 +860,8 @@ pub const Fetch = struct {
}
if (options.fastGet(ctx.ptr(), .body)) |body__| {
- if (Body.Value.fromJS(ctx.ptr(), body__)) |*body_value| {
+ if (Body.Value.fromJS(ctx.ptr(), body__)) |body_const| {
+ var body_value = body_const;
// TODO: buffer ReadableStream?
// we have to explicitly check for InternalBlob
body = body_value.useAsAnyBlob();
@@ -1883,7 +1890,7 @@ pub const Blob = struct {
return this.opened_fd;
}
- pub const OpenCallback = fn (*This, bun.FileDescriptor) void;
+ pub const OpenCallback = *const fn (*This, bun.FileDescriptor) void;
pub fn getFd(this: *This, comptime Callback: OpenCallback) void {
if (this.opened_fd != null_fd) {
@@ -1898,7 +1905,7 @@ pub const Blob = struct {
}
}
- const WrappedOpenCallback = fn (*State, *HTTPClient.NetworkThread.Completion, AsyncIO.OpenError!bun.FileDescriptor) void;
+ const WrappedOpenCallback = *const fn (*State, *HTTPClient.NetworkThread.Completion, AsyncIO.OpenError!bun.FileDescriptor) void;
fn OpenCallbackWrapper(comptime Callback: OpenCallback) WrappedOpenCallback {
return struct {
const callback = Callback;
@@ -2014,7 +2021,7 @@ pub const Blob = struct {
};
pub const ResultType = SystemError.Maybe(Read);
- pub const OnReadFileCallback = fn (ctx: *anyopaque, bytes: ResultType) void;
+ pub const OnReadFileCallback = *const fn (ctx: *anyopaque, bytes: ResultType) void;
pub usingnamespace FileOpenerMixin(ReadFile);
pub usingnamespace FileCloserMixin(ReadFile);
@@ -2069,7 +2076,7 @@ pub const Blob = struct {
onRead,
&this.read_completion,
this.opened_fd,
- remaining[0..@minimum(remaining.len, this.max_length - this.read_off)],
+ remaining[0..@min(remaining.len, this.max_length - this.read_off)],
this.offset + this.read_off,
);
}
@@ -2155,7 +2162,7 @@ pub const Blob = struct {
const file = &this.file_store;
const needs_close = fd != null_fd and file.pathlike == .path and fd > 2;
- this.size = @maximum(this.read_len, this.size);
+ this.size = @max(this.read_len, this.size);
if (needs_close) {
this.doClose();
@@ -2190,8 +2197,8 @@ pub const Blob = struct {
}
if (stat.size > 0 and std.os.S.ISREG(stat.mode)) {
- this.size = @minimum(
- @truncate(SizeType, @intCast(SizeType, @maximum(@intCast(i64, stat.size), 0))),
+ this.size = @min(
+ @truncate(SizeType, @intCast(SizeType, @max(@intCast(i64, stat.size), 0))),
this.max_length,
);
// read up to 4k at a time if
@@ -2232,7 +2239,7 @@ pub const Blob = struct {
fn doReadLoop(this: *ReadFile) void {
this.read_off += this.read_len;
- var remain = this.buffer[@minimum(this.read_off, @truncate(Blob.SizeType, this.buffer.len))..];
+ var remain = this.buffer[@min(this.read_off, @truncate(Blob.SizeType, this.buffer.len))..];
if (remain.len > 0 and this.errno == null) {
this.doRead();
@@ -2262,7 +2269,7 @@ pub const Blob = struct {
wrote: usize = 0,
pub const ResultType = SystemError.Maybe(SizeType);
- pub const OnWriteFileCallback = fn (ctx: *anyopaque, count: ResultType) void;
+ pub const OnWriteFileCallback = *const fn (ctx: *anyopaque, count: ResultType) void;
pub usingnamespace FileOpenerMixin(WriteFile);
pub usingnamespace FileCloserMixin(WriteFile);
@@ -2404,7 +2411,7 @@ pub const Blob = struct {
var file_offset = this.file_blob.offset;
const this_tick = file_offset + this.wrote;
- remain = remain[@minimum(this.wrote, remain.len)..];
+ remain = remain[@min(this.wrote, remain.len)..];
if (remain.len > 0 and this.errno == null) {
this.doWrite(remain, this_tick);
@@ -2452,7 +2459,7 @@ pub const Blob = struct {
pub const ResultType = anyerror!SizeType;
- pub const Callback = fn (ctx: *anyopaque, len: ResultType) void;
+ pub const Callback = *const fn (ctx: *anyopaque, len: ResultType) void;
pub const CopyFilePromiseTask = JSC.ConcurrentPromiseTask(CopyFile);
pub const CopyFilePromiseTaskEventLoopTask = CopyFilePromiseTask.EventLoopTask;
@@ -2815,7 +2822,7 @@ pub const Blob = struct {
}
if (stat.size != 0) {
- this.max_length = @maximum(@minimum(@intCast(SizeType, stat.size), this.max_length), this.offset) - this.offset;
+ this.max_length = @max(@min(@intCast(SizeType, stat.size), this.max_length), this.offset) - this.offset;
if (this.max_length == 0) {
this.doClose();
return;
@@ -2967,7 +2974,7 @@ pub const Blob = struct {
return JSValue.jsUndefined();
}
- recommended_chunk_size = @intCast(SizeType, @maximum(0, @truncate(i52, arguments[0].toInt64())));
+ recommended_chunk_size = @intCast(SizeType, @max(0, @truncate(i52, arguments[0].toInt64())));
}
return JSC.WebCore.ReadableStream.fromBlob(
globalThis,
@@ -3133,10 +3140,10 @@ pub const Blob = struct {
const start = start_.toInt64();
if (start < 0) {
// If the optional start parameter is negative, let relativeStart be start + size.
- relativeStart = @intCast(i64, @maximum(start + @intCast(i64, this.size), 0));
+ relativeStart = @intCast(i64, @max(start + @intCast(i64, this.size), 0));
} else {
// Otherwise, let relativeStart be start.
- relativeStart = @minimum(@intCast(i64, start), @intCast(i64, this.size));
+ relativeStart = @min(@intCast(i64, start), @intCast(i64, this.size));
}
}
@@ -3145,10 +3152,10 @@ pub const Blob = struct {
// If end is negative, let relativeEnd be max((size + end), 0).
if (end < 0) {
// If the optional start parameter is negative, let relativeStart be start + size.
- relativeEnd = @intCast(i64, @maximum(end + @intCast(i64, this.size), 0));
+ relativeEnd = @intCast(i64, @max(end + @intCast(i64, this.size), 0));
} else {
// Otherwise, let relativeStart be start.
- relativeEnd = @minimum(@intCast(i64, end), @intCast(i64, this.size));
+ relativeEnd = @min(@intCast(i64, end), @intCast(i64, this.size));
}
}
@@ -3164,7 +3171,7 @@ pub const Blob = struct {
}
}
- const len = @intCast(SizeType, @maximum(relativeEnd - relativeStart, 0));
+ const len = @intCast(SizeType, @max(relativeEnd - relativeStart, 0));
// This copies over the is_all_ascii flag
// which is okay because this will only be a <= slice
@@ -3235,7 +3242,7 @@ pub const Blob = struct {
const offset = this.offset;
const store_size = store.size();
if (store_size != Blob.max_size) {
- this.offset = @minimum(store_size, offset);
+ this.offset = @min(store_size, offset);
this.size = store_size - offset;
}
@@ -3247,7 +3254,7 @@ pub const Blob = struct {
switch (JSC.Node.Syscall.stat(store.data.file.pathlike.path.sliceZ(&buffer))) {
.result => |stat| {
store.data.file.max_size = if (std.os.S.ISREG(stat.mode) or stat.size > 0)
- @truncate(SizeType, @intCast(u64, @maximum(stat.size, 0)))
+ @truncate(SizeType, @intCast(u64, @max(stat.size, 0)))
else
Blob.max_size;
store.data.file.mode = stat.mode;
@@ -3260,7 +3267,7 @@ pub const Blob = struct {
switch (JSC.Node.Syscall.fstat(store.data.file.pathlike.fd)) {
.result => |stat| {
store.data.file.max_size = if (std.os.S.ISREG(stat.mode) or stat.size > 0)
- @truncate(SizeType, @intCast(u64, @maximum(stat.size, 0)))
+ @truncate(SizeType, @intCast(u64, @max(stat.size, 0)))
else
Blob.max_size;
store.data.file.mode = stat.mode;
@@ -3276,7 +3283,7 @@ pub const Blob = struct {
const store_size = store.data.file.max_size;
const offset = this.offset;
- this.offset = @minimum(store_size, offset);
+ this.offset = @min(store_size, offset);
this.size = store_size -| offset;
return;
}
@@ -3457,7 +3464,7 @@ pub const Blob = struct {
if (slice_.len == 0) return "";
slice_ = slice_[this.offset..];
- return slice_[0..@minimum(slice_.len, @as(usize, this.size))];
+ return slice_[0..@min(slice_.len, @as(usize, this.size))];
}
pub const Lifetime = JSC.WebCore.Lifetime;
@@ -3488,7 +3495,7 @@ pub const Blob = struct {
.result => |result| {
const bytes = result.buf;
if (blob.size > 0)
- blob.size = @minimum(@truncate(u32, bytes.len), blob.size);
+ blob.size = @min(@truncate(u32, bytes.len), blob.size);
const value = Function(&blob, globalThis, bytes, .temporary);
// invalid JSON needs to be rejected
@@ -4322,7 +4329,7 @@ pub const InlineBlob = extern struct {
// https://developer.mozilla.org/en-US/docs/Web/API/Body
pub const Body = struct {
init: Init = Init{ .headers = null, .status_code = 200 },
- value: Value = Value.empty,
+ value: Value, // = Value.empty,
pub inline fn len(this: *const Body) Blob.SizeType {
return this.value.size();
@@ -4465,13 +4472,13 @@ pub const Body = struct {
task: ?*anyopaque = null,
/// runs after the data is available.
- onReceiveValue: ?fn (ctx: *anyopaque, value: *Value) void = null,
+ onReceiveValue: ?*const fn (ctx: *anyopaque, value: *Value) void = null,
/// conditionally runs when requesting data
/// used in HTTP server to ignore request bodies unless asked for it
- onStartBuffering: ?fn (ctx: *anyopaque) void = null,
+ onStartBuffering: ?*const fn (ctx: *anyopaque) void = null,
- onStartStreaming: ?fn (ctx: *anyopaque) JSC.WebCore.DrainResult = null,
+ onStartStreaming: ?*const fn (ctx: *anyopaque) JSC.WebCore.DrainResult = null,
deinit: bool = false,
action: Action = Action.none,
@@ -4623,7 +4630,7 @@ pub const Body = struct {
Error,
};
- pub const empty = Value{ .Empty = .{} };
+ // pub const empty = Value{ .Empty = void{} };
pub fn toReadableStream(this: *Value, globalThis: *JSGlobalObject) JSValue {
JSC.markBinding(@src());
@@ -4956,7 +4963,7 @@ pub const Body = struct {
.Blob => {
var new_blob = this.Blob;
std.debug.assert(new_blob.allocator == null); // owned by Body
- this.* = .{ .Used = .{} };
+ this.* = .{ .Used = {} };
return new_blob;
},
.InternalBlob => {
@@ -4966,13 +4973,13 @@ pub const Body = struct {
// we have to use the default allocator
// even if it was actually allocated on a different thread
bun.default_allocator,
- JSC.VirtualMachine.vm.global,
+ JSC.VirtualMachine.get().global,
);
if (this.InternalBlob.was_string) {
new_blob.content_type = MimeType.text.value;
}
- this.* = .{ .Used = .{} };
+ this.* = .{ .Used = {} };
return new_blob;
},
// .InlineBlob => {
@@ -4980,11 +4987,11 @@ pub const Body = struct {
// const new_blob = Blob.create(
// cloned[0..this.InlineBlob.len],
// bun.default_allocator,
- // JSC.VirtualMachine.vm.global,
+ // JSC.VirtualMachine.get().global,
// this.InlineBlob.was_string,
// );
- // this.* = .{ .Used = .{} };
+ // this.* = .{ .Used = {} };
// return new_blob;
// },
else => {
@@ -5002,7 +5009,7 @@ pub const Body = struct {
else => return null,
};
- this.* = .{ .Used = .{} };
+ this.* = .{ .Used = {} };
return any_blob;
}
@@ -5082,16 +5089,16 @@ pub const Body = struct {
if (tag == .InternalBlob) {
this.InternalBlob.clearAndFree();
- this.* = Value.empty;
+ this.* = Value{ .Empty = {} }; //Value.empty;
}
if (tag == .Blob) {
this.Blob.deinit();
- this.* = Value.empty;
+ this.* = Value{ .Empty = {} }; //Value.empty;
}
if (tag == .Error) {
- JSC.C.JSValueUnprotect(VirtualMachine.vm.global, this.Error.asObjectRef());
+ JSC.C.JSValueUnprotect(VirtualMachine.get().global, this.Error.asObjectRef());
}
}
@@ -5115,7 +5122,7 @@ pub const Body = struct {
return Value{ .Blob = this.Blob.dupe() };
}
- return Value{ .Empty = .{} };
+ return Value{ .Empty = {} };
}
};
@@ -5125,7 +5132,7 @@ pub const Body = struct {
.headers = null,
.status_code = 404,
},
- .value = Value.empty,
+ .value = Value{ .Empty = {} }, //Value.empty,
};
}
@@ -5134,7 +5141,7 @@ pub const Body = struct {
.init = Init{
.status_code = 200,
},
- .value = Value.empty,
+ .value = Value{ .Empty = {} }, //Value.empty,
};
}
@@ -5175,6 +5182,7 @@ pub const Body = struct {
init_type: JSC.JSValue.JSType,
) ?Body {
var body = Body{
+ .value = Value{ .Empty = {} },
.init = Init{ .headers = null, .status_code = 200 },
};
var allocator = getAllocator(globalThis);
@@ -5201,7 +5209,7 @@ pub const Request = struct {
url_was_allocated: bool = false,
headers: ?*FetchHeaders = null,
- body: Body.Value = Body.Value{ .Empty = .{} },
+ body: Body.Value = Body.Value{ .Empty = {} },
method: Method = Method.GET,
uws_request: ?*uws.Request = null,
https: bool = false,
@@ -5210,8 +5218,16 @@ pub const Request = struct {
// We must report a consistent value for this
reported_estimated_size: ?u63 = null,
+ const RequestMixin = BodyMixin(@This());
pub usingnamespace JSC.Codegen.JSRequest;
+ pub const getText = RequestMixin.getText;
+ pub const getBody = RequestMixin.getBody;
+ pub const getBodyUsed = RequestMixin.getBodyUsed;
+ pub const getJSON = RequestMixin.getJSON;
+ pub const getArrayBuffer = RequestMixin.getArrayBuffer;
+ pub const getBlob = RequestMixin.getBlob;
+
pub fn estimatedSize(this: *Request) callconv(.C) usize {
return this.reported_estimated_size orelse brk: {
this.reported_estimated_size = @truncate(u63, this.body.estimatedSize() + this.sizeOfURL() + @sizeOf(Request));
@@ -5267,7 +5283,7 @@ pub const Request = struct {
pub fn fromRequestContext(ctx: *RequestContext) !Request {
var req = Request{
.url = std.mem.span(ctx.getFullURL()),
- .body = Body.Value.empty,
+ .body = .{ .Empty = {} },
.method = ctx.method,
.headers = FetchHeaders.createFromPicoHeaders(ctx.request.headers),
.url_was_allocated = true,
@@ -5533,8 +5549,6 @@ pub const Request = struct {
return &this.body;
}
- pub usingnamespace BodyMixin(@This());
-
pub fn doClone(
this: *Request,
globalThis: *JSC.JSGlobalObject,
@@ -5709,7 +5723,7 @@ pub const FetchEvent = struct {
pending_promise: JSValue = JSValue.zero,
onPromiseRejectionCtx: *anyopaque = undefined,
- onPromiseRejectionHandler: ?fn (ctx: *anyopaque, err: anyerror, fetch_event: *FetchEvent, value: JSValue) void = null,
+ onPromiseRejectionHandler: ?*const fn (ctx: *anyopaque, err: anyerror, fetch_event: *FetchEvent, value: JSValue) void = null,
rejected: bool = false,
pub const Class = NewClass(
@@ -5720,7 +5734,7 @@ pub const FetchEvent = struct {
.ts = .{ .class = d.ts.class{ .interface = true } },
},
.{
- .@"respondWith" = .{
+ .respondWith = .{
.rfn = respondWith,
.ts = d.ts{
.tsdoc = "Render the response in the active HTTP request",
@@ -5730,20 +5744,20 @@ pub const FetchEvent = struct {
},
},
},
- .@"waitUntil" = waitUntil,
+ .waitUntil = waitUntil,
.finalize = finalize,
},
.{
- .@"client" = .{
- .@"get" = getClient,
+ .client = .{
+ .get = getClient,
.ro = true,
.ts = d.ts{
.tsdoc = "HTTP client metadata. This is not implemented yet, do not use.",
.@"return" = "undefined",
},
},
- .@"request" = .{
- .@"get" = getRequest,
+ .request = .{
+ .get = getRequest,
.ro = true,
.ts = d.ts{
.tsdoc = "HTTP request",
@@ -5756,7 +5770,7 @@ pub const FetchEvent = struct {
pub fn finalize(
this: *FetchEvent,
) void {
- VirtualMachine.vm.allocator.destroy(this);
+ VirtualMachine.get().allocator.destroy(this);
}
pub fn getClient(
@@ -5877,15 +5891,15 @@ pub const FetchEvent = struct {
};
defer {
- if (!VirtualMachine.vm.had_errors) {
+ if (!VirtualMachine.get().had_errors) {
Output.printElapsed(@intToFloat(f64, (request_context.timer.lap())) / std.time.ns_per_ms);
Output.prettyError(
" <b>{s}<r><d> - <b>{d}<r> <d>transpiled, <d><b>{d}<r> <d>imports<r>\n",
.{
request_context.matched_route.?.name,
- VirtualMachine.vm.transpiled_count,
- VirtualMachine.vm.resolved_count,
+ VirtualMachine.get().transpiled_count,
+ VirtualMachine.get().resolved_count,
},
);
}
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index 176a96655..c355ae13d 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -433,7 +433,7 @@ pub const StreamStart = union(Tag) {
if (value.get(globalThis, "highWaterMark")) |chunkSize| {
empty = false;
- chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @maximum(0, @truncate(i51, chunkSize.toInt64())));
+ chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @max(0, @truncate(i51, chunkSize.toInt64())));
}
if (!empty) {
@@ -450,7 +450,7 @@ pub const StreamStart = union(Tag) {
var chunk_size: JSC.WebCore.Blob.SizeType = 0;
if (value.get(globalThis, "highWaterMark")) |chunkSize| {
- chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @maximum(0, @truncate(i51, chunkSize.toInt64())));
+ chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @max(0, @truncate(i51, chunkSize.toInt64())));
}
if (value.get(globalThis, "path")) |path| {
@@ -486,7 +486,7 @@ pub const StreamStart = union(Tag) {
if (value.get(globalThis, "highWaterMark")) |chunkSize| {
empty = false;
- chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @maximum(256, @truncate(i51, chunkSize.toInt64())));
+ chunk_size = @intCast(JSC.WebCore.Blob.SizeType, @max(256, @truncate(i51, chunkSize.toInt64())));
}
if (!empty) {
@@ -585,14 +585,14 @@ pub const StreamResult = union(Tag) {
ctx: *anyopaque,
handler: Fn,
- pub const Fn = fn (ctx: *anyopaque, result: StreamResult.Writable) void;
+ pub const Fn = *const fn (ctx: *anyopaque, result: StreamResult.Writable) void;
pub fn init(this: *Handler, comptime Context: type, ctx: *Context, comptime handler_fn: fn (*Context, StreamResult.Writable) void) void {
this.ctx = ctx;
this.handler = struct {
const handler = handler_fn;
pub fn onHandle(ctx_: *anyopaque, result: StreamResult.Writable) void {
- @call(.{ .modifier = .always_inline }, handler, .{ bun.cast(*Context, ctx_), result });
+ @call(.always_inline, handler, .{ bun.cast(*Context, ctx_), result });
}
}.onHandle;
}
@@ -708,14 +708,14 @@ pub const StreamResult = union(Tag) {
ctx: *anyopaque,
handler: Fn,
- pub const Fn = fn (ctx: *anyopaque, result: StreamResult) void;
+ pub const Fn = *const fn (ctx: *anyopaque, result: StreamResult) void;
pub fn init(this: *Handler, comptime Context: type, ctx: *Context, comptime handler_fn: fn (*Context, StreamResult) void) void {
this.ctx = ctx;
this.handler = struct {
const handler = handler_fn;
pub fn onHandle(ctx_: *anyopaque, result: StreamResult) void {
- @call(.{ .modifier = .always_inline }, handler, .{ bun.cast(*Context, ctx_), result });
+ @call(.always_inline, handler, .{ bun.cast(*Context, ctx_), result });
}
}.onHandle;
}
@@ -852,9 +852,9 @@ pub const Signal = struct {
}
pub const VTable = struct {
- pub const OnCloseFn = fn (this: *anyopaque, err: ?Syscall.Error) void;
- pub const OnReadyFn = fn (this: *anyopaque, amount: ?Blob.SizeType, offset: ?Blob.SizeType) void;
- pub const OnStartFn = fn (this: *anyopaque) void;
+ pub const OnCloseFn = *const (fn (this: *anyopaque, err: ?Syscall.Error) void);
+ pub const OnReadyFn = *const (fn (this: *anyopaque, amount: ?Blob.SizeType, offset: ?Blob.SizeType) void);
+ pub const OnStartFn = *const (fn (this: *anyopaque) void);
close: OnCloseFn,
ready: OnReadyFn,
start: OnStartFn,
@@ -1007,11 +1007,11 @@ pub const Sink = struct {
};
pub const VTable = struct {
- pub const WriteUTF16Fn = fn (this: *anyopaque, data: StreamResult) StreamResult.Writable;
- pub const WriteUTF8Fn = fn (this: *anyopaque, data: StreamResult) StreamResult.Writable;
- pub const WriteLatin1Fn = fn (this: *anyopaque, data: StreamResult) StreamResult.Writable;
- pub const EndFn = fn (this: *anyopaque, err: ?Syscall.Error) JSC.Node.Maybe(void);
- pub const ConnectFn = fn (this: *anyopaque, signal: Signal) JSC.Node.Maybe(void);
+ pub const WriteUTF16Fn = *const (fn (this: *anyopaque, data: StreamResult) StreamResult.Writable);
+ pub const WriteUTF8Fn = *const (fn (this: *anyopaque, data: StreamResult) StreamResult.Writable);
+ pub const WriteLatin1Fn = *const (fn (this: *anyopaque, data: StreamResult) StreamResult.Writable);
+ pub const EndFn = *const (fn (this: *anyopaque, err: ?Syscall.Error) JSC.Node.Maybe(void));
+ pub const ConnectFn = *const (fn (this: *anyopaque, signal: Signal) JSC.Node.Maybe(void));
connect: ConnectFn,
write: WriteUTF8Fn,
@@ -1150,9 +1150,9 @@ pub const FileSink = struct {
pub fn updateRef(this: *FileSink, value: bool) void {
if (this.poll_ref) |poll| {
if (value)
- poll.enableKeepingProcessAlive(JSC.VirtualMachine.vm)
+ poll.enableKeepingProcessAlive(JSC.VirtualMachine.get())
else
- poll.disableKeepingProcessAlive(JSC.VirtualMachine.vm);
+ poll.disableKeepingProcessAlive(JSC.VirtualMachine.get());
}
}
@@ -1232,7 +1232,7 @@ pub const FileSink = struct {
// On Linux, we can adjust the pipe size to avoid blocking.
this.has_adjusted_pipe_size_on_linux = true;
- switch (JSC.Node.Syscall.setPipeCapacityOnLinux(fd, @minimum(Syscall.getMaxPipeSizeOnLinux(), remain_len))) {
+ switch (JSC.Node.Syscall.setPipeCapacityOnLinux(fd, @min(Syscall.getMaxPipeSizeOnLinux(), remain_len))) {
.result => |len| {
if (len > 0) {
this.max_write_size = len;
@@ -1249,7 +1249,7 @@ pub const FileSink = struct {
const initial = total;
const fd = this.fd;
var remain = buffer;
- remain = remain[@minimum(this.head, remain.len)..];
+ remain = remain[@min(this.head, remain.len)..];
if (remain.len == 0) return .{ .owned = 0 };
defer this.written = total;
@@ -1330,7 +1330,7 @@ pub const FileSink = struct {
if (max_to_write > 0) {
while (remain.len > 0) {
- const write_buf = remain[0..@minimum(remain.len, max_to_write)];
+ const write_buf = remain[0..@min(remain.len, max_to_write)];
const res = JSC.Node.Syscall.write(fd, write_buf);
if (res == .err) {
@@ -1526,7 +1526,7 @@ pub const FileSink = struct {
pub fn ready(this: *FileSink, writable: i64) void {
var remain = this.buffer.slice();
- const pending = remain[@minimum(this.head, remain.len)..].len;
+ const pending = remain[@min(this.head, remain.len)..].len;
if (pending == 0) {
if (this.isWatching()) {
this.unwatch(this.fd);
@@ -1536,7 +1536,7 @@ pub const FileSink = struct {
}
if (comptime Environment.isMac) {
- _ = this.flushMaybePollWithSizeAndBuffer(this.buffer.slice(), @intCast(usize, @maximum(writable, 0)));
+ _ = this.flushMaybePollWithSizeAndBuffer(this.buffer.slice(), @intCast(usize, @max(writable, 0)));
} else {
_ = this.flushMaybePollWithSizeAndBuffer(this.buffer.slice(), std.math.maxInt(usize));
}
@@ -1852,7 +1852,7 @@ pub const ArrayBufferSink = struct {
var list = this.bytes.listManaged(this.allocator);
this.bytes = bun.ByteList.init("");
return ArrayBuffer.fromBytes(
- list.toOwnedSlice(),
+ try list.toOwnedSlice(),
if (as_uint8array)
.Uint8Array
else
@@ -1871,7 +1871,7 @@ pub const ArrayBufferSink = struct {
this.done = true;
this.signal.close(null);
return .{ .result = ArrayBuffer.fromBytes(
- list.toOwnedSlice(),
+ list.toOwnedSlice() catch @panic("TODO"),
if (this.as_uint8array)
.Uint8Array
else
@@ -1896,7 +1896,7 @@ pub fn NewJSSink(comptime SinkType: type, comptime name_: []const u8) type {
pub const name = std.fmt.comptimePrint("{s}", .{std.mem.span(name_)});
// This attaches it to JS
- pub const SinkSignal = struct {
+ pub const SinkSignal = extern struct {
cpp: JSValue,
pub fn init(cpp: JSValue) Signal {
@@ -2219,15 +2219,15 @@ pub fn NewJSSink(comptime SinkType: type, comptime name_: []const u8) type {
}
pub const Export = shim.exportFunctions(.{
- .@"finalize" = finalize,
- .@"write" = write,
- .@"close" = close,
- .@"flush" = flush,
- .@"start" = start,
- .@"end" = end,
- .@"construct" = construct,
- .@"endWithSink" = endWithSink,
- .@"updateRef" = updateRef,
+ .finalize = finalize,
+ .write = write,
+ .close = close,
+ .flush = flush,
+ .start = start,
+ .end = end,
+ .construct = construct,
+ .endWithSink = endWithSink,
+ .updateRef = updateRef,
});
pub fn updateRef(ptr: *anyopaque, value: bool) callconv(.C) void {
@@ -2332,7 +2332,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
fn send(this: *@This(), buf: []const u8) bool {
std.debug.assert(!this.done);
- defer log("send: {d} bytes (backpressure: {d})", .{ buf.len, this.has_backpressure });
+ defer log("send: {d} bytes (backpressure: {any})", .{ buf.len, this.has_backpressure });
if (this.requested_end and !this.res.state().isHttpWriteCalled()) {
const success = this.res.tryEnd(buf, this.end_len, false);
@@ -2373,7 +2373,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
// do not write more than available
// if we do, it will cause this to be delayed until the next call, each time
- const to_write = @minimum(@truncate(Blob.SizeType, write_offset), @as(Blob.SizeType, this.buffer.len));
+ const to_write = @min(@truncate(Blob.SizeType, write_offset), @as(Blob.SizeType, this.buffer.len));
// figure out how much data exactly to write
const readable = this.readableSlice()[0..to_write];
@@ -2399,7 +2399,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
if (!this.done and !this.requested_end and !this.hasBackpressure()) {
const pending = @truncate(Blob.SizeType, write_offset) -| to_write;
const written_after_flush = this.wrote - initial_wrote;
- const to_report = pending - @minimum(written_after_flush, pending);
+ const to_report = pending - @min(written_after_flush, pending);
if ((written_after_flush == initial_wrote and pending == 0) or to_report > 0) {
this.signal.ready(to_report, null);
@@ -2475,7 +2475,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
}
pub fn flushFromJS(this: *@This(), globalThis: *JSGlobalObject, wait: bool) JSC.Node.Maybe(JSValue) {
- log("flushFromJS({s})", .{wait});
+ log("flushFromJS({any})", .{wait});
if (!wait) {
return this.flushFromJSNoWait();
}
@@ -2667,7 +2667,7 @@ pub fn HTTPServerWritable(comptime ssl: bool) type {
// In this case, it's always an error
pub fn end(this: *@This(), err: ?Syscall.Error) JSC.Node.Maybe(void) {
- log("end({s})", .{err});
+ log("end({any})", .{err});
if (this.requested_end) {
return .{ .result = {} };
@@ -2814,7 +2814,7 @@ pub fn ReadableStreamSource(
comptime onStart: anytype,
comptime onPull: anytype,
comptime onCancel: fn (this: *Context) void,
- comptime deinit: fn (this: *Context) void,
+ comptime deinit_fn: fn (this: *Context) void,
comptime setRefUnrefFn: ?fn (this: *Context, enable: bool) void,
comptime drainInternalBuffer: ?fn (this: *Context) bun.ByteList,
) type {
@@ -2823,7 +2823,7 @@ pub fn ReadableStreamSource(
cancelled: bool = false,
deinited: bool = false,
pending_err: ?Syscall.Error = null,
- close_handler: ?fn (*anyopaque) void = null,
+ close_handler: ?*const fn (*anyopaque) void = null,
close_ctx: ?*anyopaque = null,
close_jsvalue: JSValue = JSValue.zero,
globalThis: *JSGlobalObject = undefined,
@@ -2892,7 +2892,7 @@ pub fn ReadableStreamSource(
return;
}
this.deinited = true;
- deinit(&this.context);
+ deinit_fn(&this.context);
}
pub fn getError(this: *This) ?Syscall.Error {
@@ -3034,7 +3034,7 @@ pub fn ReadableStreamSource(
}
pub const Export = shim.exportFunctions(.{
- .@"load" = load,
+ .load = load,
});
comptime {
@@ -3066,7 +3066,7 @@ pub const ByteBlobLoader = struct {
this.* = ByteBlobLoader{
.offset = blobe.offset,
.store = blobe.store.?,
- .chunk_size = if (user_chunk_size > 0) @minimum(user_chunk_size, blobe.size) else @minimum(1024 * 1024 * 2, blobe.size),
+ .chunk_size = if (user_chunk_size > 0) @min(user_chunk_size, blobe.size) else @min(1024 * 1024 * 2, blobe.size),
.remain = blobe.size,
.done = false,
};
@@ -3086,7 +3086,7 @@ pub const ByteBlobLoader = struct {
var temporary = this.store.sharedView();
temporary = temporary[this.offset..];
- temporary = temporary[0..@minimum(buffer.len, @minimum(temporary.len, this.remain))];
+ temporary = temporary[0..@min(buffer.len, @min(temporary.len, this.remain))];
if (temporary.len == 0) {
this.store.deref();
this.done = true;
@@ -3120,7 +3120,7 @@ pub const ByteBlobLoader = struct {
pub fn drain(this: *ByteBlobLoader) bun.ByteList {
var temporary = this.store.sharedView();
temporary = temporary[this.offset..];
- temporary = temporary[0..@minimum(16384, @minimum(temporary.len, this.remain))];
+ temporary = temporary[0..@min(16384, @min(temporary.len, this.remain))];
var cloned = bun.ByteList.init(temporary).listManaged(bun.default_allocator).clone() catch @panic("Out of memory");
this.offset +|= @truncate(Blob.SizeType, cloned.items.len);
@@ -3141,7 +3141,7 @@ pub const ByteBlobLoader = struct {
);
};
-pub const PipeFunction = fn (ctx: *anyopaque, stream: StreamResult, allocator: std.mem.Allocator) void;
+pub const PipeFunction = *const fn (ctx: *anyopaque, stream: StreamResult, allocator: std.mem.Allocator) void;
pub const PathOrFileDescriptor = union(enum) {
path: ZigString.Slice,
@@ -3202,14 +3202,14 @@ pub const ByteStream = struct {
}
if (this.has_received_last_chunk) {
- return .{ .chunk_size = @truncate(Blob.SizeType, @minimum(1024 * 1024 * 2, this.buffer.items.len)) };
+ return .{ .chunk_size = @truncate(Blob.SizeType, @min(1024 * 1024 * 2, this.buffer.items.len)) };
}
if (this.highWaterMark == 0) {
return .{ .ready = void{} };
}
- return .{ .chunk_size = @maximum(this.highWaterMark, std.mem.page_size) };
+ return .{ .chunk_size = @max(this.highWaterMark, std.mem.page_size) };
}
pub fn value(this: *@This()) JSValue {
@@ -3260,7 +3260,7 @@ pub const ByteStream = struct {
if (this.pending.state == .pending) {
std.debug.assert(this.buffer.items.len == 0);
- var to_copy = this.pending_buffer[0..@minimum(chunk.len, this.pending_buffer.len)];
+ var to_copy = this.pending_buffer[0..@min(chunk.len, this.pending_buffer.len)];
const pending_buffer_len = this.pending_buffer.len;
std.debug.assert(to_copy.ptr != chunk.ptr);
@memcpy(to_copy.ptr, chunk.ptr, to_copy.len);
@@ -3347,7 +3347,7 @@ pub const ByteStream = struct {
if (this.buffer.items.len > 0) {
std.debug.assert(this.value() == .zero);
- const to_write = @minimum(
+ const to_write = @min(
this.buffer.items.len - this.offset,
buffer.len,
);
@@ -3571,7 +3571,7 @@ pub const FIFO = struct {
return @as(u32, 0);
}
- return @intCast(u32, @maximum(len, 0));
+ return @intCast(u32, @max(len, 0));
}
pub fn adjustPipeCapacityOnLinux(this: *FIFO, current: usize, max: usize) void {
@@ -3579,7 +3579,7 @@ pub const FIFO = struct {
if (!this.has_adjusted_pipe_size_on_linux) {
if (current > 0 and max >= std.mem.page_size * 16) {
this.has_adjusted_pipe_size_on_linux = true;
- _ = Syscall.setPipeCapacityOnLinux(this.fd, @minimum(max * 4, Syscall.getMaxPipeSizeOnLinux()));
+ _ = Syscall.setPipeCapacityOnLinux(this.fd, @min(max * 4, Syscall.getMaxPipeSizeOnLinux()));
}
}
}
@@ -3668,7 +3668,7 @@ pub const FIFO = struct {
}
if (size_or_offset != std.math.maxInt(@TypeOf(size_or_offset)))
- this.to_read = @intCast(u32, @maximum(size_or_offset, 0));
+ this.to_read = @intCast(u32, @max(size_or_offset, 0));
return this.to_read;
}
@@ -3909,11 +3909,11 @@ pub const File = struct {
return if (this.remaining_bytes > 0 and this.isSeekable())
if (available_to_read != std.math.maxInt(usize))
- @minimum(chunk_size, available_to_read)
+ @min(chunk_size, available_to_read)
else
- @minimum(this.remaining_bytes -| this.total_read, chunk_size)
+ @min(this.remaining_bytes -| this.total_read, chunk_size)
else
- @minimum(available_to_read, chunk_size);
+ @min(available_to_read, chunk_size);
}
pub fn start(
@@ -4044,7 +4044,7 @@ pub const File = struct {
this.pending.result = .{
.err = Syscall.Error{
// this is too hacky
- .errno = @truncate(Syscall.Error.Int, @intCast(u16, @maximum(1, @errorToInt(err)))),
+ .errno = @truncate(Syscall.Error.Int, @intCast(u16, @max(1, @errorToInt(err)))),
.syscall = .read,
},
};
@@ -4062,7 +4062,7 @@ pub const File = struct {
var remaining = this.buf[this.concurrent.read..];
while (remaining.len > 0) {
- const to_read = @minimum(@as(usize, this.concurrent.chunk_size), remaining.len);
+ const to_read = @min(@as(usize, this.concurrent.chunk_size), remaining.len);
switch (Syscall.read(this.fd, remaining[0..to_read])) {
.err => |err| {
const retry = std.os.E.AGAIN;
@@ -4503,9 +4503,9 @@ pub const FileReader = struct {
},
.File => {
if (value)
- this.lazy_readable.readable.File.poll_ref.ref(JSC.VirtualMachine.vm)
+ this.lazy_readable.readable.File.poll_ref.ref(JSC.VirtualMachine.get())
else
- this.lazy_readable.readable.File.poll_ref.unref(JSC.VirtualMachine.vm);
+ this.lazy_readable.readable.File.poll_ref.unref(JSC.VirtualMachine.get());
},
}
}
@@ -4570,14 +4570,14 @@ pub fn NewReadyWatcher(
const fd = @intCast(c_int, fd_);
std.debug.assert(@intCast(c_int, this.poll_ref.?.fd) == fd);
std.debug.assert(
- this.poll_ref.?.unregister(JSC.VirtualMachine.vm.uws_event_loop.?) == .result,
+ this.poll_ref.?.unregister(JSC.VirtualMachine.get().uws_event_loop.?) == .result,
);
}
pub fn pollRef(this: *Context) *JSC.FilePoll {
return this.poll_ref orelse brk: {
this.poll_ref = JSC.FilePoll.init(
- JSC.VirtualMachine.vm,
+ JSC.VirtualMachine.get(),
this.fd,
.{},
Context,
@@ -4599,7 +4599,7 @@ pub fn NewReadyWatcher(
const fd = @intCast(c_int, fd_);
var poll_ref: *JSC.FilePoll = this.poll_ref orelse brk: {
this.poll_ref = JSC.FilePoll.init(
- JSC.VirtualMachine.vm,
+ JSC.VirtualMachine.get(),
fd,
.{},
Context,
@@ -4609,7 +4609,7 @@ pub fn NewReadyWatcher(
};
std.debug.assert(poll_ref.fd == fd);
std.debug.assert(!this.isWatching());
- switch (poll_ref.register(JSC.VirtualMachine.vm.uws_event_loop.?, flag, true)) {
+ switch (poll_ref.register(JSC.VirtualMachine.get().uws_event_loop.?, flag, true)) {
.err => |err| {
bun.unreachablePanic("FilePoll.register failed: {d}", .{err.errno});
},
diff --git a/src/bun.zig b/src/bun.zig
index 448402154..f20843ee6 100644
--- a/src/bun.zig
+++ b/src/bun.zig
@@ -119,6 +119,83 @@ pub const fmt = struct {
else => SizeFormatter{ .value = @intCast(u64, value) },
};
}
+
+ const lower_hex_table = [_]u8{
+ '0',
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9',
+ 'a',
+ 'b',
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ };
+ const upper_hex_table = [_]u8{
+ '0',
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9',
+ 'A',
+ 'B',
+ 'C',
+ 'D',
+ 'E',
+ 'F',
+ };
+ pub fn HexIntFormatter(comptime Int: type, comptime lower: bool) type {
+ return struct {
+ value: Int,
+
+ const table = if (lower) lower_hex_table else upper_hex_table;
+
+ const BufType = [@bitSizeOf(Int) / 4]u8;
+
+ fn getOutBuf(value: Int) BufType {
+ var buf: BufType = undefined;
+ comptime var i: usize = 0;
+ inline while (i < buf.len) : (i += 1) {
+ // value relative to the current nibble
+ buf[i] = table[@as(u8, @truncate(u4, value >> comptime ((buf.len - i - 1) * 4))) & 0xF];
+ }
+
+ return buf;
+ }
+
+ pub fn format(self: @This(), comptime _: []const u8, _: fmt.FormatOptions, writer: anytype) !void {
+ const value = self.value;
+ try writer.writeAll(&getOutBuf(value));
+ }
+ };
+ }
+
+ pub fn HexInt(comptime Int: type, comptime lower: std.fmt.Case, value: Int) HexIntFormatter(Int, lower == .lower) {
+ const Formatter = HexIntFormatter(Int, lower == .lower);
+ return Formatter{ .value = value };
+ }
+
+ pub fn hexIntLower(value: anytype) HexIntFormatter(@TypeOf(value), true) {
+ const Formatter = HexIntFormatter(@TypeOf(value), true);
+ return Formatter{ .value = value };
+ }
+
+ pub fn hexIntUpper(value: anytype) HexIntFormatter(@TypeOf(value), false) {
+ const Formatter = HexIntFormatter(@TypeOf(value), false);
+ return Formatter{ .value = value };
+ }
};
pub const Output = @import("./output.zig");
@@ -151,7 +228,10 @@ pub inline fn cast(comptime To: type, value: anytype) To {
if (comptime std.meta.trait.isIntegral(@TypeOf(value))) {
return @intToPtr(To, @bitCast(usize, value));
}
- return @ptrCast(To, @alignCast(@alignOf(To), value));
+
+ // TODO: file issue about why std.meta.Child only is necessary on Linux aarch64
+ // it should be necessary on all targets
+ return @ptrCast(To, @alignCast(@alignOf(std.meta.Child(To)), value));
}
extern fn strlen(ptr: [*c]const u8) usize;
@@ -179,7 +259,7 @@ pub fn len(value: anytype) usize {
.Many => {
const sentinel_ptr = info.sentinel orelse
@compileError("length of pointer with no sentinel");
- const sentinel = @ptrCast(*const info.child, sentinel_ptr).*;
+ const sentinel = @ptrCast(*align(1) const info.child, sentinel_ptr).*;
return indexOfSentinel(info.child, sentinel, value);
},
@@ -208,7 +288,7 @@ pub fn span(ptr: anytype) std.mem.Span(@TypeOf(ptr)) {
const l = len(ptr);
const ptr_info = @typeInfo(Result).Pointer;
if (ptr_info.sentinel) |s_ptr| {
- const s = @ptrCast(*const ptr_info.child, s_ptr).*;
+ const s = @ptrCast(*align(1) const ptr_info.child, s_ptr).*;
return ptr[0..l :s];
} else {
return ptr[0..l];
@@ -316,7 +396,7 @@ pub fn clone(val: anytype, allocator: std.mem.Allocator) !@TypeOf(val) {
}
pub const StringBuilder = @import("./string_builder.zig");
-pub inline fn assertDefined(val: anytype) void {
+pub fn assertDefined(val: anytype) void {
if (comptime !Environment.allow_assert) return;
const Type = @TypeOf(val);
@@ -388,7 +468,7 @@ pub fn isReadable(fd: std.os.fd_t) PollFlag {
};
const result = (std.os.poll(polls, 0) catch 0) != 0;
- global_scope_log("poll({d}) readable: {d} ({d})", .{ fd, result, polls[0].revents });
+ global_scope_log("poll({d}) readable: {any} ({d})", .{ fd, result, polls[0].revents });
return if (result and polls[0].revents & std.os.POLL.HUP != 0)
PollFlag.hup
else if (result)
@@ -408,7 +488,7 @@ pub fn isWritable(fd: std.os.fd_t) PollFlag {
};
const result = (std.os.poll(polls, 0) catch 0) != 0;
- global_scope_log("poll({d}) writable: {d} ({d})", .{ fd, result, polls[0].revents });
+ global_scope_log("poll({d}) writable: {any} ({d})", .{ fd, result, polls[0].revents });
if (result and polls[0].revents & std.os.POLL.HUP != 0) {
return PollFlag.hup;
} else if (result) {
@@ -483,7 +563,7 @@ pub const invalid_fd = std.math.maxInt(FileDescriptor);
pub const simdutf = @import("./bun.js/bindings/bun-simdutf.zig");
-pub const JSC = @import("javascript_core");
+pub const JSC = @import("./jsc.zig");
pub const AsyncIO = @import("async_io");
pub const logger = @import("./logger.zig");
@@ -498,6 +578,11 @@ pub const analytics = @import("./analytics.zig");
pub const DateTime = @import("./deps/zig-datetime/src/datetime.zig");
pub var start_time: i128 = 0;
+
+pub fn openDir(dir: std.fs.Dir, path_: [:0]const u8) !std.fs.IterableDir {
+ const fd = try std.os.openatZ(dir.fd, path_, std.os.O.DIRECTORY | 0, 0);
+ return std.fs.IterableDir{ .dir = .{ .fd = fd } };
+}
pub const MimallocArena = @import("./mimalloc_arena.zig").Arena;
/// This wrapper exists to avoid the call to sliceTo(0)
diff --git a/src/bun_js.zig b/src/bun_js.zig
index e9926f800..fce2108bd 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -59,6 +59,7 @@ pub const Run = struct {
};
run.vm.argv = ctx.passthrough;
run.vm.arena = &run.arena;
+ run.vm.allocator = arena.allocator();
run.vm.bundler.options.install = ctx.install;
run.vm.bundler.resolver.opts.install = ctx.install;
diff --git a/src/bun_redirect.zig b/src/bun_redirect.zig
index 99eeb8d73..91fc3244d 100644
--- a/src/bun_redirect.zig
+++ b/src/bun_redirect.zig
@@ -1 +1 @@
-pub usingnamespace @import("./bun.zig");
+pub usingnamespace @import("root").bun;
diff --git a/src/bundler.zig b/src/bundler.zig
index 9a7265f11..a70a87c8a 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -399,7 +399,7 @@ pub const Bundler = struct {
this.resolver.allocator = allocator;
}
- pub inline fn resolveEntryPoint(bundler: *Bundler, entry_point: string) !_resolver.Result {
+ pub inline fn resolveEntryPoint(bundler: *Bundler, entry_point: string) anyerror!_resolver.Result {
return bundler.resolver.resolve(bundler.fs.top_level_dir, entry_point, .entry_point) catch |err| {
const has_dot_slash_form = !strings.hasPrefix(entry_point, "./") and brk: {
_ = bundler.resolver.resolve(bundler.fs.top_level_dir, try strings.append(bundler.allocator, "./", entry_point), .entry_point) catch break :brk false;
@@ -1538,7 +1538,7 @@ pub const Bundler = struct {
}
},
.css => {},
- else => Global.panic("Unsupported loader {s} for path: {s}", .{ loader, source.path.text }),
+ else => Global.panic("Unsupported loader {s} for path: {s}", .{ @tagName(loader), source.path.text }),
}
return null;
@@ -1836,7 +1836,7 @@ pub const Bundler = struct {
);
}
- var final_result = try options.TransformResult.init(try allocator.dupe(u8, bundler.result.outbase), bundler.output_files.toOwnedSlice(), log, allocator);
+ var final_result = try options.TransformResult.init(try allocator.dupe(u8, bundler.result.outbase), try bundler.output_files.toOwnedSlice(), log, allocator);
final_result.root_dir = bundler.options.output_dir_handle;
return final_result;
}
diff --git a/src/bundler/entry_points.zig b/src/bundler/entry_points.zig
index d06bee964..e0e84ee8b 100644
--- a/src/bundler/entry_points.zig
+++ b/src/bundler/entry_points.zig
@@ -277,9 +277,10 @@ pub const MacroEntryPoint = struct {
hasher.update(js_ast.Macro.namespaceWithColon);
hasher.update(entry_path);
hasher.update(function_name);
- const truncated_u32 = @truncate(u32, hasher.final());
+ const hash = hasher.final();
+ const fmt = bun.fmt.hexIntLower(hash);
- const specifier = std.fmt.bufPrint(buf, js_ast.Macro.namespaceWithColon ++ "//{x}.js", .{truncated_u32}) catch unreachable;
+ const specifier = std.fmt.bufPrint(buf, js_ast.Macro.namespaceWithColon ++ "//{any}.js", .{fmt}) catch unreachable;
len.* = @truncate(u32, specifier.len);
return generateIDFromSpecifier(specifier);
diff --git a/src/bundler/generate_node_modules_bundle.zig b/src/bundler/generate_node_modules_bundle.zig
index b302e984e..a3f47debc 100644
--- a/src/bundler/generate_node_modules_bundle.zig
+++ b/src/bundler/generate_node_modules_bundle.zig
@@ -211,7 +211,7 @@ pub const ThreadPool = struct {
pub const ProcessFileTask = struct {
resolution: _resolver.Result,
- task: ThreadPoolLib.Task = .{ .callback = callback },
+ task: ThreadPoolLib.Task = .{ .callback = &callback },
pub fn callback(task: *ThreadPoolLib.Task) void {
var worker = @ptrCast(
@@ -334,11 +334,11 @@ pub const magic_bytes = "#!/usr/bin/env bun\n\n";
// Then, you add that number to initial_header.len
const initial_header = brk: {
var buf = std.mem.zeroes([magic_bytes.len + 5]u8);
- std.mem.copy(u8, &buf, magic_bytes);
- var remainder = buf[magic_bytes.len..];
- // Write an invalid byte offset to be updated after we finish generating the code
- std.mem.writeIntNative(u32, remainder[0 .. remainder.len - 1], 0);
- buf[buf.len - 1] = '\n';
+ // std.mem.copy(u8, &buf, magic_bytes);
+ // var remainder = buf[magic_bytes.len..];
+ // // Write an invalid byte offset to be updated after we finish generating the code
+ // std.mem.writeIntNative(u32, remainder[0 .. remainder.len - 1], 0);
+ // buf[buf.len - 1] = '\n';
break :brk buf;
};
const code_start_byte_offset: u32 = initial_header.len;
@@ -692,15 +692,16 @@ pub fn generate(
var refresh_runtime_injector_buf: [1024]u8 = undefined;
var fixed_buffer = std.io.fixedBufferStream(&refresh_runtime_injector_buf);
var fixed_buffer_writer = fixed_buffer.writer();
+ const hex_bytes = bun.fmt.hexIntLower(refresh_runtime_module_id);
fixed_buffer_writer.print(
\\if ('window' in globalThis) {{
\\ (function() {{
- \\ BUN_RUNTIME.__injectFastRefresh(${x}());
+ \\ BUN_RUNTIME.__injectFastRefresh(${any}());
\\ }})();
\\}}
,
- .{refresh_runtime_module_id},
+ .{hex_bytes},
) catch unreachable;
try this.tmpfile.writeAll(fixed_buffer.buffer[0..fixed_buffer.pos]);
}
@@ -805,7 +806,7 @@ pub fn generate(
const etag_u64 = hasher.final();
// We store the etag as a ascii hex encoded u64
// This is so we can send the bytes directly in the HTTP server instead of formatting it as hex each time.
- javascript_bundle.etag = try std.fmt.allocPrint(allocator, "{x}", .{etag_u64});
+ javascript_bundle.etag = try std.fmt.allocPrint(allocator, "{any}", .{bun.fmt.hexIntLower(etag_u64)});
javascript_bundle.generated_at = @truncate(u32, @intCast(u64, std.time.milliTimestamp()));
const basename = std.fs.path.basename(std.mem.span(destination));
@@ -815,10 +816,10 @@ pub fn generate(
else
try std.fmt.allocPrint(
this.allocator,
- "/{s}.{x}.bun",
+ "/{s}.{s}.bun",
.{
basename[0 .. basename.len - extname.len],
- etag_u64,
+ javascript_bundle.etag,
},
);
@@ -860,7 +861,7 @@ pub fn generate(
_ = C.fchmod(
this.tmpfile.handle,
// chmod 777
- 0000010 | 0000100 | 0000001 | 0001000 | 0000040 | 0000004 | 0000002 | 0000400 | 0000200 | 0000020,
+ 0o0000010 | 0o0000100 | 0o0000001 | 0o0001000 | 0o0000040 | 0o0000004 | 0o0000002 | 0o0000400 | 0o0000200 | 0o0000020,
);
try tmpfile.promote(tmpname, top_dir.fd, destination);
// Print any errors at the end
@@ -1351,7 +1352,8 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
}
}
- if (bundler.resolver.resolve(source_dir, import_record.path.text, import_record.kind)) |*_resolved_import| {
+ if (bundler.resolver.resolve(source_dir, import_record.path.text, import_record.kind)) |tmp| {
+ var _resolved_import = tmp;
if (_resolved_import.is_external) {
continue;
}
@@ -1376,7 +1378,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
// _resolved_import.package_json;
// }
- const resolved_import: *const _resolver.Result = _resolved_import;
+ const resolved_import: *const _resolver.Result = &_resolved_import;
const _module_data = BundledModuleData.getForceBundle(this, resolved_import) orelse {
// if a macro imports code that cannot be bundled
@@ -1397,7 +1399,7 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
_ = queue.getOrPutValue(
_module_data.module_id,
.{
- .resolution = _resolved_import.*,
+ .resolution = _resolved_import,
},
) catch unreachable;
} else |err| {
@@ -1780,7 +1782,8 @@ pub fn processFile(this: *GenerateNodeModuleBundle, worker: *ThreadPool.Worker,
}
}
- if (bundler.resolver.resolve(source_dir, import_record.path.text, import_record.kind)) |*_resolved_import| {
+ var tmp = bundler.resolver.resolve(source_dir, import_record.path.text, import_record.kind);
+ if (tmp) |*_resolved_import| {
if (_resolved_import.is_external) {
continue;
}
diff --git a/src/c.zig b/src/c.zig
index 3c94dadba..de47e33c4 100644
--- a/src/c.zig
+++ b/src/c.zig
@@ -123,7 +123,7 @@ pub fn moveFileZWithHandle(from_handle: std.os.fd_t, from_dir: std.os.fd_t, file
// On Linux, this will be fast because sendfile() supports copying between two file descriptors on disk
// macOS & BSDs will be slow because
pub fn moveFileZSlow(from_dir: std.os.fd_t, filename: [*:0]const u8, to_dir: std.os.fd_t, destination: [*:0]const u8) !void {
- const in_handle = try std.os.openatZ(from_dir, filename, std.os.O.RDONLY | std.os.O.CLOEXEC, 0600);
+ const in_handle = try std.os.openatZ(from_dir, filename, std.os.O.RDONLY | std.os.O.CLOEXEC, 0o600);
try moveFileZSlowWithHandle(in_handle, to_dir, destination);
}
@@ -134,7 +134,7 @@ pub fn moveFileZSlowWithHandle(in_handle: std.os.fd_t, to_dir: std.os.fd_t, dest
// ftruncate() instead didn't work.
// this is technically racy because it could end up deleting the file without saving
std.os.unlinkatZ(to_dir, destination, 0) catch {};
- const out_handle = try std.os.openatZ(to_dir, destination, std.os.O.WRONLY | std.os.O.CREAT | std.os.O.CLOEXEC, 022);
+ const out_handle = try std.os.openatZ(to_dir, destination, std.os.O.WRONLY | std.os.O.CREAT | std.os.O.CLOEXEC, 0o022);
defer std.os.close(out_handle);
if (comptime Environment.isLinux) {
_ = std.os.system.fallocate(out_handle, 0, 0, @intCast(i64, stat_.size));
@@ -191,7 +191,7 @@ pub fn getSelfExeSharedLibPaths(allocator: std.mem.Allocator) error{OutOfMemory}
=> {
var paths = List.init(allocator);
errdefer {
- const slice = paths.toOwnedSlice();
+ const slice = paths.toOwnedSlice() catch &.{};
for (slice) |item| {
allocator.free(item);
}
@@ -208,12 +208,12 @@ pub fn getSelfExeSharedLibPaths(allocator: std.mem.Allocator) error{OutOfMemory}
}
}
}.callback);
- return paths.toOwnedSlice();
+ return try paths.toOwnedSlice();
},
.macos, .ios, .watchos, .tvos => {
var paths = List.init(allocator);
errdefer {
- const slice = paths.toOwnedSlice();
+ const slice = paths.toOwnedSlice() catch &.{};
for (slice) |item| {
allocator.free(item);
}
@@ -227,13 +227,13 @@ pub fn getSelfExeSharedLibPaths(allocator: std.mem.Allocator) error{OutOfMemory}
errdefer allocator.free(item);
try paths.append(item);
}
- return paths.toOwnedSlice();
+ return try paths.toOwnedSlice();
},
// revisit if Haiku implements dl_iterat_phdr (https://dev.haiku-os.org/ticket/15743)
.haiku => {
var paths = List.init(allocator);
errdefer {
- const slice = paths.toOwnedSlice();
+ const slice = paths.toOwnedSlice() catch &.{};
for (slice) |item| {
allocator.free(item);
}
@@ -245,7 +245,7 @@ pub fn getSelfExeSharedLibPaths(allocator: std.mem.Allocator) error{OutOfMemory}
errdefer allocator.free(item);
try paths.append(item);
- return paths.toOwnedSlice();
+ return try paths.toOwnedSlice();
},
else => @compileError("getSelfExeSharedLibPaths unimplemented for this target"),
}
@@ -346,14 +346,7 @@ pub fn getSystemLoadavg() [3]f64 {
pub fn getProcessPriority(pid_: i32) i32 {
const pid = @intCast(c_uint, pid_);
-
- if (comptime Environment.isLinux) {
- return linux.get_process_priority(pid);
- } else if (comptime Environment.isMac) {
- return darwin.get_process_priority(pid);
- } else {
- return -1;
- }
+ return get_process_priority(pid);
}
pub fn setProcessPriority(pid_: i32, priority_: i32) std.c.E {
@@ -362,14 +355,7 @@ pub fn setProcessPriority(pid_: i32, priority_: i32) std.c.E {
const pid = @intCast(c_uint, pid_);
const priority = @intCast(c_int, priority_);
- var code: i32 = 0;
- if (comptime Environment.isLinux) {
- code = linux.set_process_priority(pid, priority);
- } else if (comptime Environment.isMac) {
- code = darwin.set_process_priority(pid, priority);
- } else {
- code = -2;
- }
+ const code: i32 = set_process_priority(pid, priority);
if (code == -2) return .SRCH;
if (code == 0) return .SUCCESS;
@@ -435,3 +421,7 @@ pub fn dlsym(comptime Type: type, comptime name: [:0]const u8) ?Type {
return null;
}
+
+// set in c-bindings.cpp
+pub extern fn get_process_priority(pid: c_uint) i32;
+pub extern fn set_process_priority(pid: c_uint, priority: c_int) i32;
diff --git a/src/cli.zig b/src/cli.zig
index 2f0a7dd26..1515856a5 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -10,7 +10,7 @@ const default_allocator = bun.default_allocator;
const constStrToU8 = bun.constStrToU8;
const FeatureFlags = bun.FeatureFlags;
const C = bun.C;
-
+const root = @import("root");
const std = @import("std");
const lex = @import("js_lexer.zig");
const logger = @import("bun").logger;
@@ -753,7 +753,8 @@ pub const HelpCommand = struct {
\\
;
- var rand = std.rand.DefaultPrng.init(@intCast(u64, @maximum(std.time.milliTimestamp(), 0))).random();
+ var rand_state = std.rand.DefaultPrng.init(@intCast(u64, @max(std.time.milliTimestamp(), 0)));
+ const rand = rand_state.random();
const package_add_i = rand.uintAtMost(usize, packages_to_add_filler.len - 1);
const package_remove_i = rand.uintAtMost(usize, packages_to_remove_filler.len - 1);
diff --git a/src/cli/add_completions.zig b/src/cli/add_completions.zig
index b8001884d..95201659d 100644
--- a/src/cli/add_completions.zig
+++ b/src/cli/add_completions.zig
@@ -78,7 +78,7 @@ pub const biggest_list: usize = brk: {
var iter = a.iterator();
var max: usize = 0;
while (iter.next()) |list| {
- max = @maximum(list.value.len, max);
+ max = @max(list.value.len, max);
}
break :brk max;
};
diff --git a/src/cli/bun_command.zig b/src/cli/bun_command.zig
index 30a1531b6..8807aae7e 100644
--- a/src/cli/bun_command.zig
+++ b/src/cli/bun_command.zig
@@ -44,7 +44,7 @@ const ServerBundleGeneratorThread = struct {
server_conf: Api.LoadedFramework,
route_conf_: ?Api.LoadedRouteConfig,
router: ?Router,
- ) !void {
+ ) anyerror!void {
var server_bundler = try bundler.Bundler.init(
allocator_,
logs,
@@ -194,7 +194,7 @@ pub const BunCommand = struct {
if (log.errors > 0) {
try log.printForLogLevel(Output.errorWriter());
} else {
- var elapsed = @divTrunc(std.time.nanoTimestamp() - ctx.start_time, @as(i128, std.time.ns_per_ms));
+ var elapsed = @divTrunc(@truncate(i64, std.time.nanoTimestamp() - ctx.start_time), @as(i64, std.time.ns_per_ms));
const print_summary = !(ctx.args.no_summary orelse false);
if (print_summary) {
var bundle = NodeModuleBundle.init(node_modules, allocator);
@@ -211,7 +211,7 @@ pub const BunCommand = struct {
}
},
else => {
- const formatted_loc: f32 = @floatCast(f32, @intToFloat(f128, estimated_input_lines_of_code) / 1000);
+ const formatted_loc: f32 = @floatCast(f32, @intToFloat(f64, estimated_input_lines_of_code) / 1000);
if (generated_server) {
Output.prettyln(indent ++ "<d>{d:<5.2}k LOC parsed x2", .{formatted_loc});
} else {
diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig
index cc00a1d11..ce1f71fcd 100644
--- a/src/cli/bunx_command.zig
+++ b/src/cli/bunx_command.zig
@@ -318,7 +318,8 @@ pub const BunxCommand = struct {
);
// TODO: fix this after zig upgrade
- var bunx_install_dir = try std.fs.cwd().makeOpenPath(bunx_install_dir_path, .{ .iterate = true });
+ var bunx_install_iterable_dir = try std.fs.cwd().makeOpenPathIterable(bunx_install_dir_path, .{});
+ var bunx_install_dir = bunx_install_iterable_dir.dir;
create_package_json: {
// create package.json, but only if it doesn't exist
diff --git a/src/cli/colon_list_type.zig b/src/cli/colon_list_type.zig
index 9b54c4381..a76ba7fbf 100644
--- a/src/cli/colon_list_type.zig
+++ b/src/cli/colon_list_type.zig
@@ -10,7 +10,7 @@ const default_allocator = bun.default_allocator;
const C = bun.C;
const std = @import("std");
-pub fn ColonListType(comptime t: type, value_resolver: anytype) type {
+pub fn ColonListType(comptime t: type, comptime value_resolver: anytype) type {
return struct {
pub fn init(allocator: std.mem.Allocator, count: usize) !@This() {
var keys = try allocator.alloc(string, count);
@@ -26,7 +26,7 @@ pub fn ColonListType(comptime t: type, value_resolver: anytype) type {
// Support either ":" or "=" as the separator, preferring whichever is first.
// ":" is less confusing IMO because that syntax is used with flags
// but "=" is what esbuild uses and I want this to be somewhat familiar for people using esbuild
- const midpoint = @minimum(strings.indexOfChar(str, ':') orelse std.math.maxInt(u32), strings.indexOfChar(str, '=') orelse std.math.maxInt(u32));
+ const midpoint = @min(strings.indexOfChar(str, ':') orelse std.math.maxInt(u32), strings.indexOfChar(str, '=') orelse std.math.maxInt(u32));
if (midpoint == std.math.maxInt(u32)) {
return error.InvalidSeparator;
}
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig
index c40f4300f..45597e9d2 100644
--- a/src/cli/create_command.zig
+++ b/src/cli/create_command.zig
@@ -564,7 +564,7 @@ pub const CreateCommand = struct {
node.name = "Copying files";
progress.refresh();
- const template_dir = std.fs.openDirAbsolute(filesystem.abs(&template_parts), .{ .iterate = true }) catch |err| {
+ const template_dir = std.fs.cwd().openIterableDir(filesystem.abs(&template_parts), .{}) catch |err| {
node.end();
progress.refresh();
@@ -573,7 +573,7 @@ pub const CreateCommand = struct {
};
std.fs.deleteTreeAbsolute(destination) catch {};
- const destination_dir = std.fs.cwd().makeOpenPath(destination, .{ .iterate = true }) catch |err| {
+ const destination_dir__ = std.fs.cwd().makeOpenPathIterable(destination, .{}) catch |err| {
node.end();
progress.refresh();
@@ -581,7 +581,7 @@ pub const CreateCommand = struct {
Output.prettyErrorln("<r><red>{s}<r>: creating dir {s}", .{ @errorName(err), destination });
Global.exit(1);
};
-
+ const destination_dir = destination_dir__.dir;
const Walker = @import("../walker_skippable.zig");
var walker_ = try Walker.walk(template_dir, ctx.allocator, skip_files, skip_dirs);
defer walker_.deinit();
@@ -612,7 +612,7 @@ pub const CreateCommand = struct {
defer outfile.close();
defer node_.completeOne();
- var infile = try entry.dir.openFile(entry.basename, .{ .mode = .read_only });
+ var infile = try entry.dir.dir.openFile(entry.basename, .{ .mode = .read_only });
defer infile.close();
// Assumption: you only really care about making sure something that was executable is still executable
@@ -1308,7 +1308,7 @@ pub const CreateCommand = struct {
// std.fs.accessAbsolute(index_css_file_path, .{}) catch break :inject_css;
// var list = std.ArrayList(u8).fromOwnedSlice(ctx.allocator, outfile);
// list.insertSlice(head_i + "<head>".len, "<link rel=\"stylesheet\" href=\"/src/index.css\">\n") catch break :inject_css;
- // outfile = list.toOwnedSlice();
+ // outfile =try list.toOwnedSlice();
// }
public_index_html_file.pwriteAll(outfile, 0) catch break :bail;
@@ -1715,33 +1715,43 @@ pub const Example = struct {
var examples = std.ArrayList(Example).fromOwnedSlice(ctx.allocator, remote_examples);
{
- var folders = [3]std.fs.Dir{ std.fs.Dir{ .fd = 0 }, std.fs.Dir{ .fd = 0 }, std.fs.Dir{ .fd = 0 } };
+ var folders = [3]std.fs.IterableDir{
+ .{
+ .dir = .{ .fd = 0 },
+ },
+ .{
+ .dir = .{ .fd = 0 },
+ },
+ .{ .dir = .{ .fd = 0 } },
+ };
if (env_loader.map.get("BUN_CREATE_DIR")) |home_dir| {
var parts = [_]string{home_dir};
var outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
- folders[0] = std.fs.openDirAbsolute(outdir_path, .{ .iterate = true }) catch std.fs.Dir{ .fd = 0 };
+ folders[0] = std.fs.cwd().openIterableDir(outdir_path, .{}) catch .{ .dir = .{ .fd = 0 } };
}
{
var parts = [_]string{ filesystem.top_level_dir, BUN_CREATE_DIR };
var outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
- folders[1] = std.fs.openDirAbsolute(outdir_path, .{ .iterate = true }) catch std.fs.Dir{ .fd = 0 };
+ folders[1] = std.fs.cwd().openIterableDir(outdir_path, .{}) catch .{ .dir = .{ .fd = 0 } };
}
if (env_loader.map.get("HOME")) |home_dir| {
var parts = [_]string{ home_dir, BUN_CREATE_DIR };
var outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
- folders[2] = std.fs.openDirAbsolute(outdir_path, .{ .iterate = true }) catch std.fs.Dir{ .fd = 0 };
+ folders[2] = std.fs.cwd().openIterableDir(outdir_path, .{}) catch .{ .dir = .{ .fd = 0 } };
}
// subfolders with package.json
- for (folders) |folder_| {
+ for (folders) |folder__| {
+ const folder_ = folder__.dir;
+
if (folder_.fd != 0) {
const folder: std.fs.Dir = folder_;
- var iter = folder.iterate();
+ var iter = (std.fs.IterableDir{ .dir = folder }).iterate();
loop: while (iter.next() catch null) |entry_| {
- const entry: std.fs.Dir.Entry = entry_;
+ const entry: std.fs.IterableDir.Entry = entry_;
switch (entry.kind) {
.Directory => {
diff --git a/src/cli/init_command.zig b/src/cli/init_command.zig
index 774bede2d..6a1ff253d 100644
--- a/src/cli/init_command.zig
+++ b/src/cli/init_command.zig
@@ -93,7 +93,7 @@ pub const InitCommand = struct {
const PackageJSONFields = struct {
name: string = "project",
- @"type": string = "module",
+ type: string = "module",
object: *js_ast.E.Object = undefined,
entry_point: string = "",
};
diff --git a/src/cli/install_completions_command.zig b/src/cli/install_completions_command.zig
index 3b8206a33..3f224c161 100644
--- a/src/cli/install_completions_command.zig
+++ b/src/cli/install_completions_command.zig
@@ -93,6 +93,7 @@ pub const InstallCompletionsCommand = struct {
const fail_exit_code: u8 = if (bun.getenvZ("IS_BUN_AUTO_UPDATE") == null) 1 else 0;
var cwd_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
+
var stdout = std.io.getStdOut();
var shell = ShellCompletions.Shell.unknown;
@@ -131,7 +132,7 @@ pub const InstallCompletionsCommand = struct {
}
var completions_dir: string = "";
- var output_dir: std.fs.Dir = found: {
+ var output_dir: std.fs.IterableDir = found: {
for (std.os.argv) |arg, i| {
if (strings.eqlComptime(std.mem.span(arg), "completions")) {
if (std.os.argv.len > i + 1) {
@@ -152,9 +153,7 @@ pub const InstallCompletionsCommand = struct {
Global.exit(fail_exit_code);
}
- break :found std.fs.openDirAbsolute(completions_dir, .{
- .iterate = true,
- }) catch |err| {
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch |err| {
Output.prettyErrorln("<r><red>error:<r> accessing {s} errored {s}", .{ completions_dir, @errorName(err) });
Global.exit(fail_exit_code);
};
@@ -170,7 +169,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
var paths = [_]string{ std.mem.span(config_dir), "./fish/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -180,7 +179,7 @@ pub const InstallCompletionsCommand = struct {
var paths = [_]string{ std.mem.span(data_dir), "./fish/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -189,7 +188,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
var paths = [_]string{ std.mem.span(home_dir), "./.config/fish/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -199,12 +198,12 @@ pub const InstallCompletionsCommand = struct {
if (!Environment.isAarch64) {
// homebrew fish
completions_dir = "/usr/local/share/fish/completions";
- break :found std.fs.openDirAbsoluteZ("/usr/local/share/fish/completions", .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute("/usr/local/share/fish/completions", .{}) catch
break :outer;
} else {
// homebrew fish
completions_dir = "/opt/homebrew/share/fish/completions";
- break :found std.fs.openDirAbsoluteZ("/opt/homebrew/share/fish/completions", .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute("/opt/homebrew/share/fish/completions", .{}) catch
break :outer;
}
}
@@ -212,7 +211,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
completions_dir = "/etc/fish/completions";
- break :found std.fs.openDirAbsoluteZ("/etc/fish/completions", .{ .iterate = true }) catch break :outer;
+ break :found std.fs.openIterableDirAbsolute("/etc/fish/completions", .{}) catch break :outer;
}
},
.zsh => {
@@ -221,7 +220,7 @@ pub const InstallCompletionsCommand = struct {
while (splitter.next()) |dir| {
completions_dir = dir;
- break :found std.fs.openDirAbsolute(dir, .{ .iterate = true }) catch continue;
+ break :found std.fs.openIterableDirAbsolute(dir, .{}) catch continue;
}
}
@@ -230,7 +229,7 @@ pub const InstallCompletionsCommand = struct {
var paths = [_]string{ std.mem.span(data_dir), "./zsh-completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -238,7 +237,7 @@ pub const InstallCompletionsCommand = struct {
if (bun.getenvZ("BUN_INSTALL")) |home_dir| {
outer: {
completions_dir = home_dir;
- break :found std.fs.openDirAbsolute(home_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(home_dir, .{}) catch
break :outer;
}
}
@@ -248,7 +247,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
var paths = [_]string{ std.mem.span(home_dir), "./.oh-my-zsh/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -257,7 +256,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
var paths = [_]string{ std.mem.span(home_dir), "./.bun" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -272,7 +271,7 @@ pub const InstallCompletionsCommand = struct {
for (dirs_to_try) |dir| {
completions_dir = dir;
- break :found std.fs.openDirAbsolute(dir, .{ .iterate = true }) catch continue;
+ break :found std.fs.openIterableDirAbsolute(dir, .{}) catch continue;
}
},
.bash => {
@@ -280,7 +279,7 @@ pub const InstallCompletionsCommand = struct {
outer: {
var paths = [_]string{ std.mem.span(data_dir), "./bash-completion/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -290,7 +289,7 @@ pub const InstallCompletionsCommand = struct {
var paths = [_]string{ std.mem.span(config_dir), "./bash-completion/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -301,7 +300,7 @@ pub const InstallCompletionsCommand = struct {
var paths = [_]string{ std.mem.span(home_dir), "./.oh-my-bash/custom/completions" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -310,7 +309,7 @@ pub const InstallCompletionsCommand = struct {
var paths = [_]string{ std.mem.span(home_dir), "./.bash_completion.d" };
completions_dir = resolve_path.joinAbsString(cwd, &paths, .auto);
- break :found std.fs.openDirAbsolute(completions_dir, .{ .iterate = true }) catch
+ break :found std.fs.openIterableDirAbsolute(completions_dir, .{}) catch
break :outer;
}
}
@@ -323,7 +322,7 @@ pub const InstallCompletionsCommand = struct {
for (dirs_to_try) |dir| {
completions_dir = dir;
- break :found std.fs.openDirAbsolute(dir, .{ .iterate = true }) catch continue;
+ break :found std.fs.openIterableDirAbsolute(dir, .{}) catch continue;
}
},
else => unreachable,
@@ -357,7 +356,7 @@ pub const InstallCompletionsCommand = struct {
std.debug.assert(completions_dir.len > 0);
- var output_file = output_dir.createFileZ(filename, .{
+ var output_file = output_dir.dir.createFileZ(filename, .{
.truncate = true,
}) catch |err| {
Output.prettyErrorln("<r><red>error:<r> Could not open {s} for writing: {s}", .{
diff --git a/src/cli/package_manager_command.zig b/src/cli/package_manager_command.zig
index de5ae93a1..a52b16694 100644
--- a/src/cli/package_manager_command.zig
+++ b/src/cli/package_manager_command.zig
@@ -144,7 +144,7 @@ pub const PackageManagerCommand = struct {
} else if (strings.eqlComptime(subcommand, "cache")) {
var dir: [bun.MAX_PATH_BYTES]u8 = undefined;
var fd = pm.getCacheDirectory();
- var outpath = std.os.getFdPath(fd.fd, &dir) catch |err| {
+ var outpath = std.os.getFdPath(fd.dir.fd, &dir) catch |err| {
Output.prettyErrorln("{s} getting cache directory", .{@errorName(err)});
Global.crash();
};
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index a3f14bec2..8f0919d90 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -329,7 +329,7 @@ pub const RunCommand = struct {
var array_list = std.ArrayList(string).init(ctx.allocator);
try array_list.append(executable);
try array_list.appendSlice(passthrough);
- argv = array_list.toOwnedSlice();
+ argv = try array_list.toOwnedSlice();
}
var child_process = std.ChildProcess.init(argv, ctx.allocator);
@@ -425,7 +425,7 @@ pub const RunCommand = struct {
argv0 = std.os.argv[0];
} else if (optional_bun_path.len == 0) {
// otherwise, ask the OS for the absolute path
- var self = std.fs.selfExePath(&self_exe_bin_path_buf) catch "";
+ var self = std.fs.selfExePath(&self_exe_bin_path_buf) catch unreachable;
if (self.len > 0) {
self.ptr[self.len] = 0;
argv0 = std.meta.assumeSentinel(self, 0).ptr;
@@ -865,7 +865,7 @@ pub const RunCommand = struct {
strings.sortAsc(all_keys);
shell_out.commands = all_keys;
- shell_out.descriptions = descriptions.toOwnedSlice();
+ shell_out.descriptions = try descriptions.toOwnedSlice();
return shell_out;
}
diff --git a/src/cli/shell_completions.zig b/src/cli/shell_completions.zig
index 900363261..6a4b2128f 100644
--- a/src/cli/shell_completions.zig
+++ b/src/cli/shell_completions.zig
@@ -16,9 +16,9 @@ pub const Shell = enum {
zsh,
fish,
- const bash_completions = @embedFile("../../completions/bun.bash");
- const zsh_completions = @embedFile("../../completions/bun.zsh");
- const fish_completions = @embedFile("../../completions/bun.fish");
+ const bash_completions = @import("root").completions.bash;
+ const zsh_completions = @import("root").completions.zsh;
+ const fish_completions = @import("root").completions.fish;
pub fn completions(this: Shell) []const u8 {
return switch (this) {
diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig
index 48e27011a..66b9e2ec3 100644
--- a/src/cli/test_command.zig
+++ b/src/cli/test_command.zig
@@ -216,10 +216,10 @@ const Scanner = struct {
var path2 = this.fs.absBuf(parts2, &this.open_dir_buf);
this.open_dir_buf[path2.len] = 0;
var pathZ = this.open_dir_buf[path2.len - entry.name.slice().len .. path2.len :0];
- var child_dir = dir.openDirZ(pathZ, .{ .iterate = true }) catch continue;
+ var child_dir = bun.openDir(dir, pathZ) catch continue;
path2 = this.fs.dirname_store.append(string, path2) catch unreachable;
- FileSystem.setMaxFd(child_dir.fd);
- _ = this.readDirWithName(path2, child_dir) catch continue;
+ FileSystem.setMaxFd(child_dir.dir.fd);
+ _ = this.readDirWithName(path2, child_dir.dir) catch continue;
}
}
@@ -354,7 +354,7 @@ pub const TestCommand = struct {
scanner.scan(scanner.fs.top_level_dir);
scanner.dirs_to_scan.deinit();
- const test_files = scanner.results.toOwnedSlice();
+ const test_files = try scanner.results.toOwnedSlice();
if (test_files.len > 0) {
// vm.bundler.fs.fs.readDirectory(_dir: string, _handle: ?std.fs.Dir)
runAllTests(reporter, vm, test_files, ctx.allocator);
diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig
index 2cb5dcc93..a0f857c35 100644
--- a/src/cli/upgrade_command.zig
+++ b/src/cli/upgrade_command.zig
@@ -64,11 +64,9 @@ pub const Version = struct {
bun.default_allocator,
"bun-canary-timestamp-{any}",
.{
- std.fmt.fmtSliceHexLower(
- std.mem.asBytes(
- &bun.hash(
- std.mem.asBytes(&Cli.start_time),
- ),
+ bun.fmt.hexIntLower(
+ bun.hash(
+ std.mem.asBytes(&Cli.start_time),
),
),
},
@@ -118,7 +116,7 @@ pub const UpgradeCheckerThread = struct {
}
fn _run(env_loader: *DotEnv.Loader) anyerror!void {
- var rand = std.rand.DefaultPrng.init(@intCast(u64, @maximum(std.time.milliTimestamp(), 0)));
+ var rand = std.rand.DefaultPrng.init(@intCast(u64, @max(std.time.milliTimestamp(), 0)));
const delay = rand.random().intRangeAtMost(u64, 100, 10000);
std.time.sleep(std.time.ns_per_ms * delay);
@@ -353,7 +351,7 @@ pub const UpgradeCommand = struct {
if (asset.asProperty("size")) |size_| {
if (size_.expr.data == .e_number) {
- version.size = @intCast(u32, @maximum(@floatToInt(i32, std.math.ceil(size_.expr.data.e_number.value)), 0));
+ version.size = @intCast(u32, @max(@floatToInt(i32, std.math.ceil(size_.expr.data.e_number.value)), 0));
}
}
return version;
@@ -458,7 +456,7 @@ pub const UpgradeCommand = struct {
refresher.refresh();
var async_http = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable;
var zip_file_buffer = try ctx.allocator.create(MutableString);
- zip_file_buffer.* = try MutableString.init(ctx.allocator, @maximum(version.size, 1024));
+ zip_file_buffer.* = try MutableString.init(ctx.allocator, @max(version.size, 1024));
async_http.* = HTTP.AsyncHTTP.initSync(
ctx.allocator,
@@ -511,10 +509,11 @@ pub const UpgradeCommand = struct {
const version_name = version.name().?;
var save_dir_ = filesystem.tmpdir();
- var save_dir = save_dir_.makeOpenPath(version_name, .{ .iterate = true }) catch {
+ var save_dir_it = save_dir_.makeOpenPathIterable(version_name, .{}) catch {
Output.prettyErrorln("<r><red>error:<r> Failed to open temporary directory", .{});
Global.exit(1);
};
+ const save_dir = save_dir_it.dir;
var tmpdir_path = std.os.getFdPath(save_dir.fd, &tmpdir_path_buf) catch {
Output.prettyErrorln("<r><red>error:<r> Failed to read temporary directory", .{});
Global.exit(1);
@@ -619,7 +618,7 @@ pub const UpgradeCommand = struct {
Output.prettyErrorln(
"<r><red>error<r>: The downloaded version of bun (<red>{s}<r>) doesn't match the expected version (<b>{s}<r>)<r>. Cancelled upgrade",
.{
- version_string[0..@minimum(version_string.len, 512)],
+ version_string[0..@min(version_string.len, 512)],
version_name,
},
);
@@ -637,11 +636,12 @@ pub const UpgradeCommand = struct {
// safe because the slash will no longer be in use
current_executable_buf[target_dir_.len] = 0;
var target_dirname = current_executable_buf[0..target_dir_.len :0];
- var target_dir = std.fs.openDirAbsoluteZ(target_dirname, .{ .iterate = true }) catch |err| {
+ var target_dir_it = std.fs.openIterableDirAbsoluteZ(target_dirname, .{}) catch |err| {
save_dir_.deleteTree(version_name) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to open bun's install directory {s}", .{@errorName(err)});
Global.exit(1);
};
+ var target_dir = target_dir_it.dir;
if (use_canary) {
diff --git a/src/comptime_string_map.zig b/src/comptime_string_map.zig
index 18b06d9de..bb2602ce3 100644
--- a/src/comptime_string_map.zig
+++ b/src/comptime_string_map.zig
@@ -404,7 +404,7 @@ pub fn compareString(input: []const u8) !void {
var timer = try std.time.Timer.start();
while (i < 99999999) : (i += 1) {
- is_eql = @call(.{ .modifier = .never_inline }, TestEnum2.map.has, .{str});
+ is_eql = @call(.never_inline, TestEnum2.map.has, .{str});
}
const new = timer.lap();
@@ -412,7 +412,7 @@ pub fn compareString(input: []const u8) !void {
i = 0;
while (i < 99999999) : (i += 1) {
- is_eql = @call(.{ .modifier = .never_inline }, TestEnum2.official.has, .{str});
+ is_eql = @call(.never_inline, TestEnum2.official.has, .{str});
}
const _std = timer.lap();
diff --git a/src/copy_file.zig b/src/copy_file.zig
index 1596e4602..1e49e33bf 100644
--- a/src/copy_file.zig
+++ b/src/copy_file.zig
@@ -117,7 +117,7 @@ pub fn copyFileRange(fd_in: fd_t, off_in: u64, fd_out: fd_t, off_out: u64, len:
}
var buf: [8 * 4096]u8 = undefined;
- const adjusted_count = @minimum(buf.len, len);
+ const adjusted_count = @min(buf.len, len);
const amt_read = try os.pread(fd_in, buf[0..adjusted_count], off_in);
// TODO without @as the line below fails to compile for wasm32-wasi:
// error: integer value 0 cannot be coerced to type 'os.PWriteError!usize'
diff --git a/src/crash_reporter.zig b/src/crash_reporter.zig
index 3f2dadf1e..d98326530 100644
--- a/src/crash_reporter.zig
+++ b/src/crash_reporter.zig
@@ -10,7 +10,7 @@ fn setup_sigactions(act: ?*const os.Sigaction) !void {
}
const builtin = @import("builtin");
-const ErrorCallback = fn (sig: i32, addr: usize) void;
+const ErrorCallback = *const fn (sig: i32, addr: usize) void;
var on_error: ?ErrorCallback = null;
noinline fn sigaction_handler(sig: i32, info: *const std.os.siginfo_t, _: ?*const anyopaque) callconv(.C) void {
// Prevent recursive calls
diff --git a/src/css_scanner.zig b/src/css_scanner.zig
index 380c604e6..3760f2b01 100644
--- a/src/css_scanner.zig
+++ b/src/css_scanner.zig
@@ -1248,7 +1248,7 @@ pub fn NewBundler(
try this.writer.done();
return CodeCount{
- .written = @intCast(usize, @maximum(this.writer.written - start_count, 0)),
+ .written = @intCast(usize, @max(this.writer.written - start_count, 0)),
.approximate_newline_count = lines_of_code,
};
}
diff --git a/src/darwin_c.zig b/src/darwin_c.zig
index 57163e0c6..37fefb2bd 100644
--- a/src/darwin_c.zig
+++ b/src/darwin_c.zig
@@ -1,6 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
-const imports = @cImport(@cInclude("sys/resource.h"));
const os = std.os;
const mem = std.mem;
const Stat = std.fs.File.Stat;
@@ -406,7 +405,7 @@ pub const struct_CFRunLoopSourceContext = extern struct {
version: CFIndex,
info: ?*anyopaque,
pad: [7]?*anyopaque,
- perform: ?fn (?*anyopaque) callconv(.C) void,
+ perform: ?*const fn (?*anyopaque) callconv(.C) void,
};
pub const struct_FSEventStreamContext = extern struct {
version: CFIndex,
@@ -444,7 +443,7 @@ pub const io_iterator_t = c_uint;
pub const io_object_t = c_uint;
pub const io_service_t = c_uint;
pub const io_registry_entry_t = c_uint;
-pub const FSEventStreamCallback = ?fn (FSEventStreamRef, ?*anyopaque, c_int, ?*anyopaque, [*c]const FSEventStreamEventFlags, [*c]const FSEventStreamEventId) callconv(.C) void;
+pub const FSEventStreamCallback = ?*const fn (FSEventStreamRef, ?*anyopaque, c_int, ?*anyopaque, [*c]const FSEventStreamEventFlags, [*c]const FSEventStreamEventId) callconv(.C) void;
pub const kCFStringEncodingUTF8: CFStringEncoding = @bitCast(CFStringEncoding, @as(c_int, 134217984));
pub const noErr: OSStatus = 0;
pub const kFSEventStreamEventIdSinceNow: FSEventStreamEventId = @bitCast(FSEventStreamEventId, @as(c_longlong, -@as(c_int, 1)));
@@ -539,13 +538,8 @@ pub fn get_system_loadavg() [3]f64 {
pub extern fn getuid(...) std.os.uid_t;
pub extern fn getgid(...) std.os.gid_t;
-pub fn get_process_priority(pid: c_uint) i32 {
- return imports.getpriority(imports.PRIO_PROCESS, pid);
-}
-
-pub fn set_process_priority(pid: c_uint, priority: c_int) i32 {
- return imports.setpriority(imports.PRIO_PROCESS, pid, priority);
-}
+pub extern fn get_process_priority(pid: c_uint) i32;
+pub extern fn set_process_priority(pid: c_uint, priority: c_int) i32;
pub fn get_version(buf: []u8) []const u8 {
@memset(buf.ptr, 0, buf.len);
@@ -603,15 +597,12 @@ const IO_CTL_RELATED = struct {
return _IOC(IOC_VOID, g, n, @as(c_int, 0));
}
pub inline fn _IOR(g: anytype, n: anytype, t: anytype) @TypeOf(_IOC(IOC_OUT, g, n, @import("std").zig.c_translation.sizeof(t))) {
- _ = t;
return _IOC(IOC_OUT, g, n, @import("std").zig.c_translation.sizeof(t));
}
pub inline fn _IOW(g: anytype, n: anytype, t: anytype) @TypeOf(_IOC(IOC_IN, g, n, @import("std").zig.c_translation.sizeof(t))) {
- _ = t;
return _IOC(IOC_IN, g, n, @import("std").zig.c_translation.sizeof(t));
}
pub inline fn _IOWR(g: anytype, n: anytype, t: anytype) @TypeOf(_IOC(IOC_INOUT, g, n, @import("std").zig.c_translation.sizeof(t))) {
- _ = t;
return _IOC(IOC_INOUT, g, n, @import("std").zig.c_translation.sizeof(t));
}
pub const TIOCMODG = _IOR('t', @as(c_int, 3), c_int);
diff --git a/src/defines.zig b/src/defines.zig
index 560171468..911d8550c 100644
--- a/src/defines.zig
+++ b/src/defines.zig
@@ -245,7 +245,7 @@ pub const Define = struct {
// TODO: do we need to allocate this?
.parts = parts,
});
- try define.dots.put(tail, list.toOwnedSlice());
+ try define.dots.put(tail, try list.toOwnedSlice());
}
} else {
@@ -283,7 +283,7 @@ pub const Define = struct {
.data = value_define,
});
- define.dots.putAssumeCapacity(key, list.toOwnedSlice());
+ define.dots.putAssumeCapacity(key, try list.toOwnedSlice());
} else {
var list = try std.ArrayList(DotDefine).initCapacity(allocator, 1);
list.appendAssumeCapacity(DotDefine{
@@ -291,7 +291,7 @@ pub const Define = struct {
.data = value_define,
});
- define.dots.putAssumeCapacity(key, list.toOwnedSlice());
+ define.dots.putAssumeCapacity(key, try list.toOwnedSlice());
}
}
}
diff --git a/src/deps/boringssl.translated.zig b/src/deps/boringssl.translated.zig
index ceaa67890..e0e7408bc 100644
--- a/src/deps/boringssl.translated.zig
+++ b/src/deps/boringssl.translated.zig
@@ -160,13 +160,13 @@ pub const struct_openssl_method_common_st = extern struct {
pub const struct_rsa_meth_st = extern struct {
common: struct_openssl_method_common_st,
app_data: ?*anyopaque,
- init: ?fn (?*RSA) callconv(.C) c_int,
- finish: ?fn (?*RSA) callconv(.C) c_int,
- size: ?fn (?*const RSA) callconv(.C) usize,
- sign: ?fn (c_int, [*c]const u8, c_uint, [*c]u8, [*c]c_uint, ?*const RSA) callconv(.C) c_int,
- sign_raw: ?fn (?*RSA, [*c]usize, [*c]u8, usize, [*c]const u8, usize, c_int) callconv(.C) c_int,
- decrypt: ?fn (?*RSA, [*c]usize, [*c]u8, usize, [*c]const u8, usize, c_int) callconv(.C) c_int,
- private_transform: ?fn (?*RSA, [*c]u8, [*c]const u8, usize) callconv(.C) c_int,
+ init: ?*const fn (?*RSA) callconv(.C) c_int,
+ finish: ?*const fn (?*RSA) callconv(.C) c_int,
+ size: ?*const fn (?*const RSA) callconv(.C) usize,
+ sign: ?*const fn (c_int, [*c]const u8, c_uint, [*c]u8, [*c]c_uint, ?*const RSA) callconv(.C) c_int,
+ sign_raw: ?*const fn (?*RSA, [*c]usize, [*c]u8, usize, [*c]const u8, usize, c_int) callconv(.C) c_int,
+ decrypt: ?*const fn (?*RSA, [*c]usize, [*c]u8, usize, [*c]const u8, usize, c_int) callconv(.C) c_int,
+ private_transform: ?*const fn (?*RSA, [*c]u8, [*c]const u8, usize) callconv(.C) c_int,
flags: c_int,
};
pub const RSA_METHOD = struct_rsa_meth_st;
@@ -260,10 +260,10 @@ pub const struct_evp_cipher_st = extern struct {
ctx_size: c_uint,
flags: u32,
app_data: ?*anyopaque,
- init: ?fn ([*c]EVP_CIPHER_CTX, [*c]const u8, [*c]const u8, c_int) callconv(.C) c_int,
- cipher: ?fn ([*c]EVP_CIPHER_CTX, [*c]u8, [*c]const u8, usize) callconv(.C) c_int,
- cleanup: ?fn ([*c]EVP_CIPHER_CTX) callconv(.C) void,
- ctrl: ?fn ([*c]EVP_CIPHER_CTX, c_int, c_int, ?*anyopaque) callconv(.C) c_int,
+ init: ?*const fn ([*c]EVP_CIPHER_CTX, [*c]const u8, [*c]const u8, c_int) callconv(.C) c_int,
+ cipher: ?*const fn ([*c]EVP_CIPHER_CTX, [*c]u8, [*c]const u8, usize) callconv(.C) c_int,
+ cleanup: ?*const fn ([*c]EVP_CIPHER_CTX) callconv(.C) void,
+ ctrl: ?*const fn ([*c]EVP_CIPHER_CTX, c_int, c_int, ?*anyopaque) callconv(.C) c_int,
};
pub const EVP_CIPHER = struct_evp_cipher_st;
pub const struct_evp_cipher_info_st = extern struct {
@@ -303,24 +303,24 @@ pub const struct_bignum_ctx = opaque {};
pub const BN_CTX = struct_bignum_ctx;
pub const BIO_METHOD = struct_bio_method_st;
pub const BIO = struct_bio_st;
-pub const bio_info_cb = ?fn ([*c]BIO, c_int, [*c]const u8, c_int, c_long, c_long) callconv(.C) c_long;
+pub const bio_info_cb = ?*const fn ([*c]BIO, c_int, [*c]const u8, c_int, c_long, c_long) callconv(.C) c_long;
pub const struct_bio_method_st = extern struct {
- @"type": c_int,
+ type: c_int,
name: [*c]const u8,
- bwrite: ?fn ([*c]BIO, [*c]const u8, c_int) callconv(.C) c_int,
- bread: ?fn ([*c]BIO, [*c]u8, c_int) callconv(.C) c_int,
- bputs: ?fn ([*c]BIO, [*c]const u8) callconv(.C) c_int,
- bgets: ?fn ([*c]BIO, [*c]u8, c_int) callconv(.C) c_int,
- ctrl: ?fn ([*c]BIO, c_int, c_long, ?*anyopaque) callconv(.C) c_long,
- create: ?fn ([*c]BIO) callconv(.C) c_int,
- destroy: ?fn ([*c]BIO) callconv(.C) c_int,
- callback_ctrl: ?fn ([*c]BIO, c_int, bio_info_cb) callconv(.C) c_long,
+ bwrite: ?*const fn ([*c]BIO, [*c]const u8, c_int) callconv(.C) c_int,
+ bread: ?*const fn ([*c]BIO, [*c]u8, c_int) callconv(.C) c_int,
+ bputs: ?*const fn ([*c]BIO, [*c]const u8) callconv(.C) c_int,
+ bgets: ?*const fn ([*c]BIO, [*c]u8, c_int) callconv(.C) c_int,
+ ctrl: ?*const fn ([*c]BIO, c_int, c_long, ?*anyopaque) callconv(.C) c_long,
+ create: ?*const fn ([*c]BIO) callconv(.C) c_int,
+ destroy: ?*const fn ([*c]BIO) callconv(.C) c_int,
+ callback_ctrl: ?*const fn ([*c]BIO, c_int, bio_info_cb) callconv(.C) c_long,
};
pub const struct_blake2b_state_st = opaque {};
pub const BLAKE2B_CTX = struct_blake2b_state_st;
pub const struct_bn_gencb_st = extern struct {
arg: ?*anyopaque,
- callback: ?fn (c_int, c_int, [*c]struct_bn_gencb_st) callconv(.C) c_int,
+ callback: ?*const fn (c_int, c_int, [*c]struct_bn_gencb_st) callconv(.C) c_int,
};
pub const BN_GENCB = struct_bn_gencb_st;
pub const struct_buf_mem_st = extern struct {
@@ -367,10 +367,10 @@ pub const EC_POINT = struct_ec_point_st;
pub const struct_ecdsa_method_st = extern struct {
common: struct_openssl_method_common_st,
app_data: ?*anyopaque,
- init: ?fn (?*EC_KEY) callconv(.C) c_int,
- finish: ?fn (?*EC_KEY) callconv(.C) c_int,
- group_order_size: ?fn (?*const EC_KEY) callconv(.C) usize,
- sign: ?fn ([*c]const u8, usize, [*c]u8, [*c]c_uint, ?*EC_KEY) callconv(.C) c_int,
+ init: ?*const fn (?*EC_KEY) callconv(.C) c_int,
+ finish: ?*const fn (?*EC_KEY) callconv(.C) c_int,
+ group_order_size: ?*const fn (?*const EC_KEY) callconv(.C) usize,
+ sign: ?*const fn ([*c]const u8, usize, [*c]u8, [*c]c_uint, ?*EC_KEY) callconv(.C) c_int,
flags: c_int,
};
pub const ECDSA_METHOD = struct_ecdsa_method_st;
@@ -516,9 +516,9 @@ pub const ssl_private_key_retry: c_int = 1;
pub const ssl_private_key_failure: c_int = 2;
pub const enum_ssl_private_key_result_t = c_uint;
pub const struct_ssl_private_key_method_st = extern struct {
- sign: ?fn (?*SSL, [*c]u8, [*c]usize, usize, u16, [*c]const u8, usize) callconv(.C) enum_ssl_private_key_result_t,
- decrypt: ?fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) enum_ssl_private_key_result_t,
- complete: ?fn (?*SSL, [*c]u8, [*c]usize, usize) callconv(.C) enum_ssl_private_key_result_t,
+ sign: ?*const fn (?*SSL, [*c]u8, [*c]usize, usize, u16, [*c]const u8, usize) callconv(.C) enum_ssl_private_key_result_t,
+ decrypt: ?*const fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) enum_ssl_private_key_result_t,
+ complete: ?*const fn (?*SSL, [*c]u8, [*c]usize, usize) callconv(.C) enum_ssl_private_key_result_t,
};
pub const SSL_PRIVATE_KEY_METHOD = struct_ssl_private_key_method_st;
pub const ssl_encryption_initial: c_int = 0;
@@ -527,11 +527,11 @@ pub const ssl_encryption_handshake: c_int = 2;
pub const ssl_encryption_application: c_int = 3;
pub const enum_ssl_encryption_level_t = c_uint;
pub const struct_ssl_quic_method_st = extern struct {
- set_read_secret: ?fn (?*SSL, enum_ssl_encryption_level_t, ?*const SSL_CIPHER, [*c]const u8, usize) callconv(.C) c_int,
- set_write_secret: ?fn (?*SSL, enum_ssl_encryption_level_t, ?*const SSL_CIPHER, [*c]const u8, usize) callconv(.C) c_int,
- add_handshake_data: ?fn (?*SSL, enum_ssl_encryption_level_t, [*c]const u8, usize) callconv(.C) c_int,
- flush_flight: ?fn (?*SSL) callconv(.C) c_int,
- send_alert: ?fn (?*SSL, enum_ssl_encryption_level_t, u8) callconv(.C) c_int,
+ set_read_secret: ?*const fn (?*SSL, enum_ssl_encryption_level_t, ?*const SSL_CIPHER, [*c]const u8, usize) callconv(.C) c_int,
+ set_write_secret: ?*const fn (?*SSL, enum_ssl_encryption_level_t, ?*const SSL_CIPHER, [*c]const u8, usize) callconv(.C) c_int,
+ add_handshake_data: ?*const fn (?*SSL, enum_ssl_encryption_level_t, [*c]const u8, usize) callconv(.C) c_int,
+ flush_flight: ?*const fn (?*SSL) callconv(.C) c_int,
+ send_alert: ?*const fn (?*SSL, enum_ssl_encryption_level_t, u8) callconv(.C) c_int,
};
pub const SSL_QUIC_METHOD = struct_ssl_quic_method_st;
pub const struct_ssl_session_st = opaque {};
@@ -542,9 +542,9 @@ pub const ssl_ticket_aead_ignore_ticket: c_int = 2;
pub const ssl_ticket_aead_error: c_int = 3;
pub const enum_ssl_ticket_aead_result_t = c_uint;
pub const struct_ssl_ticket_aead_method_st = extern struct {
- max_overhead: ?fn (?*SSL) callconv(.C) usize,
- seal: ?fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) c_int,
- open: ?fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) enum_ssl_ticket_aead_result_t,
+ max_overhead: ?*const fn (?*SSL) callconv(.C) usize,
+ seal: ?*const fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) c_int,
+ open: ?*const fn (?*SSL, [*c]u8, [*c]usize, usize, [*c]const u8, usize) callconv(.C) enum_ssl_ticket_aead_result_t,
};
pub const SSL_TICKET_AEAD_METHOD = struct_ssl_ticket_aead_method_st;
pub const struct_st_ERR_FNS = opaque {};
@@ -589,7 +589,7 @@ pub const X509_STORE = struct_x509_store_st;
pub const struct_x509_trust_st = extern struct {
trust: c_int,
flags: c_int,
- check_trust: ?fn ([*c]struct_x509_trust_st, ?*X509, c_int) callconv(.C) c_int,
+ check_trust: ?*const fn ([*c]struct_x509_trust_st, ?*X509, c_int) callconv(.C) c_int,
name: [*c]u8,
arg1: c_int,
arg2: ?*anyopaque,
@@ -611,10 +611,10 @@ pub const struct___sFILE = extern struct {
_bf: struct___sbuf,
_lbfsize: c_int,
_cookie: ?*anyopaque,
- _close: ?fn (?*anyopaque) callconv(.C) c_int,
- _read: ?fn (?*anyopaque, [*c]u8, c_int) callconv(.C) c_int,
- _seek: ?fn (?*anyopaque, fpos_t, c_int) callconv(.C) fpos_t,
- _write: ?fn (?*anyopaque, [*c]const u8, c_int) callconv(.C) c_int,
+ _close: ?*const fn (?*anyopaque) callconv(.C) c_int,
+ _read: ?*const fn (?*anyopaque, [*c]u8, c_int) callconv(.C) c_int,
+ _seek: ?*const fn (?*anyopaque, fpos_t, c_int) callconv(.C) fpos_t,
+ _write: ?*const fn (?*anyopaque, [*c]const u8, c_int) callconv(.C) c_int,
_ub: struct___sbuf,
_extra: ?*struct___sFILEX,
_ur: c_int,
@@ -636,7 +636,7 @@ pub extern fn BUF_MEM_append(buf: [*c]BUF_MEM, in: ?*const anyopaque, len: usize
pub extern fn BUF_strdup(str: [*c]const u8) [*c]u8;
pub extern fn BUF_strnlen(str: [*c]const u8, max_len: usize) usize;
pub extern fn BUF_strndup(str: [*c]const u8, size: usize) [*c]u8;
-pub extern fn BUF_memdup(data: ?*const anyopaque, size: usize) ?*anyopaque;
+pub extern fn BUF_memdup(data: ?[*]const u8, size: usize) ?*anyopaque;
pub extern fn BUF_strlcpy(dst: [*c]u8, src: [*c]const u8, dst_size: usize) usize;
pub extern fn BUF_strlcat(dst: [*c]u8, src: [*c]const u8, dst_size: usize) usize;
pub extern fn ERR_load_BIO_strings() void;
@@ -656,7 +656,7 @@ pub extern fn ERR_peek_last_error_line_data(file: [*c][*c]const u8, line: [*c]c_
pub extern fn ERR_error_string_n(packed_error: u32, buf: [*c]u8, len: usize) [*c]u8;
pub extern fn ERR_lib_error_string(packed_error: u32) [*c]const u8;
pub extern fn ERR_reason_error_string(packed_error: u32) [*c]const u8;
-pub const ERR_print_errors_callback_t = ?fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) c_int;
+pub const ERR_print_errors_callback_t = ?*const fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) c_int;
pub extern fn ERR_print_errors_cb(callback: ERR_print_errors_callback_t, ctx: ?*anyopaque) void;
pub extern fn ERR_print_errors_fp(file: [*c]FILE) void;
pub extern fn ERR_clear_error() void;
@@ -706,9 +706,9 @@ pub extern fn ERR_clear_system_error() void;
pub extern fn ERR_put_error(library: c_int, unused: c_int, reason: c_int, file: [*c]const u8, line: c_uint) void;
pub extern fn ERR_add_error_data(count: c_uint, ...) void;
pub extern fn ERR_add_error_dataf(format: [*c]const u8, ...) void;
-pub const stack_free_func = ?fn (?*anyopaque) callconv(.C) void;
-pub const stack_copy_func = ?fn (?*anyopaque) callconv(.C) ?*anyopaque;
-pub const stack_cmp_func = ?fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int;
+pub const stack_free_func = ?*const fn (?*anyopaque) callconv(.C) void;
+pub const stack_copy_func = ?*const fn (?*anyopaque) callconv(.C) ?*anyopaque;
+pub const stack_cmp_func = ?*const fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int;
pub const struct_stack_st = extern struct {
num: usize,
data: [*c]?*anyopaque,
@@ -724,11 +724,11 @@ pub extern fn sk_zero(sk: [*c]_STACK) void;
pub extern fn sk_value(sk: [*c]const _STACK, i: usize) ?*anyopaque;
pub extern fn sk_set(sk: [*c]_STACK, i: usize, p: ?*anyopaque) ?*anyopaque;
pub extern fn sk_free(sk: [*c]_STACK) void;
-pub extern fn sk_pop_free_ex(sk: [*c]_STACK, call_free_func: ?fn (stack_free_func, ?*anyopaque) callconv(.C) void, free_func: stack_free_func) void;
+pub extern fn sk_pop_free_ex(sk: [*c]_STACK, call_free_func: ?*const fn (stack_free_func, ?*anyopaque) callconv(.C) void, free_func: stack_free_func) void;
pub extern fn sk_insert(sk: [*c]_STACK, p: ?*anyopaque, where: usize) usize;
pub extern fn sk_delete(sk: [*c]_STACK, where: usize) ?*anyopaque;
pub extern fn sk_delete_ptr(sk: [*c]_STACK, p: ?*const anyopaque) ?*anyopaque;
-pub extern fn sk_find(sk: [*c]const _STACK, out_index: [*c]usize, p: ?*const anyopaque, call_cmp_func: ?fn (stack_cmp_func, [*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int) c_int;
+pub extern fn sk_find(sk: [*c]const _STACK, out_index: [*c]usize, p: ?*const anyopaque, call_cmp_func: ?*const fn (stack_cmp_func, [*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int) c_int;
pub extern fn sk_shift(sk: [*c]_STACK) ?*anyopaque;
pub extern fn sk_push(sk: [*c]_STACK, p: ?*anyopaque) usize;
pub extern fn sk_pop(sk: [*c]_STACK) ?*anyopaque;
@@ -736,12 +736,12 @@ pub extern fn sk_dup(sk: [*c]const _STACK) [*c]_STACK;
pub extern fn sk_sort(sk: [*c]_STACK) void;
pub extern fn sk_is_sorted(sk: [*c]const _STACK) c_int;
pub extern fn sk_set_cmp_func(sk: [*c]_STACK, comp: stack_cmp_func) stack_cmp_func;
-pub extern fn sk_deep_copy(sk: [*c]const _STACK, call_copy_func: ?fn (stack_copy_func, ?*anyopaque) callconv(.C) ?*anyopaque, copy_func: stack_copy_func, call_free_func: ?fn (stack_free_func, ?*anyopaque) callconv(.C) void, free_func: stack_free_func) [*c]_STACK;
+pub extern fn sk_deep_copy(sk: [*c]const _STACK, call_copy_func: ?*const fn (stack_copy_func, ?*anyopaque) callconv(.C) ?*anyopaque, copy_func: stack_copy_func, call_free_func: ?*const fn (stack_free_func, ?*anyopaque) callconv(.C) void, free_func: stack_free_func) [*c]_STACK;
pub extern fn sk_pop_free(sk: [*c]_STACK, free_func: stack_free_func) void;
pub const OPENSSL_STRING = [*c]u8;
-pub const stack_void_free_func = ?fn (?*anyopaque) callconv(.C) void;
-pub const stack_void_copy_func = ?fn (?*anyopaque) callconv(.C) ?*anyopaque;
-pub const stack_void_cmp_func = ?fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int;
+pub const stack_void_free_func = ?*const fn (?*anyopaque) callconv(.C) void;
+pub const stack_void_copy_func = ?*const fn (?*anyopaque) callconv(.C) ?*anyopaque;
+pub const stack_void_cmp_func = ?*const fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int;
pub fn sk_void_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -847,16 +847,16 @@ pub fn sk_void_set_cmp_func(arg_sk: ?*struct_stack_st_void, arg_comp: stack_void
var comp = arg_comp;
return @ptrCast(stack_void_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_void_deep_copy(arg_sk: ?*const struct_stack_st_void, arg_copy_func: ?fn (?*anyopaque) callconv(.C) ?*anyopaque, arg_free_func: ?fn (?*anyopaque) callconv(.C) void) callconv(.C) ?*struct_stack_st_void {
+pub fn sk_void_deep_copy(arg_sk: ?*const struct_stack_st_void, arg_copy_func: ?*const fn (?*anyopaque) callconv(.C) ?*anyopaque, arg_free_func: ?*const fn (?*anyopaque) callconv(.C) void) callconv(.C) ?*struct_stack_st_void {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_void, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_void_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_void_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
} // /Users/jarred/Code/bun/src/deps/boringssl/include/openssl/type_check.h:75:42: warning: ignoring StaticAssert declaration
pub const struct_stack_st_OPENSSL_STRING = opaque {};
-pub const stack_OPENSSL_STRING_free_func = ?fn (OPENSSL_STRING) callconv(.C) void;
-pub const stack_OPENSSL_STRING_copy_func = ?fn (OPENSSL_STRING) callconv(.C) OPENSSL_STRING;
-pub const stack_OPENSSL_STRING_cmp_func = ?fn ([*c]const OPENSSL_STRING, [*c]const OPENSSL_STRING) callconv(.C) c_int;
+pub const stack_OPENSSL_STRING_free_func = ?*const fn (OPENSSL_STRING) callconv(.C) void;
+pub const stack_OPENSSL_STRING_copy_func = ?*const fn (OPENSSL_STRING) callconv(.C) OPENSSL_STRING;
+pub const stack_OPENSSL_STRING_cmp_func = ?*const fn ([*c]const OPENSSL_STRING, [*c]const OPENSSL_STRING) callconv(.C) c_int;
pub fn sk_OPENSSL_STRING_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -960,41 +960,41 @@ pub fn sk_OPENSSL_STRING_set_cmp_func(arg_sk: ?*struct_stack_st_OPENSSL_STRING,
var comp = arg_comp;
return @ptrCast(stack_OPENSSL_STRING_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]const OPENSSL_STRING, [*c]const OPENSSL_STRING) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_OPENSSL_STRING_deep_copy(arg_sk: ?*const struct_stack_st_OPENSSL_STRING, arg_copy_func: ?fn (OPENSSL_STRING) callconv(.C) OPENSSL_STRING, arg_free_func: ?fn (OPENSSL_STRING) callconv(.C) void) callconv(.C) ?*struct_stack_st_OPENSSL_STRING {
+pub fn sk_OPENSSL_STRING_deep_copy(arg_sk: ?*const struct_stack_st_OPENSSL_STRING, arg_copy_func: ?*const fn (OPENSSL_STRING) callconv(.C) OPENSSL_STRING, arg_free_func: ?*const fn (OPENSSL_STRING) callconv(.C) void) callconv(.C) ?*struct_stack_st_OPENSSL_STRING {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_OPENSSL_STRING, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_OPENSSL_STRING_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_OPENSSL_STRING_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
-pub const CRYPTO_EX_free = fn (?*anyopaque, ?*anyopaque, [*c]CRYPTO_EX_DATA, c_int, c_long, ?*anyopaque) callconv(.C) void;
+pub const CRYPTO_EX_free = *const fn (?*anyopaque, ?*anyopaque, [*c]CRYPTO_EX_DATA, c_int, c_long, ?*anyopaque) callconv(.C) void;
pub extern fn CRYPTO_cleanup_all_ex_data() void;
-pub const CRYPTO_EX_dup = fn ([*c]CRYPTO_EX_DATA, [*c]const CRYPTO_EX_DATA, [*c]?*anyopaque, c_int, c_long, ?*anyopaque) callconv(.C) c_int;
+pub const CRYPTO_EX_dup = *const fn ([*c]CRYPTO_EX_DATA, [*c]const CRYPTO_EX_DATA, [*c]?*anyopaque, c_int, c_long, ?*anyopaque) callconv(.C) c_int;
pub const CRYPTO_EX_unused = c_int;
pub extern fn CRYPTO_num_locks() c_int;
-pub extern fn CRYPTO_set_locking_callback(func: ?fn (c_int, c_int, [*c]const u8, c_int) callconv(.C) void) void;
-pub extern fn CRYPTO_set_add_lock_callback(func: ?fn ([*c]c_int, c_int, c_int, [*c]const u8, c_int) callconv(.C) c_int) void;
-pub extern fn CRYPTO_get_locking_callback() ?fn (c_int, c_int, [*c]const u8, c_int) callconv(.C) void;
+pub extern fn CRYPTO_set_locking_callback(func: ?*const fn (c_int, c_int, [*c]const u8, c_int) callconv(.C) void) void;
+pub extern fn CRYPTO_set_add_lock_callback(func: ?*const fn ([*c]c_int, c_int, c_int, [*c]const u8, c_int) callconv(.C) c_int) void;
+pub extern fn CRYPTO_get_locking_callback() ?*const fn (c_int, c_int, [*c]const u8, c_int) callconv(.C) void;
pub extern fn CRYPTO_get_lock_name(lock_num: c_int) [*c]const u8;
-pub extern fn CRYPTO_THREADID_set_callback(threadid_func: ?fn ([*c]CRYPTO_THREADID) callconv(.C) void) c_int;
+pub extern fn CRYPTO_THREADID_set_callback(threadid_func: ?*const fn ([*c]CRYPTO_THREADID) callconv(.C) void) c_int;
pub extern fn CRYPTO_THREADID_set_numeric(id: [*c]CRYPTO_THREADID, val: c_ulong) void;
pub extern fn CRYPTO_THREADID_set_pointer(id: [*c]CRYPTO_THREADID, ptr: ?*anyopaque) void;
pub extern fn CRYPTO_THREADID_current(id: [*c]CRYPTO_THREADID) void;
-pub extern fn CRYPTO_set_id_callback(func: ?fn () callconv(.C) c_ulong) void;
+pub extern fn CRYPTO_set_id_callback(func: ?*const fn () callconv(.C) c_ulong) void;
pub const struct_CRYPTO_dynlock_value = opaque {};
pub const CRYPTO_dynlock = extern struct {
references: c_int,
data: ?*struct_CRYPTO_dynlock_value,
};
-pub extern fn CRYPTO_set_dynlock_create_callback(dyn_create_function: ?fn ([*c]const u8, c_int) callconv(.C) ?*struct_CRYPTO_dynlock_value) void;
-pub extern fn CRYPTO_set_dynlock_lock_callback(dyn_lock_function: ?fn (c_int, ?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void) void;
-pub extern fn CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function: ?fn (?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void) void;
-pub extern fn CRYPTO_get_dynlock_create_callback() ?fn ([*c]const u8, c_int) callconv(.C) ?*struct_CRYPTO_dynlock_value;
-pub extern fn CRYPTO_get_dynlock_lock_callback() ?fn (c_int, ?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void;
-pub extern fn CRYPTO_get_dynlock_destroy_callback() ?fn (?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void;
+pub extern fn CRYPTO_set_dynlock_create_callback(dyn_create_function: ?*const fn ([*c]const u8, c_int) callconv(.C) ?*struct_CRYPTO_dynlock_value) void;
+pub extern fn CRYPTO_set_dynlock_lock_callback(dyn_lock_function: ?*const fn (c_int, ?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void) void;
+pub extern fn CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function: ?*const fn (?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void) void;
+pub extern fn CRYPTO_get_dynlock_create_callback() ?*const fn ([*c]const u8, c_int) callconv(.C) ?*struct_CRYPTO_dynlock_value;
+pub extern fn CRYPTO_get_dynlock_lock_callback() ?*const fn (c_int, ?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void;
+pub extern fn CRYPTO_get_dynlock_destroy_callback() ?*const fn (?*struct_CRYPTO_dynlock_value, [*c]const u8, c_int) callconv(.C) void;
pub const struct_stack_st_BIO = opaque {};
-pub const stack_BIO_free_func = ?fn ([*c]BIO) callconv(.C) void;
-pub const stack_BIO_copy_func = ?fn ([*c]BIO) callconv(.C) [*c]BIO;
-pub const stack_BIO_cmp_func = ?fn ([*c][*c]const BIO, [*c][*c]const BIO) callconv(.C) c_int;
+pub const stack_BIO_free_func = ?*const fn ([*c]BIO) callconv(.C) void;
+pub const stack_BIO_copy_func = ?*const fn ([*c]BIO) callconv(.C) [*c]BIO;
+pub const stack_BIO_cmp_func = ?*const fn ([*c][*c]const BIO, [*c][*c]const BIO) callconv(.C) c_int;
pub fn sk_BIO_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -1100,7 +1100,7 @@ pub fn sk_BIO_set_cmp_func(arg_sk: ?*struct_stack_st_BIO, arg_comp: stack_BIO_cm
var comp = arg_comp;
return @ptrCast(stack_BIO_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const BIO, [*c][*c]const BIO) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_BIO_deep_copy(arg_sk: ?*const struct_stack_st_BIO, arg_copy_func: ?fn ([*c]BIO) callconv(.C) [*c]BIO, arg_free_func: ?fn ([*c]BIO) callconv(.C) void) callconv(.C) ?*struct_stack_st_BIO {
+pub fn sk_BIO_deep_copy(arg_sk: ?*const struct_stack_st_BIO, arg_copy_func: ?*const fn ([*c]BIO) callconv(.C) [*c]BIO, arg_free_func: ?*const fn ([*c]BIO) callconv(.C) void) callconv(.C) ?*struct_stack_st_BIO {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -1112,8 +1112,8 @@ pub extern fn BIO_vfree(bio: *BIO) void;
pub extern fn BIO_up_ref(bio: *BIO) c_int;
pub extern fn BIO_read(bio: *BIO, data: ?*anyopaque, len: c_int) c_int;
pub extern fn BIO_gets(bio: *BIO, buf: [*c]u8, size: c_int) c_int;
-pub extern fn BIO_write(bio: *BIO, data: ?*const anyopaque, len: c_int) c_int;
-pub extern fn BIO_write_all(bio: *BIO, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn BIO_write(bio: *BIO, data: ?[*]const u8, len: c_int) c_int;
+pub extern fn BIO_write_all(bio: *BIO, data: ?[*]const u8, len: usize) c_int;
pub extern fn BIO_puts(bio: *BIO, buf: [*c]const u8) c_int;
pub extern fn BIO_flush(bio: *BIO) c_int;
pub extern fn BIO_ctrl(bio: *BIO, cmd: c_int, larg: c_long, parg: ?*anyopaque) c_long;
@@ -1204,7 +1204,7 @@ pub extern fn BIO_set_retry_special(bio: [*c]BIO) void;
pub extern fn BIO_set_write_buffer_size(bio: [*c]BIO, buffer_size: c_int) c_int;
pub extern fn BIO_set_shutdown(bio: [*c]BIO, shutdown: c_int) void;
pub extern fn BIO_get_shutdown(bio: [*c]BIO) c_int;
-pub extern fn BIO_meth_set_puts(method: *BIO_METHOD, puts: ?fn ([*c]BIO, [*c]const u8) callconv(.C) c_int) c_int;
+pub extern fn BIO_meth_set_puts(method: *BIO_METHOD, puts: ?*const fn ([*c]BIO, [*c]const u8) callconv(.C) c_int) c_int;
pub extern fn EVP_EncodeBlock(dst: [*c]u8, src: [*c]const u8, src_len: usize) usize;
pub extern fn EVP_EncodedLength(out_len: [*c]usize, len: usize) c_int;
pub extern fn EVP_DecodedLength(out_len: [*c]usize, len: usize) c_int;
@@ -1314,19 +1314,19 @@ pub extern fn EVP_blake2b256() *const EVP_MD;
pub extern fn EVP_md5_sha1() *const EVP_MD;
pub extern fn EVP_get_digestbynid(nid: c_int) ?*const EVP_MD;
pub extern fn EVP_get_digestbyobj(obj: ?*const ASN1_OBJECT) ?*const EVP_MD;
-pub extern fn EVP_MD_CTX_init(ctx: [*c]EVP_MD_CTX) void;
+pub extern fn EVP_MD_CTX_init(ctx: *EVP_MD_CTX) void;
pub extern fn EVP_MD_CTX_new() [*c]EVP_MD_CTX;
-pub extern fn EVP_MD_CTX_cleanup(ctx: [*c]EVP_MD_CTX) c_int;
-pub extern fn EVP_MD_CTX_free(ctx: [*c]EVP_MD_CTX) void;
+pub extern fn EVP_MD_CTX_cleanup(ctx: *EVP_MD_CTX) c_int;
+pub extern fn EVP_MD_CTX_free(ctx: *EVP_MD_CTX) void;
pub extern fn EVP_MD_CTX_copy_ex(out: [*c]EVP_MD_CTX, in: [*c]const EVP_MD_CTX) c_int;
pub extern fn EVP_MD_CTX_move(out: [*c]EVP_MD_CTX, in: [*c]EVP_MD_CTX) void;
-pub extern fn EVP_MD_CTX_reset(ctx: [*c]EVP_MD_CTX) c_int;
-pub extern fn EVP_DigestInit_ex(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD, engine: ?*ENGINE) c_int;
-pub extern fn EVP_DigestInit(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
-pub extern fn EVP_DigestUpdate(ctx: [*c]EVP_MD_CTX, data: ?*const anyopaque, len: usize) c_int;
-pub extern fn EVP_DigestFinal_ex(ctx: [*c]EVP_MD_CTX, md_out: [*c]u8, out_size: [*c]c_uint) c_int;
-pub extern fn EVP_DigestFinal(ctx: [*c]EVP_MD_CTX, md_out: [*c]u8, out_size: [*c]c_uint) c_int;
-pub extern fn EVP_Digest(data: ?*const anyopaque, len: usize, md_out: [*c]u8, md_out_size: [*c]c_uint, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
+pub extern fn EVP_MD_CTX_reset(ctx: *EVP_MD_CTX) c_int;
+pub extern fn EVP_DigestInit_ex(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD, engine: ?*ENGINE) c_int;
+pub extern fn EVP_DigestInit(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
+pub extern fn EVP_DigestUpdate(ctx: *EVP_MD_CTX, data: ?[*]const u8, len: usize) c_int;
+pub extern fn EVP_DigestFinal_ex(ctx: *EVP_MD_CTX, md_out: [*]u8, out_size: ?[*]c_uint) c_int;
+pub extern fn EVP_DigestFinal(ctx: *EVP_MD_CTX, md_out: [*]u8, out_size: ?[*]c_uint) c_int;
+pub extern fn EVP_Digest(data: ?[*]const u8, len: usize, md_out: [*c]u8, md_out_size: [*c]c_uint, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
pub extern fn EVP_MD_type(md: ?*const EVP_MD) c_int;
pub extern fn EVP_MD_flags(md: ?*const EVP_MD) u32;
pub extern fn EVP_MD_size(md: ?*const EVP_MD) usize;
@@ -1342,10 +1342,10 @@ pub extern fn EVP_add_digest(digest: ?*const EVP_MD) c_int;
pub extern fn EVP_get_digestbyname([*c]const u8) ?*const EVP_MD;
pub extern fn EVP_dss1() ?*const EVP_MD;
pub extern fn EVP_MD_CTX_create() [*c]EVP_MD_CTX;
-pub extern fn EVP_MD_CTX_destroy(ctx: [*c]EVP_MD_CTX) void;
-pub extern fn EVP_DigestFinalXOF(ctx: [*c]EVP_MD_CTX, out: [*c]u8, len: usize) c_int;
+pub extern fn EVP_MD_CTX_destroy(ctx: *EVP_MD_CTX) void;
+pub extern fn EVP_DigestFinalXOF(ctx: *EVP_MD_CTX, out: [*c]u8, len: usize) c_int;
pub extern fn EVP_MD_meth_get_flags(md: ?*const EVP_MD) u32;
-pub extern fn EVP_MD_CTX_set_flags(ctx: [*c]EVP_MD_CTX, flags: c_int) void;
+pub extern fn EVP_MD_CTX_set_flags(ctx: *EVP_MD_CTX, flags: c_int) void;
pub extern fn EVP_MD_nid(md: ?*const EVP_MD) c_int;
pub extern fn EVP_aead_aes_128_gcm() ?*const EVP_AEAD;
pub extern fn EVP_aead_aes_192_gcm() ?*const EVP_AEAD;
@@ -1436,22 +1436,22 @@ pub extern fn EVP_PKEY_new_raw_private_key(@"type": c_int, unused: ?*ENGINE, in:
pub extern fn EVP_PKEY_new_raw_public_key(@"type": c_int, unused: ?*ENGINE, in: [*c]const u8, len: usize) [*c]EVP_PKEY;
pub extern fn EVP_PKEY_get_raw_private_key(pkey: [*c]const EVP_PKEY, out: [*c]u8, out_len: [*c]usize) c_int;
pub extern fn EVP_PKEY_get_raw_public_key(pkey: [*c]const EVP_PKEY, out: [*c]u8, out_len: [*c]usize) c_int;
-pub extern fn EVP_DigestSignInit(ctx: [*c]EVP_MD_CTX, pctx: [*c]?*EVP_PKEY_CTX, @"type": ?*const EVP_MD, e: ?*ENGINE, pkey: [*c]EVP_PKEY) c_int;
-pub extern fn EVP_DigestSignUpdate(ctx: [*c]EVP_MD_CTX, data: ?*const anyopaque, len: usize) c_int;
-pub extern fn EVP_DigestSignFinal(ctx: [*c]EVP_MD_CTX, out_sig: [*c]u8, out_sig_len: [*c]usize) c_int;
-pub extern fn EVP_DigestSign(ctx: [*c]EVP_MD_CTX, out_sig: [*c]u8, out_sig_len: [*c]usize, data: [*c]const u8, data_len: usize) c_int;
-pub extern fn EVP_DigestVerifyInit(ctx: [*c]EVP_MD_CTX, pctx: [*c]?*EVP_PKEY_CTX, @"type": ?*const EVP_MD, e: ?*ENGINE, pkey: [*c]EVP_PKEY) c_int;
-pub extern fn EVP_DigestVerifyUpdate(ctx: [*c]EVP_MD_CTX, data: ?*const anyopaque, len: usize) c_int;
-pub extern fn EVP_DigestVerifyFinal(ctx: [*c]EVP_MD_CTX, sig: [*c]const u8, sig_len: usize) c_int;
-pub extern fn EVP_DigestVerify(ctx: [*c]EVP_MD_CTX, sig: [*c]const u8, sig_len: usize, data: [*c]const u8, len: usize) c_int;
-pub extern fn EVP_SignInit_ex(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
-pub extern fn EVP_SignInit(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
-pub extern fn EVP_SignUpdate(ctx: [*c]EVP_MD_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn EVP_DigestSignInit(ctx: *EVP_MD_CTX, pctx: [*c]?*EVP_PKEY_CTX, @"type": ?*const EVP_MD, e: ?*ENGINE, pkey: [*c]EVP_PKEY) c_int;
+pub extern fn EVP_DigestSignUpdate(ctx: *EVP_MD_CTX, data: ?[*]const u8, len: usize) c_int;
+pub extern fn EVP_DigestSignFinal(ctx: *EVP_MD_CTX, out_sig: [*c]u8, out_sig_len: [*c]usize) c_int;
+pub extern fn EVP_DigestSign(ctx: *EVP_MD_CTX, out_sig: [*c]u8, out_sig_len: [*c]usize, data: [*c]const u8, data_len: usize) c_int;
+pub extern fn EVP_DigestVerifyInit(ctx: *EVP_MD_CTX, pctx: [*c]?*EVP_PKEY_CTX, @"type": ?*const EVP_MD, e: ?*ENGINE, pkey: [*c]EVP_PKEY) c_int;
+pub extern fn EVP_DigestVerifyUpdate(ctx: *EVP_MD_CTX, data: ?[*]const u8, len: usize) c_int;
+pub extern fn EVP_DigestVerifyFinal(ctx: *EVP_MD_CTX, sig: [*c]const u8, sig_len: usize) c_int;
+pub extern fn EVP_DigestVerify(ctx: *EVP_MD_CTX, sig: [*c]const u8, sig_len: usize, data: [*c]const u8, len: usize) c_int;
+pub extern fn EVP_SignInit_ex(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
+pub extern fn EVP_SignInit(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
+pub extern fn EVP_SignUpdate(ctx: *EVP_MD_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn EVP_SignFinal(ctx: [*c]const EVP_MD_CTX, sig: [*c]u8, out_sig_len: [*c]c_uint, pkey: [*c]EVP_PKEY) c_int;
-pub extern fn EVP_VerifyInit_ex(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
-pub extern fn EVP_VerifyInit(ctx: [*c]EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
-pub extern fn EVP_VerifyUpdate(ctx: [*c]EVP_MD_CTX, data: ?*const anyopaque, len: usize) c_int;
-pub extern fn EVP_VerifyFinal(ctx: [*c]EVP_MD_CTX, sig: [*c]const u8, sig_len: usize, pkey: [*c]EVP_PKEY) c_int;
+pub extern fn EVP_VerifyInit_ex(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD, impl: ?*ENGINE) c_int;
+pub extern fn EVP_VerifyInit(ctx: *EVP_MD_CTX, @"type": ?*const EVP_MD) c_int;
+pub extern fn EVP_VerifyUpdate(ctx: *EVP_MD_CTX, data: ?[*]const u8, len: usize) c_int;
+pub extern fn EVP_VerifyFinal(ctx: *EVP_MD_CTX, sig: [*c]const u8, sig_len: usize, pkey: [*c]EVP_PKEY) c_int;
pub extern fn EVP_PKEY_print_public(out: [*c]BIO, pkey: [*c]const EVP_PKEY, indent: c_int, pctx: ?*ASN1_PCTX) c_int;
pub extern fn EVP_PKEY_print_private(out: [*c]BIO, pkey: [*c]const EVP_PKEY, indent: c_int, pctx: ?*ASN1_PCTX) c_int;
pub extern fn EVP_PKEY_print_params(out: [*c]BIO, pkey: [*c]const EVP_PKEY, indent: c_int, pctx: ?*ASN1_PCTX) c_int;
@@ -1528,9 +1528,9 @@ pub extern fn OPENSSL_add_all_algorithms_conf() void;
pub extern fn OpenSSL_add_all_ciphers() void;
pub extern fn OpenSSL_add_all_digests() void;
pub extern fn EVP_cleanup() void;
-pub extern fn EVP_CIPHER_do_all_sorted(callback: ?fn ([*c]const EVP_CIPHER, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
-pub extern fn EVP_MD_do_all_sorted(callback: ?fn (?*const EVP_MD, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
-pub extern fn EVP_MD_do_all(callback: ?fn (?*const EVP_MD, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
+pub extern fn EVP_CIPHER_do_all_sorted(callback: ?*const fn ([*c]const EVP_CIPHER, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
+pub extern fn EVP_MD_do_all_sorted(callback: ?*const fn (?*const EVP_MD, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
+pub extern fn EVP_MD_do_all(callback: ?*const fn (?*const EVP_MD, [*c]const u8, [*c]const u8, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
pub extern fn i2d_PrivateKey(key: [*c]const EVP_PKEY, outp: [*c][*c]u8) c_int;
pub extern fn i2d_PublicKey(key: [*c]const EVP_PKEY, outp: [*c][*c]u8) c_int;
pub extern fn d2i_PrivateKey(@"type": c_int, out: [*c][*c]EVP_PKEY, inp: [*c][*c]const u8, len: c_long) [*c]EVP_PKEY;
@@ -1693,7 +1693,7 @@ pub extern fn BN_pseudo_rand(rnd: [*c]BIGNUM, bits: c_int, top: c_int, bottom: c
pub extern fn BN_rand_range(rnd: [*c]BIGNUM, range: [*c]const BIGNUM) c_int;
pub extern fn BN_rand_range_ex(r: [*c]BIGNUM, min_inclusive: u64, max_exclusive: [*c]const BIGNUM) c_int;
pub extern fn BN_pseudo_rand_range(rnd: [*c]BIGNUM, range: [*c]const BIGNUM) c_int;
-pub extern fn BN_GENCB_set(callback: [*c]BN_GENCB, f: ?fn (c_int, c_int, [*c]BN_GENCB) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn BN_GENCB_set(callback: [*c]BN_GENCB, f: ?*const fn (c_int, c_int, [*c]BN_GENCB) callconv(.C) c_int, arg: ?*anyopaque) void;
pub extern fn BN_GENCB_call(callback: [*c]BN_GENCB, event: c_int, n: c_int) c_int;
pub extern fn BN_generate_prime_ex(ret: [*c]BIGNUM, bits: c_int, safe: c_int, add: [*c]const BIGNUM, rem: [*c]const BIGNUM, cb: [*c]BN_GENCB) c_int;
pub const bn_probably_prime: c_int = 0;
@@ -1730,8 +1730,8 @@ pub extern fn BN_bn2binpad(in: [*c]const BIGNUM, out: [*c]u8, len: c_int) c_int;
pub extern fn BN_num_bits_word(l: u64) c_uint;
pub extern fn ASN1_tag2bit(tag: c_int) c_ulong;
pub extern fn ASN1_tag2str(tag: c_int) [*c]const u8;
-pub const d2i_of_void = fn ([*c]?*anyopaque, [*c][*c]const u8, c_long) callconv(.C) ?*anyopaque;
-pub const i2d_of_void = fn (?*const anyopaque, [*c][*c]u8) callconv(.C) c_int;
+pub const d2i_of_void = *const fn ([*c]?*anyopaque, [*c][*c]const u8, c_long) callconv(.C) ?*anyopaque;
+pub const i2d_of_void = *const fn (?*const anyopaque, [*c][*c]u8) callconv(.C) c_int;
pub const ASN1_ITEM_EXP = ASN1_ITEM;
pub extern fn ASN1_item_new(it: ?*const ASN1_ITEM) ?*ASN1_VALUE;
pub extern fn ASN1_item_free(val: ?*ASN1_VALUE, it: ?*const ASN1_ITEM) void;
@@ -1759,7 +1759,7 @@ pub extern fn ASN1_STRING_get0_data(str: [*c]const ASN1_STRING) [*c]const u8;
pub extern fn ASN1_STRING_data(str: [*c]ASN1_STRING) [*c]u8;
pub extern fn ASN1_STRING_length(str: [*c]const ASN1_STRING) c_int;
pub extern fn ASN1_STRING_cmp(a: [*c]const ASN1_STRING, b: [*c]const ASN1_STRING) c_int;
-pub extern fn ASN1_STRING_set(str: [*c]ASN1_STRING, data: ?*const anyopaque, len: c_int) c_int;
+pub extern fn ASN1_STRING_set(str: [*c]ASN1_STRING, data: ?[*]const u8, len: c_int) c_int;
pub extern fn ASN1_STRING_set0(str: [*c]ASN1_STRING, data: ?*anyopaque, len: c_int) void;
pub extern fn ASN1_BMPSTRING_new() [*c]ASN1_BMPSTRING;
pub extern fn ASN1_GENERALSTRING_new() [*c]ASN1_GENERALSTRING;
@@ -1837,9 +1837,9 @@ pub extern fn ASN1_BIT_STRING_set_bit(str: [*c]ASN1_BIT_STRING, n: c_int, value:
pub extern fn ASN1_BIT_STRING_get_bit(str: [*c]const ASN1_BIT_STRING, n: c_int) c_int;
pub extern fn ASN1_BIT_STRING_check(str: [*c]const ASN1_BIT_STRING, flags: [*c]const u8, flags_len: c_int) c_int;
pub const struct_stack_st_ASN1_INTEGER = opaque {};
-pub const stack_ASN1_INTEGER_free_func = ?fn ([*c]ASN1_INTEGER) callconv(.C) void;
-pub const stack_ASN1_INTEGER_copy_func = ?fn ([*c]ASN1_INTEGER) callconv(.C) [*c]ASN1_INTEGER;
-pub const stack_ASN1_INTEGER_cmp_func = ?fn ([*c][*c]const ASN1_INTEGER, [*c][*c]const ASN1_INTEGER) callconv(.C) c_int;
+pub const stack_ASN1_INTEGER_free_func = ?*const fn ([*c]ASN1_INTEGER) callconv(.C) void;
+pub const stack_ASN1_INTEGER_copy_func = ?*const fn ([*c]ASN1_INTEGER) callconv(.C) [*c]ASN1_INTEGER;
+pub const stack_ASN1_INTEGER_cmp_func = ?*const fn ([*c][*c]const ASN1_INTEGER, [*c][*c]const ASN1_INTEGER) callconv(.C) c_int;
pub fn sk_ASN1_INTEGER_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -1945,7 +1945,7 @@ pub fn sk_ASN1_INTEGER_set_cmp_func(arg_sk: ?*struct_stack_st_ASN1_INTEGER, arg_
var comp = arg_comp;
return @ptrCast(stack_ASN1_INTEGER_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const ASN1_INTEGER, [*c][*c]const ASN1_INTEGER) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_ASN1_INTEGER_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_INTEGER, arg_copy_func: ?fn ([*c]ASN1_INTEGER) callconv(.C) [*c]ASN1_INTEGER, arg_free_func: ?fn ([*c]ASN1_INTEGER) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_INTEGER {
+pub fn sk_ASN1_INTEGER_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_INTEGER, arg_copy_func: ?*const fn ([*c]ASN1_INTEGER) callconv(.C) [*c]ASN1_INTEGER, arg_free_func: ?*const fn ([*c]ASN1_INTEGER) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_INTEGER {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -2010,9 +2010,9 @@ pub extern fn d2i_ASN1_NULL(out: [*c]?*ASN1_NULL, inp: [*c][*c]const u8, len: c_
pub extern fn i2d_ASN1_NULL(in: ?*const ASN1_NULL, outp: [*c][*c]u8) c_int;
pub extern const ASN1_NULL_it: ASN1_ITEM;
pub const struct_stack_st_ASN1_OBJECT = opaque {};
-pub const stack_ASN1_OBJECT_free_func = ?fn (?*ASN1_OBJECT) callconv(.C) void;
-pub const stack_ASN1_OBJECT_copy_func = ?fn (?*ASN1_OBJECT) callconv(.C) ?*ASN1_OBJECT;
-pub const stack_ASN1_OBJECT_cmp_func = ?fn ([*c]?*const ASN1_OBJECT, [*c]?*const ASN1_OBJECT) callconv(.C) c_int;
+pub const stack_ASN1_OBJECT_free_func = ?*const fn (?*ASN1_OBJECT) callconv(.C) void;
+pub const stack_ASN1_OBJECT_copy_func = ?*const fn (?*ASN1_OBJECT) callconv(.C) ?*ASN1_OBJECT;
+pub const stack_ASN1_OBJECT_cmp_func = ?*const fn ([*c]?*const ASN1_OBJECT, [*c]?*const ASN1_OBJECT) callconv(.C) c_int;
pub fn sk_ASN1_OBJECT_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -2118,7 +2118,7 @@ pub fn sk_ASN1_OBJECT_set_cmp_func(arg_sk: ?*struct_stack_st_ASN1_OBJECT, arg_co
var comp = arg_comp;
return @ptrCast(stack_ASN1_OBJECT_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const ASN1_OBJECT, [*c]?*const ASN1_OBJECT) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_ASN1_OBJECT_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_OBJECT, arg_copy_func: ?fn (?*ASN1_OBJECT) callconv(.C) ?*ASN1_OBJECT, arg_free_func: ?fn (?*ASN1_OBJECT) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_OBJECT {
+pub fn sk_ASN1_OBJECT_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_OBJECT, arg_copy_func: ?*const fn (?*ASN1_OBJECT) callconv(.C) ?*ASN1_OBJECT, arg_free_func: ?*const fn (?*ASN1_OBJECT) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_OBJECT {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -2131,9 +2131,9 @@ pub extern fn i2d_ASN1_OBJECT(a: ?*const ASN1_OBJECT, outp: [*c][*c]u8) c_int;
pub extern fn c2i_ASN1_OBJECT(out: [*c]?*ASN1_OBJECT, inp: [*c][*c]const u8, len: c_long) ?*ASN1_OBJECT;
pub extern const ASN1_OBJECT_it: ASN1_ITEM;
pub const struct_stack_st_ASN1_TYPE = opaque {};
-pub const stack_ASN1_TYPE_free_func = ?fn ([*c]ASN1_TYPE) callconv(.C) void;
-pub const stack_ASN1_TYPE_copy_func = ?fn ([*c]ASN1_TYPE) callconv(.C) [*c]ASN1_TYPE;
-pub const stack_ASN1_TYPE_cmp_func = ?fn ([*c][*c]const ASN1_TYPE, [*c][*c]const ASN1_TYPE) callconv(.C) c_int;
+pub const stack_ASN1_TYPE_free_func = ?*const fn ([*c]ASN1_TYPE) callconv(.C) void;
+pub const stack_ASN1_TYPE_copy_func = ?*const fn ([*c]ASN1_TYPE) callconv(.C) [*c]ASN1_TYPE;
+pub const stack_ASN1_TYPE_cmp_func = ?*const fn ([*c][*c]const ASN1_TYPE, [*c][*c]const ASN1_TYPE) callconv(.C) c_int;
pub fn sk_ASN1_TYPE_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -2239,7 +2239,7 @@ pub fn sk_ASN1_TYPE_set_cmp_func(arg_sk: ?*struct_stack_st_ASN1_TYPE, arg_comp:
var comp = arg_comp;
return @ptrCast(stack_ASN1_TYPE_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const ASN1_TYPE, [*c][*c]const ASN1_TYPE) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_ASN1_TYPE_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_TYPE, arg_copy_func: ?fn ([*c]ASN1_TYPE) callconv(.C) [*c]ASN1_TYPE, arg_free_func: ?fn ([*c]ASN1_TYPE) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_TYPE {
+pub fn sk_ASN1_TYPE_deep_copy(arg_sk: ?*const struct_stack_st_ASN1_TYPE, arg_copy_func: ?*const fn ([*c]ASN1_TYPE) callconv(.C) [*c]ASN1_TYPE, arg_free_func: ?*const fn ([*c]ASN1_TYPE) callconv(.C) void) callconv(.C) ?*struct_stack_st_ASN1_TYPE {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -2310,7 +2310,7 @@ pub extern fn DH_check_pub_key(dh: [*c]const DH, pub_key: [*c]const BIGNUM, out_
pub extern fn DHparams_dup(dh: [*c]const DH) [*c]DH;
pub extern fn DH_parse_parameters(cbs: [*c]CBS) [*c]DH;
pub extern fn DH_marshal_parameters(cbb: [*c]CBB, dh: [*c]const DH) c_int;
-pub extern fn DH_generate_parameters(prime_len: c_int, generator: c_int, callback: ?fn (c_int, c_int, ?*anyopaque) callconv(.C) void, cb_arg: ?*anyopaque) [*c]DH;
+pub extern fn DH_generate_parameters(prime_len: c_int, generator: c_int, callback: ?*const fn (c_int, c_int, ?*anyopaque) callconv(.C) void, cb_arg: ?*anyopaque) [*c]DH;
pub extern fn d2i_DHparams(ret: [*c][*c]DH, inp: [*c][*c]const u8, len: c_long) [*c]DH;
pub extern fn i2d_DHparams(in: [*c]const DH, outp: [*c][*c]u8) c_int;
pub extern fn DH_compute_key(out: [*c]u8, peers_key: [*c]const BIGNUM, dh: [*c]DH) c_int;
@@ -2368,7 +2368,7 @@ pub extern fn d2i_DSAPrivateKey(out: [*c][*c]DSA, inp: [*c][*c]const u8, len: c_
pub extern fn i2d_DSAPrivateKey(in: [*c]const DSA, outp: [*c][*c]u8) c_int;
pub extern fn d2i_DSAparams(out: [*c][*c]DSA, inp: [*c][*c]const u8, len: c_long) [*c]DSA;
pub extern fn i2d_DSAparams(in: [*c]const DSA, outp: [*c][*c]u8) c_int;
-pub extern fn DSA_generate_parameters(bits: c_int, seed: [*c]u8, seed_len: c_int, counter_ret: [*c]c_int, h_ret: [*c]c_ulong, callback: ?fn (c_int, c_int, ?*anyopaque) callconv(.C) void, cb_arg: ?*anyopaque) [*c]DSA;
+pub extern fn DSA_generate_parameters(bits: c_int, seed: [*c]u8, seed_len: c_int, counter_ret: [*c]c_int, h_ret: [*c]c_ulong, callback: ?*const fn (c_int, c_int, ?*anyopaque) callconv(.C) void, cb_arg: ?*anyopaque) [*c]DSA;
pub const POINT_CONVERSION_COMPRESSED: c_int = 2;
pub const POINT_CONVERSION_UNCOMPRESSED: c_int = 4;
pub const POINT_CONVERSION_HYBRID: c_int = 6;
@@ -2461,7 +2461,7 @@ pub extern fn d2i_ECParameters(out_key: [*c]?*EC_KEY, inp: [*c][*c]const u8, len
pub extern fn i2d_ECParameters(key: ?*const EC_KEY, outp: [*c][*c]u8) c_int;
pub extern fn o2i_ECPublicKey(out_key: [*c]?*EC_KEY, inp: [*c][*c]const u8, len: c_long) ?*EC_KEY;
pub extern fn i2o_ECPublicKey(key: ?*const EC_KEY, outp: [*c][*c]u8) c_int;
-pub extern fn ECDH_compute_key(out: ?*anyopaque, outlen: usize, pub_key: ?*const EC_POINT, priv_key: ?*const EC_KEY, kdf: ?fn (?*const anyopaque, usize, ?*anyopaque, [*c]usize) callconv(.C) ?*anyopaque) c_int;
+pub extern fn ECDH_compute_key(out: ?*anyopaque, outlen: usize, pub_key: ?*const EC_POINT, priv_key: ?*const EC_KEY, kdf: ?*const fn (?*const anyopaque, usize, ?*anyopaque, [*c]usize) callconv(.C) ?*anyopaque) c_int;
pub extern fn ECDH_compute_key_fips(out: [*c]u8, out_len: usize, pub_key: ?*const EC_POINT, priv_key: ?*const EC_KEY) c_int;
pub extern fn ECDSA_sign(@"type": c_int, digest: [*c]const u8, digest_len: usize, sig: [*c]u8, sig_len: [*c]c_uint, key: ?*const EC_KEY) c_int;
pub extern fn ECDSA_verify(@"type": c_int, digest: [*c]const u8, digest_len: usize, sig: [*c]const u8, sig_len: usize, key: ?*const EC_KEY) c_int;
@@ -2580,12 +2580,12 @@ pub const struct_obj_name_st = extern struct {
data: [*c]const u8,
};
pub const OBJ_NAME = struct_obj_name_st;
-pub extern fn OBJ_NAME_do_all_sorted(@"type": c_int, callback: ?fn ([*c]const OBJ_NAME, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
-pub extern fn OBJ_NAME_do_all(@"type": c_int, callback: ?fn ([*c]const OBJ_NAME, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
+pub extern fn OBJ_NAME_do_all_sorted(@"type": c_int, callback: ?*const fn ([*c]const OBJ_NAME, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
+pub extern fn OBJ_NAME_do_all(@"type": c_int, callback: ?*const fn ([*c]const OBJ_NAME, ?*anyopaque) callconv(.C) void, arg: ?*anyopaque) void;
pub extern fn OBJ_cleanup() void;
-pub const stack_CRYPTO_BUFFER_free_func = ?fn (?*CRYPTO_BUFFER) callconv(.C) void;
-pub const stack_CRYPTO_BUFFER_copy_func = ?fn (?*CRYPTO_BUFFER) callconv(.C) ?*CRYPTO_BUFFER;
-pub const stack_CRYPTO_BUFFER_cmp_func = ?fn ([*c]?*const CRYPTO_BUFFER, [*c]?*const CRYPTO_BUFFER) callconv(.C) c_int;
+pub const stack_CRYPTO_BUFFER_free_func = ?*const fn (?*CRYPTO_BUFFER) callconv(.C) void;
+pub const stack_CRYPTO_BUFFER_copy_func = ?*const fn (?*CRYPTO_BUFFER) callconv(.C) ?*CRYPTO_BUFFER;
+pub const stack_CRYPTO_BUFFER_cmp_func = ?*const fn ([*c]?*const CRYPTO_BUFFER, [*c]?*const CRYPTO_BUFFER) callconv(.C) c_int;
pub fn sk_CRYPTO_BUFFER_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -2691,7 +2691,7 @@ pub fn sk_CRYPTO_BUFFER_set_cmp_func(arg_sk: ?*struct_stack_st_CRYPTO_BUFFER, ar
var comp = arg_comp;
return @ptrCast(stack_CRYPTO_BUFFER_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const CRYPTO_BUFFER, [*c]?*const CRYPTO_BUFFER) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_CRYPTO_BUFFER_deep_copy(arg_sk: ?*const struct_stack_st_CRYPTO_BUFFER, arg_copy_func: ?fn (?*CRYPTO_BUFFER) callconv(.C) ?*CRYPTO_BUFFER, arg_free_func: ?fn (?*CRYPTO_BUFFER) callconv(.C) void) callconv(.C) ?*struct_stack_st_CRYPTO_BUFFER {
+pub fn sk_CRYPTO_BUFFER_deep_copy(arg_sk: ?*const struct_stack_st_CRYPTO_BUFFER, arg_copy_func: ?*const fn (?*CRYPTO_BUFFER) callconv(.C) ?*CRYPTO_BUFFER, arg_free_func: ?*const fn (?*CRYPTO_BUFFER) callconv(.C) void) callconv(.C) ?*struct_stack_st_CRYPTO_BUFFER {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -2775,31 +2775,31 @@ pub extern fn RSA_padding_add_PKCS1_OAEP(to: [*c]u8, to_len: usize, from: [*c]co
pub extern fn RSA_print(bio: [*c]BIO, rsa: ?*const RSA, indent: c_int) c_int;
pub extern fn RSA_get0_pss_params(rsa: ?*const RSA) [*c]const RSA_PSS_PARAMS;
pub extern fn SHA1_Init(sha: *SHA_CTX) c_int;
-pub extern fn SHA1_Update(sha: *SHA_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA1_Update(sha: *SHA_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA1_Final(out: [*]u8, sha: *SHA_CTX) c_int;
pub extern fn SHA1(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn SHA1_Transform(sha: *SHA_CTX, block: [*]const u8) void;
pub extern fn SHA224_Init(sha: *SHA256_CTX) c_int;
-pub extern fn SHA224_Update(sha: *SHA256_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA224_Update(sha: *SHA256_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA224_Final(out: [*]u8, sha: *SHA256_CTX) c_int;
pub extern fn SHA224(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn SHA256_Init(sha: *SHA256_CTX) c_int;
-pub extern fn SHA256_Update(sha: *SHA256_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA256_Update(sha: *SHA256_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA256_Final(out: [*]u8, sha: *SHA256_CTX) c_int;
pub extern fn SHA256(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn SHA256_Transform(sha: *SHA256_CTX, block: [*]const u8) void;
pub extern fn SHA256_TransformBlocks(state: [*c]u32, data: [*]const u8, num_blocks: usize) void;
pub extern fn SHA384_Init(sha: *SHA512_CTX) c_int;
-pub extern fn SHA384_Update(sha: *SHA512_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA384_Update(sha: *SHA512_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA384_Final(out: [*]u8, sha: *SHA512_CTX) c_int;
pub extern fn SHA384(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn SHA512_Init(sha: *SHA512_CTX) c_int;
-pub extern fn SHA512_Update(sha: *SHA512_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA512_Update(sha: *SHA512_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA512_Final(out: [*]u8, sha: *SHA512_CTX) c_int;
pub extern fn SHA512(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn SHA512_Transform(sha: *SHA512_CTX, block: [*]const u8) void;
pub extern fn SHA512_256_Init(sha: *SHA512_CTX) c_int;
-pub extern fn SHA512_256_Update(sha: *SHA512_CTX, data: ?*const anyopaque, len: usize) c_int;
+pub extern fn SHA512_256_Update(sha: *SHA512_CTX, data: ?[*]const u8, len: usize) c_int;
pub extern fn SHA512_256_Final(out: [*]u8, sha: *SHA512_CTX) c_int;
pub extern fn SHA512_256(data: [*]const u8, len: usize, out: [*]u8) [*]u8;
pub extern fn X509_ALGOR_new() [*c]X509_ALGOR;
@@ -2808,9 +2808,9 @@ pub extern fn d2i_X509_ALGOR(a: [*c][*c]X509_ALGOR, in: [*c][*c]const u8, len: c
pub extern fn i2d_X509_ALGOR(a: [*c]X509_ALGOR, out: [*c][*c]u8) c_int;
pub extern const X509_ALGOR_it: ASN1_ITEM;
pub const struct_stack_st_X509_ALGOR = opaque {};
-pub const stack_X509_ALGOR_free_func = ?fn ([*c]X509_ALGOR) callconv(.C) void;
-pub const stack_X509_ALGOR_copy_func = ?fn ([*c]X509_ALGOR) callconv(.C) [*c]X509_ALGOR;
-pub const stack_X509_ALGOR_cmp_func = ?fn ([*c][*c]const X509_ALGOR, [*c][*c]const X509_ALGOR) callconv(.C) c_int;
+pub const stack_X509_ALGOR_free_func = ?*const fn ([*c]X509_ALGOR) callconv(.C) void;
+pub const stack_X509_ALGOR_copy_func = ?*const fn ([*c]X509_ALGOR) callconv(.C) [*c]X509_ALGOR;
+pub const stack_X509_ALGOR_cmp_func = ?*const fn ([*c][*c]const X509_ALGOR, [*c][*c]const X509_ALGOR) callconv(.C) c_int;
pub fn sk_X509_ALGOR_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -2916,7 +2916,7 @@ pub fn sk_X509_ALGOR_set_cmp_func(arg_sk: ?*struct_stack_st_X509_ALGOR, arg_comp
var comp = arg_comp;
return @ptrCast(stack_X509_ALGOR_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const X509_ALGOR, [*c][*c]const X509_ALGOR) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_ALGOR_deep_copy(arg_sk: ?*const struct_stack_st_X509_ALGOR, arg_copy_func: ?fn ([*c]X509_ALGOR) callconv(.C) [*c]X509_ALGOR, arg_free_func: ?fn ([*c]X509_ALGOR) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_ALGOR {
+pub fn sk_X509_ALGOR_deep_copy(arg_sk: ?*const struct_stack_st_X509_ALGOR, arg_copy_func: ?*const fn ([*c]X509_ALGOR) callconv(.C) [*c]X509_ALGOR, arg_free_func: ?*const fn ([*c]X509_ALGOR) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_ALGOR {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -2924,9 +2924,9 @@ pub fn sk_X509_ALGOR_deep_copy(arg_sk: ?*const struct_stack_st_X509_ALGOR, arg_c
}
pub const X509_ALGORS = struct_stack_st_X509_ALGOR;
pub const struct_stack_st_X509_NAME_ENTRY = opaque {};
-pub const stack_X509_NAME_ENTRY_free_func = ?fn (?*X509_NAME_ENTRY) callconv(.C) void;
-pub const stack_X509_NAME_ENTRY_copy_func = ?fn (?*X509_NAME_ENTRY) callconv(.C) ?*X509_NAME_ENTRY;
-pub const stack_X509_NAME_ENTRY_cmp_func = ?fn ([*c]?*const X509_NAME_ENTRY, [*c]?*const X509_NAME_ENTRY) callconv(.C) c_int;
+pub const stack_X509_NAME_ENTRY_free_func = ?*const fn (?*X509_NAME_ENTRY) callconv(.C) void;
+pub const stack_X509_NAME_ENTRY_copy_func = ?*const fn (?*X509_NAME_ENTRY) callconv(.C) ?*X509_NAME_ENTRY;
+pub const stack_X509_NAME_ENTRY_cmp_func = ?*const fn ([*c]?*const X509_NAME_ENTRY, [*c]?*const X509_NAME_ENTRY) callconv(.C) c_int;
pub fn sk_X509_NAME_ENTRY_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3032,16 +3032,16 @@ pub fn sk_X509_NAME_ENTRY_set_cmp_func(arg_sk: ?*struct_stack_st_X509_NAME_ENTRY
var comp = arg_comp;
return @ptrCast(stack_X509_NAME_ENTRY_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_NAME_ENTRY, [*c]?*const X509_NAME_ENTRY) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_NAME_ENTRY_deep_copy(arg_sk: ?*const struct_stack_st_X509_NAME_ENTRY, arg_copy_func: ?fn (?*X509_NAME_ENTRY) callconv(.C) ?*X509_NAME_ENTRY, arg_free_func: ?fn (?*X509_NAME_ENTRY) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_NAME_ENTRY {
+pub fn sk_X509_NAME_ENTRY_deep_copy(arg_sk: ?*const struct_stack_st_X509_NAME_ENTRY, arg_copy_func: ?*const fn (?*X509_NAME_ENTRY) callconv(.C) ?*X509_NAME_ENTRY, arg_free_func: ?*const fn (?*X509_NAME_ENTRY) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_NAME_ENTRY {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_NAME_ENTRY, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_NAME_ENTRY_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_NAME_ENTRY_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_NAME = opaque {};
-pub const stack_X509_NAME_free_func = ?fn (?*X509_NAME) callconv(.C) void;
-pub const stack_X509_NAME_copy_func = ?fn (?*X509_NAME) callconv(.C) ?*X509_NAME;
-pub const stack_X509_NAME_cmp_func = ?fn ([*c]?*const X509_NAME, [*c]?*const X509_NAME) callconv(.C) c_int;
+pub const stack_X509_NAME_free_func = ?*const fn (?*X509_NAME) callconv(.C) void;
+pub const stack_X509_NAME_copy_func = ?*const fn (?*X509_NAME) callconv(.C) ?*X509_NAME;
+pub const stack_X509_NAME_cmp_func = ?*const fn ([*c]?*const X509_NAME, [*c]?*const X509_NAME) callconv(.C) c_int;
pub fn sk_X509_NAME_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3147,16 +3147,16 @@ pub fn sk_X509_NAME_set_cmp_func(arg_sk: ?*struct_stack_st_X509_NAME, arg_comp:
var comp = arg_comp;
return @ptrCast(stack_X509_NAME_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_NAME, [*c]?*const X509_NAME) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_NAME_deep_copy(arg_sk: ?*const struct_stack_st_X509_NAME, arg_copy_func: ?fn (?*X509_NAME) callconv(.C) ?*X509_NAME, arg_free_func: ?fn (?*X509_NAME) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_NAME {
+pub fn sk_X509_NAME_deep_copy(arg_sk: ?*const struct_stack_st_X509_NAME, arg_copy_func: ?*const fn (?*X509_NAME) callconv(.C) ?*X509_NAME, arg_free_func: ?*const fn (?*X509_NAME) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_NAME {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_NAME, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_NAME_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_NAME_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const X509_EXTENSIONS = struct_stack_st_X509_EXTENSION;
-pub const stack_X509_EXTENSION_free_func = ?fn (?*X509_EXTENSION) callconv(.C) void;
-pub const stack_X509_EXTENSION_copy_func = ?fn (?*X509_EXTENSION) callconv(.C) ?*X509_EXTENSION;
-pub const stack_X509_EXTENSION_cmp_func = ?fn ([*c]?*const X509_EXTENSION, [*c]?*const X509_EXTENSION) callconv(.C) c_int;
+pub const stack_X509_EXTENSION_free_func = ?*const fn (?*X509_EXTENSION) callconv(.C) void;
+pub const stack_X509_EXTENSION_copy_func = ?*const fn (?*X509_EXTENSION) callconv(.C) ?*X509_EXTENSION;
+pub const stack_X509_EXTENSION_cmp_func = ?*const fn ([*c]?*const X509_EXTENSION, [*c]?*const X509_EXTENSION) callconv(.C) c_int;
pub fn sk_X509_EXTENSION_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3262,16 +3262,16 @@ pub fn sk_X509_EXTENSION_set_cmp_func(arg_sk: ?*struct_stack_st_X509_EXTENSION,
var comp = arg_comp;
return @ptrCast(stack_X509_EXTENSION_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_EXTENSION, [*c]?*const X509_EXTENSION) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_EXTENSION_deep_copy(arg_sk: ?*const struct_stack_st_X509_EXTENSION, arg_copy_func: ?fn (?*X509_EXTENSION) callconv(.C) ?*X509_EXTENSION, arg_free_func: ?fn (?*X509_EXTENSION) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_EXTENSION {
+pub fn sk_X509_EXTENSION_deep_copy(arg_sk: ?*const struct_stack_st_X509_EXTENSION, arg_copy_func: ?*const fn (?*X509_EXTENSION) callconv(.C) ?*X509_EXTENSION, arg_free_func: ?*const fn (?*X509_EXTENSION) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_EXTENSION {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_EXTENSION, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_EXTENSION_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_EXTENSION_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_ATTRIBUTE = opaque {};
-pub const stack_X509_ATTRIBUTE_free_func = ?fn (?*X509_ATTRIBUTE) callconv(.C) void;
-pub const stack_X509_ATTRIBUTE_copy_func = ?fn (?*X509_ATTRIBUTE) callconv(.C) ?*X509_ATTRIBUTE;
-pub const stack_X509_ATTRIBUTE_cmp_func = ?fn ([*c]?*const X509_ATTRIBUTE, [*c]?*const X509_ATTRIBUTE) callconv(.C) c_int;
+pub const stack_X509_ATTRIBUTE_free_func = ?*const fn (?*X509_ATTRIBUTE) callconv(.C) void;
+pub const stack_X509_ATTRIBUTE_copy_func = ?*const fn (?*X509_ATTRIBUTE) callconv(.C) ?*X509_ATTRIBUTE;
+pub const stack_X509_ATTRIBUTE_cmp_func = ?*const fn ([*c]?*const X509_ATTRIBUTE, [*c]?*const X509_ATTRIBUTE) callconv(.C) c_int;
pub fn sk_X509_ATTRIBUTE_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3377,16 +3377,16 @@ pub fn sk_X509_ATTRIBUTE_set_cmp_func(arg_sk: ?*struct_stack_st_X509_ATTRIBUTE,
var comp = arg_comp;
return @ptrCast(stack_X509_ATTRIBUTE_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_ATTRIBUTE, [*c]?*const X509_ATTRIBUTE) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_ATTRIBUTE_deep_copy(arg_sk: ?*const struct_stack_st_X509_ATTRIBUTE, arg_copy_func: ?fn (?*X509_ATTRIBUTE) callconv(.C) ?*X509_ATTRIBUTE, arg_free_func: ?fn (?*X509_ATTRIBUTE) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_ATTRIBUTE {
+pub fn sk_X509_ATTRIBUTE_deep_copy(arg_sk: ?*const struct_stack_st_X509_ATTRIBUTE, arg_copy_func: ?*const fn (?*X509_ATTRIBUTE) callconv(.C) ?*X509_ATTRIBUTE, arg_free_func: ?*const fn (?*X509_ATTRIBUTE) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_ATTRIBUTE {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_ATTRIBUTE, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_ATTRIBUTE_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_ATTRIBUTE_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_DIST_POINT = opaque {};
-pub const stack_X509_free_func = ?fn (?*X509) callconv(.C) void;
-pub const stack_X509_copy_func = ?fn (?*X509) callconv(.C) ?*X509;
-pub const stack_X509_cmp_func = ?fn ([*c]?*const X509, [*c]?*const X509) callconv(.C) c_int;
+pub const stack_X509_free_func = ?*const fn (?*X509) callconv(.C) void;
+pub const stack_X509_copy_func = ?*const fn (?*X509) callconv(.C) ?*X509;
+pub const stack_X509_cmp_func = ?*const fn ([*c]?*const X509, [*c]?*const X509) callconv(.C) c_int;
pub fn sk_X509_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3492,16 +3492,16 @@ pub fn sk_X509_set_cmp_func(arg_sk: ?*struct_stack_st_X509, arg_comp: stack_X509
var comp = arg_comp;
return @ptrCast(stack_X509_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509, [*c]?*const X509) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_deep_copy(arg_sk: ?*const struct_stack_st_X509, arg_copy_func: ?fn (?*X509) callconv(.C) ?*X509, arg_free_func: ?fn (?*X509) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509 {
+pub fn sk_X509_deep_copy(arg_sk: ?*const struct_stack_st_X509, arg_copy_func: ?*const fn (?*X509) callconv(.C) ?*X509, arg_free_func: ?*const fn (?*X509) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509 {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_TRUST = opaque {};
-pub const stack_X509_TRUST_free_func = ?fn ([*c]X509_TRUST) callconv(.C) void;
-pub const stack_X509_TRUST_copy_func = ?fn ([*c]X509_TRUST) callconv(.C) [*c]X509_TRUST;
-pub const stack_X509_TRUST_cmp_func = ?fn ([*c][*c]const X509_TRUST, [*c][*c]const X509_TRUST) callconv(.C) c_int;
+pub const stack_X509_TRUST_free_func = ?*const fn ([*c]X509_TRUST) callconv(.C) void;
+pub const stack_X509_TRUST_copy_func = ?*const fn ([*c]X509_TRUST) callconv(.C) [*c]X509_TRUST;
+pub const stack_X509_TRUST_cmp_func = ?*const fn ([*c][*c]const X509_TRUST, [*c][*c]const X509_TRUST) callconv(.C) c_int;
pub fn sk_X509_TRUST_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3607,16 +3607,16 @@ pub fn sk_X509_TRUST_set_cmp_func(arg_sk: ?*struct_stack_st_X509_TRUST, arg_comp
var comp = arg_comp;
return @ptrCast(stack_X509_TRUST_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const X509_TRUST, [*c][*c]const X509_TRUST) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_TRUST_deep_copy(arg_sk: ?*const struct_stack_st_X509_TRUST, arg_copy_func: ?fn ([*c]X509_TRUST) callconv(.C) [*c]X509_TRUST, arg_free_func: ?fn ([*c]X509_TRUST) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_TRUST {
+pub fn sk_X509_TRUST_deep_copy(arg_sk: ?*const struct_stack_st_X509_TRUST, arg_copy_func: ?*const fn ([*c]X509_TRUST) callconv(.C) [*c]X509_TRUST, arg_free_func: ?*const fn ([*c]X509_TRUST) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_TRUST {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_TRUST, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_TRUST_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_TRUST_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_REVOKED = opaque {};
-pub const stack_X509_REVOKED_free_func = ?fn ([*c]X509_REVOKED) callconv(.C) void;
-pub const stack_X509_REVOKED_copy_func = ?fn ([*c]X509_REVOKED) callconv(.C) [*c]X509_REVOKED;
-pub const stack_X509_REVOKED_cmp_func = ?fn ([*c][*c]const X509_REVOKED, [*c][*c]const X509_REVOKED) callconv(.C) c_int;
+pub const stack_X509_REVOKED_free_func = ?*const fn ([*c]X509_REVOKED) callconv(.C) void;
+pub const stack_X509_REVOKED_copy_func = ?*const fn ([*c]X509_REVOKED) callconv(.C) [*c]X509_REVOKED;
+pub const stack_X509_REVOKED_cmp_func = ?*const fn ([*c][*c]const X509_REVOKED, [*c][*c]const X509_REVOKED) callconv(.C) c_int;
pub fn sk_X509_REVOKED_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3722,16 +3722,16 @@ pub fn sk_X509_REVOKED_set_cmp_func(arg_sk: ?*struct_stack_st_X509_REVOKED, arg_
var comp = arg_comp;
return @ptrCast(stack_X509_REVOKED_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const X509_REVOKED, [*c][*c]const X509_REVOKED) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_REVOKED_deep_copy(arg_sk: ?*const struct_stack_st_X509_REVOKED, arg_copy_func: ?fn ([*c]X509_REVOKED) callconv(.C) [*c]X509_REVOKED, arg_free_func: ?fn ([*c]X509_REVOKED) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_REVOKED {
+pub fn sk_X509_REVOKED_deep_copy(arg_sk: ?*const struct_stack_st_X509_REVOKED, arg_copy_func: ?*const fn ([*c]X509_REVOKED) callconv(.C) [*c]X509_REVOKED, arg_free_func: ?*const fn ([*c]X509_REVOKED) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_REVOKED {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_REVOKED, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_REVOKED_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_REVOKED_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_GENERAL_NAMES = opaque {};
-pub const stack_X509_CRL_free_func = ?fn (?*X509_CRL) callconv(.C) void;
-pub const stack_X509_CRL_copy_func = ?fn (?*X509_CRL) callconv(.C) ?*X509_CRL;
-pub const stack_X509_CRL_cmp_func = ?fn ([*c]?*const X509_CRL, [*c]?*const X509_CRL) callconv(.C) c_int;
+pub const stack_X509_CRL_free_func = ?*const fn (?*X509_CRL) callconv(.C) void;
+pub const stack_X509_CRL_copy_func = ?*const fn (?*X509_CRL) callconv(.C) ?*X509_CRL;
+pub const stack_X509_CRL_cmp_func = ?*const fn ([*c]?*const X509_CRL, [*c]?*const X509_CRL) callconv(.C) c_int;
pub fn sk_X509_CRL_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3837,16 +3837,16 @@ pub fn sk_X509_CRL_set_cmp_func(arg_sk: ?*struct_stack_st_X509_CRL, arg_comp: st
var comp = arg_comp;
return @ptrCast(stack_X509_CRL_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_CRL, [*c]?*const X509_CRL) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_CRL_deep_copy(arg_sk: ?*const struct_stack_st_X509_CRL, arg_copy_func: ?fn (?*X509_CRL) callconv(.C) ?*X509_CRL, arg_free_func: ?fn (?*X509_CRL) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_CRL {
+pub fn sk_X509_CRL_deep_copy(arg_sk: ?*const struct_stack_st_X509_CRL, arg_copy_func: ?*const fn (?*X509_CRL) callconv(.C) ?*X509_CRL, arg_free_func: ?*const fn (?*X509_CRL) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_CRL {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_CRL, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_CRL_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_CRL_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_INFO = opaque {};
-pub const stack_X509_INFO_free_func = ?fn ([*c]X509_INFO) callconv(.C) void;
-pub const stack_X509_INFO_copy_func = ?fn ([*c]X509_INFO) callconv(.C) [*c]X509_INFO;
-pub const stack_X509_INFO_cmp_func = ?fn ([*c][*c]const X509_INFO, [*c][*c]const X509_INFO) callconv(.C) c_int;
+pub const stack_X509_INFO_free_func = ?*const fn ([*c]X509_INFO) callconv(.C) void;
+pub const stack_X509_INFO_copy_func = ?*const fn ([*c]X509_INFO) callconv(.C) [*c]X509_INFO;
+pub const stack_X509_INFO_cmp_func = ?*const fn ([*c][*c]const X509_INFO, [*c][*c]const X509_INFO) callconv(.C) c_int;
pub fn sk_X509_INFO_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -3952,7 +3952,7 @@ pub fn sk_X509_INFO_set_cmp_func(arg_sk: ?*struct_stack_st_X509_INFO, arg_comp:
var comp = arg_comp;
return @ptrCast(stack_X509_INFO_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const X509_INFO, [*c][*c]const X509_INFO) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_INFO_deep_copy(arg_sk: ?*const struct_stack_st_X509_INFO, arg_copy_func: ?fn ([*c]X509_INFO) callconv(.C) [*c]X509_INFO, arg_free_func: ?fn ([*c]X509_INFO) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_INFO {
+pub fn sk_X509_INFO_deep_copy(arg_sk: ?*const struct_stack_st_X509_INFO, arg_copy_func: ?*const fn ([*c]X509_INFO) callconv(.C) [*c]X509_INFO, arg_free_func: ?*const fn ([*c]X509_INFO) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_INFO {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -3989,7 +3989,7 @@ pub extern fn X509_CRL_get0_extensions(crl: ?*const X509_CRL) ?*const struct_sta
pub extern fn X509_SIG_get0(sig: ?*const X509_SIG, out_alg: [*c][*c]const X509_ALGOR, out_digest: [*c][*c]const ASN1_OCTET_STRING) void;
pub extern fn X509_SIG_getm(sig: ?*X509_SIG, out_alg: [*c][*c]X509_ALGOR, out_digest: [*c][*c]ASN1_OCTET_STRING) void;
pub extern fn X509_CRL_set_default_method(meth: ?*const X509_CRL_METHOD) void;
-pub extern fn X509_CRL_METHOD_new(crl_init: ?fn (?*X509_CRL) callconv(.C) c_int, crl_free: ?fn (?*X509_CRL) callconv(.C) c_int, crl_lookup: ?fn (?*X509_CRL, [*c][*c]X509_REVOKED, [*c]ASN1_INTEGER, ?*X509_NAME) callconv(.C) c_int, crl_verify: ?fn (?*X509_CRL, [*c]EVP_PKEY) callconv(.C) c_int) ?*X509_CRL_METHOD;
+pub extern fn X509_CRL_METHOD_new(crl_init: ?*const fn (?*X509_CRL) callconv(.C) c_int, crl_free: ?*const fn (?*X509_CRL) callconv(.C) c_int, crl_lookup: ?*const fn (?*X509_CRL, [*c][*c]X509_REVOKED, [*c]ASN1_INTEGER, ?*X509_NAME) callconv(.C) c_int, crl_verify: ?*const fn (?*X509_CRL, [*c]EVP_PKEY) callconv(.C) c_int) ?*X509_CRL_METHOD;
pub extern fn X509_CRL_METHOD_free(m: ?*X509_CRL_METHOD) void;
pub extern fn X509_CRL_set_meth_data(crl: ?*X509_CRL, dat: ?*anyopaque) void;
pub extern fn X509_CRL_get_meth_data(crl: ?*X509_CRL) ?*anyopaque;
@@ -4176,7 +4176,7 @@ pub extern fn X509_alias_set1(x: ?*X509, name: [*c]const u8, len: c_int) c_int;
pub extern fn X509_keyid_set1(x: ?*X509, id: [*c]const u8, len: c_int) c_int;
pub extern fn X509_alias_get0(x: ?*X509, len: [*c]c_int) [*c]u8;
pub extern fn X509_keyid_get0(x: ?*X509, len: [*c]c_int) [*c]u8;
-pub extern fn X509_TRUST_set_default(trust: ?fn (c_int, ?*X509, c_int) callconv(.C) c_int) ?fn (c_int, ?*X509, c_int) callconv(.C) c_int;
+pub extern fn X509_TRUST_set_default(trust: ?*const fn (c_int, ?*X509, c_int) callconv(.C) c_int) ?*const fn (c_int, ?*X509, c_int) callconv(.C) c_int;
pub extern fn X509_TRUST_set(t: [*c]c_int, trust: c_int) c_int;
pub extern fn X509_add1_trust_object(x: ?*X509, obj: ?*ASN1_OBJECT) c_int;
pub extern fn X509_add1_reject_object(x: ?*X509, obj: ?*ASN1_OBJECT) c_int;
@@ -4362,11 +4362,11 @@ pub extern fn X509at_add1_attr(x: [*c]?*struct_stack_st_X509_ATTRIBUTE, attr: ?*
pub extern fn X509at_add1_attr_by_OBJ(x: [*c]?*struct_stack_st_X509_ATTRIBUTE, obj: ?*const ASN1_OBJECT, @"type": c_int, bytes: [*c]const u8, len: c_int) ?*struct_stack_st_X509_ATTRIBUTE;
pub extern fn X509at_add1_attr_by_NID(x: [*c]?*struct_stack_st_X509_ATTRIBUTE, nid: c_int, @"type": c_int, bytes: [*c]const u8, len: c_int) ?*struct_stack_st_X509_ATTRIBUTE;
pub extern fn X509at_add1_attr_by_txt(x: [*c]?*struct_stack_st_X509_ATTRIBUTE, attrname: [*c]const u8, @"type": c_int, bytes: [*c]const u8, len: c_int) ?*struct_stack_st_X509_ATTRIBUTE;
-pub extern fn X509_ATTRIBUTE_create_by_NID(attr: [*c]?*X509_ATTRIBUTE, nid: c_int, attrtype: c_int, data: ?*const anyopaque, len: c_int) ?*X509_ATTRIBUTE;
-pub extern fn X509_ATTRIBUTE_create_by_OBJ(attr: [*c]?*X509_ATTRIBUTE, obj: ?*const ASN1_OBJECT, attrtype: c_int, data: ?*const anyopaque, len: c_int) ?*X509_ATTRIBUTE;
+pub extern fn X509_ATTRIBUTE_create_by_NID(attr: [*c]?*X509_ATTRIBUTE, nid: c_int, attrtype: c_int, data: ?[*]const u8, len: c_int) ?*X509_ATTRIBUTE;
+pub extern fn X509_ATTRIBUTE_create_by_OBJ(attr: [*c]?*X509_ATTRIBUTE, obj: ?*const ASN1_OBJECT, attrtype: c_int, data: ?[*]const u8, len: c_int) ?*X509_ATTRIBUTE;
pub extern fn X509_ATTRIBUTE_create_by_txt(attr: [*c]?*X509_ATTRIBUTE, attrname: [*c]const u8, @"type": c_int, bytes: [*c]const u8, len: c_int) ?*X509_ATTRIBUTE;
pub extern fn X509_ATTRIBUTE_set1_object(attr: ?*X509_ATTRIBUTE, obj: ?*const ASN1_OBJECT) c_int;
-pub extern fn X509_ATTRIBUTE_set1_data(attr: ?*X509_ATTRIBUTE, attrtype: c_int, data: ?*const anyopaque, len: c_int) c_int;
+pub extern fn X509_ATTRIBUTE_set1_data(attr: ?*X509_ATTRIBUTE, attrtype: c_int, data: ?[*]const u8, len: c_int) c_int;
pub extern fn X509_ATTRIBUTE_get0_data(attr: ?*X509_ATTRIBUTE, idx: c_int, attrtype: c_int, unused: ?*anyopaque) ?*anyopaque;
pub extern fn X509_ATTRIBUTE_count(attr: ?*const X509_ATTRIBUTE) c_int;
pub extern fn X509_ATTRIBUTE_get0_object(attr: ?*X509_ATTRIBUTE) ?*ASN1_OBJECT;
@@ -4390,7 +4390,7 @@ pub extern fn X509_check_trust(x: ?*X509, id: c_int, flags: c_int) c_int;
pub extern fn X509_TRUST_get_count() c_int;
pub extern fn X509_TRUST_get0(idx: c_int) [*c]X509_TRUST;
pub extern fn X509_TRUST_get_by_id(id: c_int) c_int;
-pub extern fn X509_TRUST_add(id: c_int, flags: c_int, ck: ?fn ([*c]X509_TRUST, ?*X509, c_int) callconv(.C) c_int, name: [*c]u8, arg1: c_int, arg2: ?*anyopaque) c_int;
+pub extern fn X509_TRUST_add(id: c_int, flags: c_int, ck: ?*const fn ([*c]X509_TRUST, ?*X509, c_int) callconv(.C) c_int, name: [*c]u8, arg1: c_int, arg2: ?*anyopaque) c_int;
pub extern fn X509_TRUST_cleanup() void;
pub extern fn X509_TRUST_get_flags(xp: [*c]const X509_TRUST) c_int;
pub extern fn X509_TRUST_get0_name(xp: [*c]const X509_TRUST) [*c]u8;
@@ -4401,9 +4401,9 @@ pub extern fn d2i_RSA_PSS_PARAMS(a: [*c][*c]RSA_PSS_PARAMS, in: [*c][*c]const u8
pub extern fn i2d_RSA_PSS_PARAMS(a: [*c]RSA_PSS_PARAMS, out: [*c][*c]u8) c_int;
pub extern const RSA_PSS_PARAMS_it: ASN1_ITEM;
pub const struct_stack_st_X509_LOOKUP = opaque {};
-pub const stack_X509_LOOKUP_free_func = ?fn (?*X509_LOOKUP) callconv(.C) void;
-pub const stack_X509_LOOKUP_copy_func = ?fn (?*X509_LOOKUP) callconv(.C) ?*X509_LOOKUP;
-pub const stack_X509_LOOKUP_cmp_func = ?fn ([*c]?*const X509_LOOKUP, [*c]?*const X509_LOOKUP) callconv(.C) c_int;
+pub const stack_X509_LOOKUP_free_func = ?*const fn (?*X509_LOOKUP) callconv(.C) void;
+pub const stack_X509_LOOKUP_copy_func = ?*const fn (?*X509_LOOKUP) callconv(.C) ?*X509_LOOKUP;
+pub const stack_X509_LOOKUP_cmp_func = ?*const fn ([*c]?*const X509_LOOKUP, [*c]?*const X509_LOOKUP) callconv(.C) c_int;
pub fn sk_X509_LOOKUP_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -4509,16 +4509,16 @@ pub fn sk_X509_LOOKUP_set_cmp_func(arg_sk: ?*struct_stack_st_X509_LOOKUP, arg_co
var comp = arg_comp;
return @ptrCast(stack_X509_LOOKUP_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_LOOKUP, [*c]?*const X509_LOOKUP) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_LOOKUP_deep_copy(arg_sk: ?*const struct_stack_st_X509_LOOKUP, arg_copy_func: ?fn (?*X509_LOOKUP) callconv(.C) ?*X509_LOOKUP, arg_free_func: ?fn (?*X509_LOOKUP) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_LOOKUP {
+pub fn sk_X509_LOOKUP_deep_copy(arg_sk: ?*const struct_stack_st_X509_LOOKUP, arg_copy_func: ?*const fn (?*X509_LOOKUP) callconv(.C) ?*X509_LOOKUP, arg_free_func: ?*const fn (?*X509_LOOKUP) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_LOOKUP {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_LOOKUP, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_LOOKUP_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_LOOKUP_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_OBJECT = opaque {};
-pub const stack_X509_OBJECT_free_func = ?fn (?*X509_OBJECT) callconv(.C) void;
-pub const stack_X509_OBJECT_copy_func = ?fn (?*X509_OBJECT) callconv(.C) ?*X509_OBJECT;
-pub const stack_X509_OBJECT_cmp_func = ?fn ([*c]?*const X509_OBJECT, [*c]?*const X509_OBJECT) callconv(.C) c_int;
+pub const stack_X509_OBJECT_free_func = ?*const fn (?*X509_OBJECT) callconv(.C) void;
+pub const stack_X509_OBJECT_copy_func = ?*const fn (?*X509_OBJECT) callconv(.C) ?*X509_OBJECT;
+pub const stack_X509_OBJECT_cmp_func = ?*const fn ([*c]?*const X509_OBJECT, [*c]?*const X509_OBJECT) callconv(.C) c_int;
pub fn sk_X509_OBJECT_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -4624,16 +4624,16 @@ pub fn sk_X509_OBJECT_set_cmp_func(arg_sk: ?*struct_stack_st_X509_OBJECT, arg_co
var comp = arg_comp;
return @ptrCast(stack_X509_OBJECT_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_OBJECT, [*c]?*const X509_OBJECT) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_OBJECT_deep_copy(arg_sk: ?*const struct_stack_st_X509_OBJECT, arg_copy_func: ?fn (?*X509_OBJECT) callconv(.C) ?*X509_OBJECT, arg_free_func: ?fn (?*X509_OBJECT) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_OBJECT {
+pub fn sk_X509_OBJECT_deep_copy(arg_sk: ?*const struct_stack_st_X509_OBJECT, arg_copy_func: ?*const fn (?*X509_OBJECT) callconv(.C) ?*X509_OBJECT, arg_free_func: ?*const fn (?*X509_OBJECT) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_OBJECT {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_OBJECT, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_OBJECT_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_OBJECT_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
pub const struct_stack_st_X509_VERIFY_PARAM = opaque {};
-pub const stack_X509_VERIFY_PARAM_free_func = ?fn (?*X509_VERIFY_PARAM) callconv(.C) void;
-pub const stack_X509_VERIFY_PARAM_copy_func = ?fn (?*X509_VERIFY_PARAM) callconv(.C) ?*X509_VERIFY_PARAM;
-pub const stack_X509_VERIFY_PARAM_cmp_func = ?fn ([*c]?*const X509_VERIFY_PARAM, [*c]?*const X509_VERIFY_PARAM) callconv(.C) c_int;
+pub const stack_X509_VERIFY_PARAM_free_func = ?*const fn (?*X509_VERIFY_PARAM) callconv(.C) void;
+pub const stack_X509_VERIFY_PARAM_copy_func = ?*const fn (?*X509_VERIFY_PARAM) callconv(.C) ?*X509_VERIFY_PARAM;
+pub const stack_X509_VERIFY_PARAM_cmp_func = ?*const fn ([*c]?*const X509_VERIFY_PARAM, [*c]?*const X509_VERIFY_PARAM) callconv(.C) c_int;
pub fn sk_X509_VERIFY_PARAM_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -4739,24 +4739,24 @@ pub fn sk_X509_VERIFY_PARAM_set_cmp_func(arg_sk: ?*struct_stack_st_X509_VERIFY_P
var comp = arg_comp;
return @ptrCast(stack_X509_VERIFY_PARAM_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const X509_VERIFY_PARAM, [*c]?*const X509_VERIFY_PARAM) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_X509_VERIFY_PARAM_deep_copy(arg_sk: ?*const struct_stack_st_X509_VERIFY_PARAM, arg_copy_func: ?fn (?*X509_VERIFY_PARAM) callconv(.C) ?*X509_VERIFY_PARAM, arg_free_func: ?fn (?*X509_VERIFY_PARAM) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_VERIFY_PARAM {
+pub fn sk_X509_VERIFY_PARAM_deep_copy(arg_sk: ?*const struct_stack_st_X509_VERIFY_PARAM, arg_copy_func: ?*const fn (?*X509_VERIFY_PARAM) callconv(.C) ?*X509_VERIFY_PARAM, arg_free_func: ?*const fn (?*X509_VERIFY_PARAM) callconv(.C) void) callconv(.C) ?*struct_stack_st_X509_VERIFY_PARAM {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
return @ptrCast(?*struct_stack_st_X509_VERIFY_PARAM, sk_deep_copy(@ptrCast([*c]const _STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), sk_X509_VERIFY_PARAM_call_copy_func, @ptrCast(stack_copy_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) ?*anyopaque), copy_func)), sk_X509_VERIFY_PARAM_call_free_func, @ptrCast(stack_free_func, @alignCast(@import("std").meta.alignment(fn (?*anyopaque) callconv(.C) void), free_func))));
}
-pub const X509_STORE_CTX_verify_cb = ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
-pub const X509_STORE_CTX_verify_fn = ?fn (?*X509_STORE_CTX) callconv(.C) c_int;
-pub const X509_STORE_CTX_get_issuer_fn = ?fn ([*c]?*X509, ?*X509_STORE_CTX, ?*X509) callconv(.C) c_int;
-pub const X509_STORE_CTX_check_issued_fn = ?fn (?*X509_STORE_CTX, ?*X509, ?*X509) callconv(.C) c_int;
-pub const X509_STORE_CTX_check_revocation_fn = ?fn (?*X509_STORE_CTX) callconv(.C) c_int;
-pub const X509_STORE_CTX_get_crl_fn = ?fn (?*X509_STORE_CTX, [*c]?*X509_CRL, ?*X509) callconv(.C) c_int;
-pub const X509_STORE_CTX_check_crl_fn = ?fn (?*X509_STORE_CTX, ?*X509_CRL) callconv(.C) c_int;
-pub const X509_STORE_CTX_cert_crl_fn = ?fn (?*X509_STORE_CTX, ?*X509_CRL, ?*X509) callconv(.C) c_int;
-pub const X509_STORE_CTX_check_policy_fn = ?fn (?*X509_STORE_CTX) callconv(.C) c_int;
-pub const X509_STORE_CTX_lookup_certs_fn = ?fn (?*X509_STORE_CTX, ?*X509_NAME) callconv(.C) ?*struct_stack_st_X509;
-pub const X509_STORE_CTX_lookup_crls_fn = ?fn (?*X509_STORE_CTX, ?*X509_NAME) callconv(.C) ?*struct_stack_st_X509_CRL;
-pub const X509_STORE_CTX_cleanup_fn = ?fn (?*X509_STORE_CTX) callconv(.C) c_int;
+pub const X509_STORE_CTX_verify_cb = ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
+pub const X509_STORE_CTX_verify_fn = ?*const fn (?*X509_STORE_CTX) callconv(.C) c_int;
+pub const X509_STORE_CTX_get_issuer_fn = ?*const fn ([*c]?*X509, ?*X509_STORE_CTX, ?*X509) callconv(.C) c_int;
+pub const X509_STORE_CTX_check_issued_fn = ?*const fn (?*X509_STORE_CTX, ?*X509, ?*X509) callconv(.C) c_int;
+pub const X509_STORE_CTX_check_revocation_fn = ?*const fn (?*X509_STORE_CTX) callconv(.C) c_int;
+pub const X509_STORE_CTX_get_crl_fn = ?*const fn (?*X509_STORE_CTX, [*c]?*X509_CRL, ?*X509) callconv(.C) c_int;
+pub const X509_STORE_CTX_check_crl_fn = ?*const fn (?*X509_STORE_CTX, ?*X509_CRL) callconv(.C) c_int;
+pub const X509_STORE_CTX_cert_crl_fn = ?*const fn (?*X509_STORE_CTX, ?*X509_CRL, ?*X509) callconv(.C) c_int;
+pub const X509_STORE_CTX_check_policy_fn = ?*const fn (?*X509_STORE_CTX) callconv(.C) c_int;
+pub const X509_STORE_CTX_lookup_certs_fn = ?*const fn (?*X509_STORE_CTX, ?*X509_NAME) callconv(.C) ?*struct_stack_st_X509;
+pub const X509_STORE_CTX_lookup_crls_fn = ?*const fn (?*X509_STORE_CTX, ?*X509_NAME) callconv(.C) ?*struct_stack_st_X509_CRL;
+pub const X509_STORE_CTX_cleanup_fn = ?*const fn (?*X509_STORE_CTX) callconv(.C) c_int;
pub extern fn X509_STORE_set_depth(store: ?*X509_STORE, depth: c_int) c_int;
pub extern fn X509_STORE_CTX_set_depth(ctx: ?*X509_STORE_CTX, depth: c_int) void;
pub extern fn X509_OBJECT_idx_by_subject(h: ?*struct_stack_st_X509_OBJECT, @"type": c_int, name: ?*X509_NAME) c_int;
@@ -4851,7 +4851,7 @@ pub extern fn X509_STORE_CTX_set_trust(ctx: ?*X509_STORE_CTX, trust: c_int) c_in
pub extern fn X509_STORE_CTX_purpose_inherit(ctx: ?*X509_STORE_CTX, def_purpose: c_int, purpose: c_int, trust: c_int) c_int;
pub extern fn X509_STORE_CTX_set_flags(ctx: ?*X509_STORE_CTX, flags: c_ulong) void;
pub extern fn X509_STORE_CTX_set_time(ctx: ?*X509_STORE_CTX, flags: c_ulong, t: time_t) void;
-pub extern fn X509_STORE_CTX_set_verify_cb(ctx: ?*X509_STORE_CTX, verify_cb: ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
+pub extern fn X509_STORE_CTX_set_verify_cb(ctx: ?*X509_STORE_CTX, verify_cb: ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
pub extern fn X509_STORE_CTX_get0_policy_tree(ctx: ?*X509_STORE_CTX) ?*X509_POLICY_TREE;
pub extern fn X509_STORE_CTX_get_explicit_policy(ctx: ?*X509_STORE_CTX) c_int;
pub extern fn X509_STORE_CTX_get0_param(ctx: ?*X509_STORE_CTX) ?*X509_VERIFY_PARAM;
@@ -4914,7 +4914,7 @@ pub extern fn OPENSSL_strncasecmp(a: [*c]const u8, b: [*c]const u8, n: usize) c_
pub extern fn BIO_snprintf(buf: [*c]u8, n: usize, format: [*c]const u8, ...) c_int;
pub extern fn BIO_vsnprintf(buf: [*c]u8, n: usize, format: [*c]const u8, args: va_list) c_int;
pub extern fn OPENSSL_strndup(str: [*c]const u8, size: usize) [*c]u8;
-pub extern fn OPENSSL_memdup(data: ?*const anyopaque, size: usize) ?*anyopaque;
+pub extern fn OPENSSL_memdup(data: ?[*]const u8, size: usize) ?*anyopaque;
pub extern fn OPENSSL_strlcpy(dst: [*c]u8, src: [*c]const u8, dst_size: usize) usize;
pub extern fn OPENSSL_strlcat(dst: [*c]u8, src: [*c]const u8, dst_size: usize) usize;
pub extern fn CRYPTO_malloc(size: usize, file: [*c]const u8, line: c_int) ?*anyopaque;
@@ -4946,7 +4946,7 @@ pub extern fn OPENSSL_load_builtin_modules() void;
pub extern fn OPENSSL_init_crypto(opts: u64, settings: ?*const OPENSSL_INIT_SETTINGS) c_int;
pub extern fn OPENSSL_cleanup() void;
pub extern fn FIPS_mode_set(on: c_int) c_int;
-pub const pem_password_cb = fn ([*c]u8, c_int, c_int, ?*anyopaque) callconv(.C) c_int;
+pub const pem_password_cb = *const fn ([*c]u8, c_int, c_int, ?*anyopaque) callconv(.C) c_int;
pub extern fn PEM_get_EVP_CIPHER_INFO(header: [*c]u8, cipher: [*c]EVP_CIPHER_INFO) c_int;
pub extern fn PEM_do_header(cipher: [*c]EVP_CIPHER_INFO, data: [*c]u8, len: [*c]c_long, callback: ?pem_password_cb, u: ?*anyopaque) c_int;
pub extern fn PEM_read_bio(bp: [*c]BIO, name: [*c][*c]u8, header: [*c][*c]u8, data: [*c][*c]u8, len: [*c]c_long) c_int;
@@ -5145,8 +5145,8 @@ pub extern fn SSL_add1_chain_cert(ssl: ?*SSL, x509: ?*X509) c_int;
pub extern fn SSL_CTX_clear_chain_certs(ctx: ?*SSL_CTX) c_int;
pub extern fn SSL_CTX_clear_extra_chain_certs(ctx: ?*SSL_CTX) c_int;
pub extern fn SSL_clear_chain_certs(ssl: ?*SSL) c_int;
-pub extern fn SSL_CTX_set_cert_cb(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
-pub extern fn SSL_set_cert_cb(ssl: ?*SSL, cb: ?fn (?*SSL, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_CTX_set_cert_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_set_cert_cb(ssl: ?*SSL, cb: ?*const fn (?*SSL, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
pub extern fn SSL_get0_certificate_types(ssl: ?*const SSL, out_types: [*c][*c]const u8) usize;
pub extern fn SSL_get0_peer_verify_algorithms(ssl: ?*const SSL, out_sigalgs: [*c][*c]const u16) usize;
pub extern fn SSL_get0_peer_delegation_algorithms(ssl: ?*const SSL, out_sigalgs: [*c][*c]const u16) usize;
@@ -5196,9 +5196,9 @@ pub extern fn SSL_set_private_key_method(ssl: ?*SSL, key_method: [*c]const SSL_P
pub extern fn SSL_CTX_set_private_key_method(ctx: ?*SSL_CTX, key_method: [*c]const SSL_PRIVATE_KEY_METHOD) void;
pub extern fn SSL_can_release_private_key(ssl: ?*const SSL) c_int;
pub const struct_stack_st_SSL_CIPHER = opaque {};
-pub const stack_SSL_CIPHER_free_func = ?fn (?*const SSL_CIPHER) callconv(.C) void;
-pub const stack_SSL_CIPHER_copy_func = ?fn (?*const SSL_CIPHER) callconv(.C) ?*const SSL_CIPHER;
-pub const stack_SSL_CIPHER_cmp_func = ?fn ([*c]?*const SSL_CIPHER, [*c]?*const SSL_CIPHER) callconv(.C) c_int;
+pub const stack_SSL_CIPHER_free_func = ?*const fn (?*const SSL_CIPHER) callconv(.C) void;
+pub const stack_SSL_CIPHER_copy_func = ?*const fn (?*const SSL_CIPHER) callconv(.C) ?*const SSL_CIPHER;
+pub const stack_SSL_CIPHER_cmp_func = ?*const fn ([*c]?*const SSL_CIPHER, [*c]?*const SSL_CIPHER) callconv(.C) c_int;
pub fn sk_SSL_CIPHER_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -5304,7 +5304,7 @@ pub fn sk_SSL_CIPHER_set_cmp_func(arg_sk: ?*struct_stack_st_SSL_CIPHER, arg_comp
var comp = arg_comp;
return @ptrCast(stack_SSL_CIPHER_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const SSL_CIPHER, [*c]?*const SSL_CIPHER) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_SSL_CIPHER_deep_copy(arg_sk: ?*const struct_stack_st_SSL_CIPHER, arg_copy_func: ?fn (?*const SSL_CIPHER) callconv(.C) ?*const SSL_CIPHER, arg_free_func: ?fn (?*const SSL_CIPHER) callconv(.C) void) callconv(.C) ?*struct_stack_st_SSL_CIPHER {
+pub fn sk_SSL_CIPHER_deep_copy(arg_sk: ?*const struct_stack_st_SSL_CIPHER, arg_copy_func: ?*const fn (?*const SSL_CIPHER) callconv(.C) ?*const SSL_CIPHER, arg_free_func: ?*const fn (?*const SSL_CIPHER) callconv(.C) void) callconv(.C) ?*struct_stack_st_SSL_CIPHER {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -5398,16 +5398,16 @@ pub extern fn SSL_CTX_sess_number(ctx: ?*const SSL_CTX) usize;
pub extern fn SSL_CTX_add_session(ctx: ?*SSL_CTX, session: ?*SSL_SESSION) c_int;
pub extern fn SSL_CTX_remove_session(ctx: ?*SSL_CTX, session: ?*SSL_SESSION) c_int;
pub extern fn SSL_CTX_flush_sessions(ctx: ?*SSL_CTX, time: u64) void;
-pub extern fn SSL_CTX_sess_set_new_cb(ctx: ?*SSL_CTX, new_session_cb: ?fn (?*SSL, ?*SSL_SESSION) callconv(.C) c_int) void;
-pub extern fn SSL_CTX_sess_get_new_cb(ctx: ?*SSL_CTX) ?fn (?*SSL, ?*SSL_SESSION) callconv(.C) c_int;
-pub extern fn SSL_CTX_sess_set_remove_cb(ctx: ?*SSL_CTX, remove_session_cb: ?fn (?*SSL_CTX, ?*SSL_SESSION) callconv(.C) void) void;
-pub extern fn SSL_CTX_sess_get_remove_cb(ctx: ?*SSL_CTX) ?fn (?*SSL_CTX, ?*SSL_SESSION) callconv(.C) void;
-pub extern fn SSL_CTX_sess_set_get_cb(ctx: ?*SSL_CTX, get_session_cb: ?fn (?*SSL, [*c]const u8, c_int, [*c]c_int) callconv(.C) ?*SSL_SESSION) void;
-pub extern fn SSL_CTX_sess_get_get_cb(ctx: ?*SSL_CTX) ?fn (?*SSL, [*c]const u8, c_int, [*c]c_int) callconv(.C) ?*SSL_SESSION;
+pub extern fn SSL_CTX_sess_set_new_cb(ctx: ?*SSL_CTX, new_session_cb: ?*const fn (?*SSL, ?*SSL_SESSION) callconv(.C) c_int) void;
+pub extern fn SSL_CTX_sess_get_new_cb(ctx: ?*SSL_CTX) ?*const fn (?*SSL, ?*SSL_SESSION) callconv(.C) c_int;
+pub extern fn SSL_CTX_sess_set_remove_cb(ctx: ?*SSL_CTX, remove_session_cb: ?*const fn (?*SSL_CTX, ?*SSL_SESSION) callconv(.C) void) void;
+pub extern fn SSL_CTX_sess_get_remove_cb(ctx: ?*SSL_CTX) ?*const fn (?*SSL_CTX, ?*SSL_SESSION) callconv(.C) void;
+pub extern fn SSL_CTX_sess_set_get_cb(ctx: ?*SSL_CTX, get_session_cb: ?*const fn (?*SSL, [*c]const u8, c_int, [*c]c_int) callconv(.C) ?*SSL_SESSION) void;
+pub extern fn SSL_CTX_sess_get_get_cb(ctx: ?*SSL_CTX) ?*const fn (?*SSL, [*c]const u8, c_int, [*c]c_int) callconv(.C) ?*SSL_SESSION;
pub extern fn SSL_magic_pending_session_ptr() ?*SSL_SESSION;
pub extern fn SSL_CTX_get_tlsext_ticket_keys(ctx: ?*SSL_CTX, out: ?*anyopaque, len: usize) c_int;
pub extern fn SSL_CTX_set_tlsext_ticket_keys(ctx: ?*SSL_CTX, in: ?*const anyopaque, len: usize) c_int;
-pub extern fn SSL_CTX_set_tlsext_ticket_key_cb(ctx: ?*SSL_CTX, callback: ?fn (?*SSL, [*c]u8, [*c]u8, [*c]EVP_CIPHER_CTX, [*c]HMAC_CTX, c_int) callconv(.C) c_int) c_int;
+pub extern fn SSL_CTX_set_tlsext_ticket_key_cb(ctx: ?*SSL_CTX, callback: ?*const fn (?*SSL, [*c]u8, [*c]u8, [*c]EVP_CIPHER_CTX, [*c]HMAC_CTX, c_int) callconv(.C) c_int) c_int;
pub extern fn SSL_CTX_set_ticket_aead_method(ctx: ?*SSL_CTX, aead_method: [*c]const SSL_TICKET_AEAD_METHOD) void;
pub extern fn SSL_process_tls13_new_session_ticket(ssl: ?*SSL, buf: [*c]const u8, buf_len: usize) ?*SSL_SESSION;
pub extern fn SSL_CTX_set1_curves(ctx: ?*SSL_CTX, curves: [*c]const c_int, curves_len: usize) c_int;
@@ -5416,8 +5416,8 @@ pub extern fn SSL_CTX_set1_curves_list(ctx: ?*SSL_CTX, curves: [*c]const u8) c_i
pub extern fn SSL_set1_curves_list(ssl: ?*SSL, curves: [*c]const u8) c_int;
pub extern fn SSL_get_curve_id(ssl: ?*const SSL) u16;
pub extern fn SSL_get_curve_name(curve_id: u16) [*c]const u8;
-pub extern fn SSL_CTX_set_verify(ctx: ?*SSL_CTX, mode: c_int, callback: ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
-pub extern fn SSL_set_verify(ssl: ?*SSL, mode: c_int, callback: ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
+pub extern fn SSL_CTX_set_verify(ctx: ?*SSL_CTX, mode: c_int, callback: ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
+pub extern fn SSL_set_verify(ssl: ?*SSL, mode: c_int, callback: ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int) void;
// pub const ssl_verify_ok: c_int = 0;
// pub const ssl_verify_invalid: c_int = 1;
// pub const ssl_verify_retry: c_int = 2;
@@ -5427,14 +5427,14 @@ pub const VerifyResult = enum(c_int) {
invalid = 1,
retry = 2,
};
-pub const VerifyCallback = fn (*SSL, [*c]u8) callconv(.C) VerifyResult;
+pub const VerifyCallback = *const fn (*SSL, [*c]u8) callconv(.C) VerifyResult;
pub extern fn SSL_CTX_set_custom_verify(ctx: ?*SSL_CTX, mode: c_int, callback: ?VerifyCallback) void;
pub extern fn SSL_set_custom_verify(ssl: ?*SSL, mode: c_int, callback: ?VerifyCallback) void;
pub extern fn SSL_CTX_get_verify_mode(ctx: ?*const SSL_CTX) c_int;
pub extern fn SSL_get_verify_mode(ssl: ?*const SSL) c_int;
-pub extern fn SSL_CTX_get_verify_callback(ctx: ?*const SSL_CTX) ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
-pub extern fn SSL_get_verify_callback(ssl: ?*const SSL) ?fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
+pub extern fn SSL_CTX_get_verify_callback(ctx: ?*const SSL_CTX) ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
+pub extern fn SSL_get_verify_callback(ssl: ?*const SSL) ?*const fn (c_int, ?*X509_STORE_CTX) callconv(.C) c_int;
pub extern fn SSL_CTX_set_verify_depth(ctx: ?*SSL_CTX, depth: c_int) void;
pub extern fn SSL_set_verify_depth(ssl: ?*SSL, depth: c_int) void;
pub extern fn SSL_CTX_get_verify_depth(ctx: ?*const SSL_CTX) c_int;
@@ -5454,7 +5454,7 @@ pub extern fn SSL_CTX_load_verify_locations(ctx: ?*SSL_CTX, ca_file: [*c]const u
pub extern fn SSL_get_verify_result(ssl: ?*const SSL) c_long;
pub extern fn SSL_alert_from_verify_result(result: c_long) c_int;
pub extern fn SSL_get_ex_data_X509_STORE_CTX_idx() c_int;
-pub extern fn SSL_CTX_set_cert_verify_callback(ctx: ?*SSL_CTX, callback: ?fn (?*X509_STORE_CTX, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_CTX_set_cert_verify_callback(ctx: ?*SSL_CTX, callback: ?*const fn (?*X509_STORE_CTX, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
pub extern fn SSL_enable_signed_cert_timestamps(ssl: ?*SSL) void;
pub extern fn SSL_CTX_enable_signed_cert_timestamps(ctx: ?*SSL_CTX) void;
pub extern fn SSL_enable_ocsp_stapling(ssl: ?*SSL) void;
@@ -5480,22 +5480,22 @@ pub extern fn SSL_add_file_cert_subjects_to_stack(out: ?*struct_stack_st_X509_NA
pub extern fn SSL_set_tlsext_host_name(ssl: ?*SSL, name: [*c]const u8) c_int;
pub extern fn SSL_get_servername(ssl: ?*const SSL, @"type": c_int) [*c]const u8;
pub extern fn SSL_get_servername_type(ssl: ?*const SSL) c_int;
-pub extern fn SSL_CTX_set_tlsext_servername_callback(ctx: ?*SSL_CTX, callback: ?fn (?*SSL, [*c]c_int, ?*anyopaque) callconv(.C) c_int) c_int;
+pub extern fn SSL_CTX_set_tlsext_servername_callback(ctx: ?*SSL_CTX, callback: ?*const fn (?*SSL, [*c]c_int, ?*anyopaque) callconv(.C) c_int) c_int;
pub extern fn SSL_CTX_set_tlsext_servername_arg(ctx: ?*SSL_CTX, arg: ?*anyopaque) c_int;
pub extern fn SSL_set_SSL_CTX(ssl: ?*SSL, ctx: ?*SSL_CTX) ?*SSL_CTX;
pub extern fn SSL_CTX_set_alpn_protos(ctx: ?*SSL_CTX, protos: [*c]const u8, protos_len: c_uint) c_int;
pub extern fn SSL_set_alpn_protos(ssl: ?*SSL, protos: [*c]const u8, protos_len: c_uint) c_int;
-pub extern fn SSL_CTX_set_alpn_select_cb(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c][*c]const u8, [*c]u8, [*c]const u8, c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_CTX_set_alpn_select_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c][*c]const u8, [*c]u8, [*c]const u8, c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
pub extern fn SSL_get0_alpn_selected(ssl: ?*const SSL, out_data: [*c][*c]const u8, out_len: [*c]c_uint) void;
pub extern fn SSL_CTX_set_allow_unknown_alpn_protos(ctx: ?*SSL_CTX, enabled: c_int) void;
pub extern fn SSL_add_application_settings(ssl: ?*SSL, proto: [*c]const u8, proto_len: usize, settings: [*c]const u8, settings_len: usize) c_int;
pub extern fn SSL_get0_peer_application_settings(ssl: ?*const SSL, out_data: [*c][*c]const u8, out_len: [*c]usize) void;
pub extern fn SSL_has_application_settings(ssl: ?*const SSL) c_int;
-pub const ssl_cert_compression_func_t = ?fn (?*SSL, [*c]CBB, [*c]const u8, usize) callconv(.C) c_int;
-pub const ssl_cert_decompression_func_t = ?fn (?*SSL, [*c]?*CRYPTO_BUFFER, usize, [*c]const u8, usize) callconv(.C) c_int;
+pub const ssl_cert_compression_func_t = ?*const fn (?*SSL, [*c]CBB, [*c]const u8, usize) callconv(.C) c_int;
+pub const ssl_cert_decompression_func_t = ?*const fn (?*SSL, [*c]?*CRYPTO_BUFFER, usize, [*c]const u8, usize) callconv(.C) c_int;
pub extern fn SSL_CTX_add_cert_compression_alg(ctx: ?*SSL_CTX, alg_id: u16, compress: ssl_cert_compression_func_t, decompress: ssl_cert_decompression_func_t) c_int;
-pub extern fn SSL_CTX_set_next_protos_advertised_cb(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c][*c]const u8, [*c]c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
-pub extern fn SSL_CTX_set_next_proto_select_cb(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c][*c]u8, [*c]u8, [*c]const u8, c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_CTX_set_next_protos_advertised_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c][*c]const u8, [*c]c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
+pub extern fn SSL_CTX_set_next_proto_select_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c][*c]u8, [*c]u8, [*c]const u8, c_uint, ?*anyopaque) callconv(.C) c_int, arg: ?*anyopaque) void;
pub extern fn SSL_get0_next_proto_negotiated(ssl: ?*const SSL, out_data: [*c][*c]const u8, out_len: [*c]c_uint) void;
pub extern fn SSL_select_next_proto(out: [*c][*c]u8, out_len: [*c]u8, peer: [*c]const u8, peer_len: c_uint, supported: [*c]const u8, supported_len: c_uint) c_int;
pub extern fn SSL_CTX_set_tls_channel_id_enabled(ctx: ?*SSL_CTX, enabled: c_int) void;
@@ -5504,9 +5504,9 @@ pub extern fn SSL_CTX_set1_tls_channel_id(ctx: ?*SSL_CTX, private_key: [*c]EVP_P
pub extern fn SSL_set1_tls_channel_id(ssl: ?*SSL, private_key: [*c]EVP_PKEY) c_int;
pub extern fn SSL_get_tls_channel_id(ssl: ?*SSL, out: [*c]u8, max_out: usize) usize;
pub const struct_stack_st_SRTP_PROTECTION_PROFILE = opaque {};
-pub const stack_SRTP_PROTECTION_PROFILE_free_func = ?fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) void;
-pub const stack_SRTP_PROTECTION_PROFILE_copy_func = ?fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) [*c]const SRTP_PROTECTION_PROFILE;
-pub const stack_SRTP_PROTECTION_PROFILE_cmp_func = ?fn ([*c][*c]const SRTP_PROTECTION_PROFILE, [*c][*c]const SRTP_PROTECTION_PROFILE) callconv(.C) c_int;
+pub const stack_SRTP_PROTECTION_PROFILE_free_func = ?*const fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) void;
+pub const stack_SRTP_PROTECTION_PROFILE_copy_func = ?*const fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) [*c]const SRTP_PROTECTION_PROFILE;
+pub const stack_SRTP_PROTECTION_PROFILE_cmp_func = ?*const fn ([*c][*c]const SRTP_PROTECTION_PROFILE, [*c][*c]const SRTP_PROTECTION_PROFILE) callconv(.C) c_int;
pub fn sk_SRTP_PROTECTION_PROFILE_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -5612,7 +5612,7 @@ pub fn sk_SRTP_PROTECTION_PROFILE_set_cmp_func(arg_sk: ?*struct_stack_st_SRTP_PR
var comp = arg_comp;
return @ptrCast(stack_SRTP_PROTECTION_PROFILE_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const SRTP_PROTECTION_PROFILE, [*c][*c]const SRTP_PROTECTION_PROFILE) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_SRTP_PROTECTION_PROFILE_deep_copy(arg_sk: ?*const struct_stack_st_SRTP_PROTECTION_PROFILE, arg_copy_func: ?fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) [*c]const SRTP_PROTECTION_PROFILE, arg_free_func: ?fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) void) callconv(.C) ?*struct_stack_st_SRTP_PROTECTION_PROFILE {
+pub fn sk_SRTP_PROTECTION_PROFILE_deep_copy(arg_sk: ?*const struct_stack_st_SRTP_PROTECTION_PROFILE, arg_copy_func: ?*const fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) [*c]const SRTP_PROTECTION_PROFILE, arg_free_func: ?*const fn ([*c]const SRTP_PROTECTION_PROFILE) callconv(.C) void) callconv(.C) ?*struct_stack_st_SRTP_PROTECTION_PROFILE {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -5622,10 +5622,10 @@ pub extern fn SSL_CTX_set_srtp_profiles(ctx: ?*SSL_CTX, profiles: [*c]const u8)
pub extern fn SSL_set_srtp_profiles(ssl: ?*SSL, profiles: [*c]const u8) c_int;
pub extern fn SSL_get_srtp_profiles(ssl: ?*const SSL) ?*const struct_stack_st_SRTP_PROTECTION_PROFILE;
pub extern fn SSL_get_selected_srtp_profile(ssl: ?*SSL) [*c]const SRTP_PROTECTION_PROFILE;
-pub extern fn SSL_CTX_set_psk_client_callback(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c]const u8, [*c]u8, c_uint, [*c]u8, c_uint) callconv(.C) c_uint) void;
-pub extern fn SSL_set_psk_client_callback(ssl: ?*SSL, cb: ?fn (?*SSL, [*c]const u8, [*c]u8, c_uint, [*c]u8, c_uint) callconv(.C) c_uint) void;
-pub extern fn SSL_CTX_set_psk_server_callback(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c]const u8, [*c]u8, c_uint) callconv(.C) c_uint) void;
-pub extern fn SSL_set_psk_server_callback(ssl: ?*SSL, cb: ?fn (?*SSL, [*c]const u8, [*c]u8, c_uint) callconv(.C) c_uint) void;
+pub extern fn SSL_CTX_set_psk_client_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c]const u8, [*c]u8, c_uint, [*c]u8, c_uint) callconv(.C) c_uint) void;
+pub extern fn SSL_set_psk_client_callback(ssl: ?*SSL, cb: ?*const fn (?*SSL, [*c]const u8, [*c]u8, c_uint, [*c]u8, c_uint) callconv(.C) c_uint) void;
+pub extern fn SSL_CTX_set_psk_server_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c]const u8, [*c]u8, c_uint) callconv(.C) c_uint) void;
+pub extern fn SSL_set_psk_server_callback(ssl: ?*SSL, cb: ?*const fn (?*SSL, [*c]const u8, [*c]u8, c_uint) callconv(.C) c_uint) void;
pub extern fn SSL_CTX_use_psk_identity_hint(ctx: ?*SSL_CTX, identity_hint: [*c]const u8) c_int;
pub extern fn SSL_use_psk_identity_hint(ssl: ?*SSL, identity_hint: [*c]const u8) c_int;
pub extern fn SSL_get_psk_identity_hint(ssl: ?*const SSL) [*c]const u8;
@@ -5704,13 +5704,13 @@ pub extern fn SSL_serialize_capabilities(ssl: ?*const SSL, out: [*c]CBB) c_int;
pub extern fn SSL_request_handshake_hints(ssl: ?*SSL, client_hello: [*c]const u8, client_hello_len: usize, capabilities: [*c]const u8, capabilities_len: usize) c_int;
pub extern fn SSL_serialize_handshake_hints(ssl: ?*const SSL, out: [*c]CBB) c_int;
pub extern fn SSL_set_handshake_hints(ssl: ?*SSL, hints: [*c]const u8, hints_len: usize) c_int;
-pub extern fn SSL_CTX_set_msg_callback(ctx: ?*SSL_CTX, cb: ?fn (c_int, c_int, c_int, ?*const anyopaque, usize, ?*SSL, ?*anyopaque) callconv(.C) void) void;
+pub extern fn SSL_CTX_set_msg_callback(ctx: ?*SSL_CTX, cb: ?*const fn (c_int, c_int, c_int, ?*const anyopaque, usize, ?*SSL, ?*anyopaque) callconv(.C) void) void;
pub extern fn SSL_CTX_set_msg_callback_arg(ctx: ?*SSL_CTX, arg: ?*anyopaque) void;
-pub extern fn SSL_set_msg_callback(ssl: ?*SSL, cb: ?fn (c_int, c_int, c_int, ?*const anyopaque, usize, ?*SSL, ?*anyopaque) callconv(.C) void) void;
+pub extern fn SSL_set_msg_callback(ssl: ?*SSL, cb: ?*const fn (c_int, c_int, c_int, ?*const anyopaque, usize, ?*SSL, ?*anyopaque) callconv(.C) void) void;
pub extern fn SSL_set_msg_callback_arg(ssl: ?*SSL, arg: ?*anyopaque) void;
-pub extern fn SSL_CTX_set_keylog_callback(ctx: ?*SSL_CTX, cb: ?fn (?*const SSL, [*c]const u8) callconv(.C) void) void;
-pub extern fn SSL_CTX_get_keylog_callback(ctx: ?*const SSL_CTX) ?fn (?*const SSL, [*c]const u8) callconv(.C) void;
-pub extern fn SSL_CTX_set_current_time_cb(ctx: ?*SSL_CTX, cb: ?fn (?*const SSL, [*c]struct_timeval) callconv(.C) void) void;
+pub extern fn SSL_CTX_set_keylog_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*const SSL, [*c]const u8) callconv(.C) void) void;
+pub extern fn SSL_CTX_get_keylog_callback(ctx: ?*const SSL_CTX) ?*const fn (?*const SSL, [*c]const u8) callconv(.C) void;
+pub extern fn SSL_CTX_set_current_time_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*const SSL, [*c]struct_timeval) callconv(.C) void) void;
pub extern fn SSL_set_shed_handshake_config(ssl: ?*SSL, enable: c_int) void;
pub const ssl_renegotiate_never: c_int = 0;
pub const ssl_renegotiate_once: c_int = 1;
@@ -5733,14 +5733,14 @@ pub const ssl_select_cert_retry: c_int = 0;
pub const ssl_select_cert_error: c_int = -1;
pub const enum_ssl_select_cert_result_t = c_int;
pub extern fn SSL_early_callback_ctx_extension_get(client_hello: [*c]const SSL_CLIENT_HELLO, extension_type: u16, out_data: [*c][*c]const u8, out_len: [*c]usize) c_int;
-pub extern fn SSL_CTX_set_select_certificate_cb(ctx: ?*SSL_CTX, cb: ?fn ([*c]const SSL_CLIENT_HELLO) callconv(.C) enum_ssl_select_cert_result_t) void;
-pub extern fn SSL_CTX_set_dos_protection_cb(ctx: ?*SSL_CTX, cb: ?fn ([*c]const SSL_CLIENT_HELLO) callconv(.C) c_int) void;
+pub extern fn SSL_CTX_set_select_certificate_cb(ctx: ?*SSL_CTX, cb: ?*const fn ([*c]const SSL_CLIENT_HELLO) callconv(.C) enum_ssl_select_cert_result_t) void;
+pub extern fn SSL_CTX_set_dos_protection_cb(ctx: ?*SSL_CTX, cb: ?*const fn ([*c]const SSL_CLIENT_HELLO) callconv(.C) c_int) void;
pub extern fn SSL_CTX_set_reverify_on_resume(ctx: ?*SSL_CTX, enabled: c_int) void;
pub extern fn SSL_set_enforce_rsa_key_usage(ssl: ?*SSL, enabled: c_int) void;
-pub extern fn SSL_CTX_set_info_callback(ctx: ?*SSL_CTX, cb: ?fn (?*const SSL, c_int, c_int) callconv(.C) void) void;
-pub extern fn SSL_CTX_get_info_callback(ctx: ?*SSL_CTX) ?fn (?*const SSL, c_int, c_int) callconv(.C) void;
-pub extern fn SSL_set_info_callback(ssl: ?*SSL, cb: ?fn (?*const SSL, c_int, c_int) callconv(.C) void) void;
-pub extern fn SSL_get_info_callback(ssl: ?*const SSL) ?fn (?*const SSL, c_int, c_int) callconv(.C) void;
+pub extern fn SSL_CTX_set_info_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*const SSL, c_int, c_int) callconv(.C) void) void;
+pub extern fn SSL_CTX_get_info_callback(ctx: ?*SSL_CTX) ?*const fn (?*const SSL, c_int, c_int) callconv(.C) void;
+pub extern fn SSL_set_info_callback(ssl: ?*SSL, cb: ?*const fn (?*const SSL, c_int, c_int) callconv(.C) void) void;
+pub extern fn SSL_get_info_callback(ssl: ?*const SSL) ?*const fn (?*const SSL, c_int, c_int) callconv(.C) void;
pub extern fn SSL_state_string_long(ssl: ?*const SSL) [*c]const u8;
pub extern fn SSL_get_shutdown(ssl: ?*const SSL) c_int;
pub extern fn SSL_get_peer_signature_algorithm(ssl: ?*const SSL) u16;
@@ -5797,8 +5797,8 @@ pub extern fn DTLSv1_client_method() ?*const SSL_METHOD;
pub extern fn DTLSv1_2_server_method() ?*const SSL_METHOD;
pub extern fn DTLSv1_2_client_method() ?*const SSL_METHOD;
pub extern fn SSL_clear(ssl: ?*SSL) c_int;
-pub extern fn SSL_CTX_set_tmp_rsa_callback(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, c_int, c_int) callconv(.C) ?*RSA) void;
-pub extern fn SSL_set_tmp_rsa_callback(ssl: ?*SSL, cb: ?fn (?*SSL, c_int, c_int) callconv(.C) ?*RSA) void;
+pub extern fn SSL_CTX_set_tmp_rsa_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, c_int, c_int) callconv(.C) ?*RSA) void;
+pub extern fn SSL_set_tmp_rsa_callback(ssl: ?*SSL, cb: ?*const fn (?*SSL, c_int, c_int) callconv(.C) ?*RSA) void;
pub extern fn SSL_CTX_sess_connect(ctx: ?*const SSL_CTX) c_int;
pub extern fn SSL_CTX_sess_connect_good(ctx: ?*const SSL_CTX) c_int;
pub extern fn SSL_CTX_sess_connect_renegotiate(ctx: ?*const SSL_CTX) c_int;
@@ -5836,15 +5836,15 @@ pub extern fn SSL_get_current_expansion(ssl: ?*SSL) ?*const COMP_METHOD;
pub extern fn SSL_get_server_tmp_key(ssl: ?*SSL, out_key: [*c][*c]EVP_PKEY) c_int;
pub extern fn SSL_CTX_set_tmp_dh(ctx: ?*SSL_CTX, dh: [*c]const DH) c_int;
pub extern fn SSL_set_tmp_dh(ssl: ?*SSL, dh: [*c]const DH) c_int;
-pub extern fn SSL_CTX_set_tmp_dh_callback(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, c_int, c_int) callconv(.C) [*c]DH) void;
-pub extern fn SSL_set_tmp_dh_callback(ssl: ?*SSL, cb: ?fn (?*SSL, c_int, c_int) callconv(.C) [*c]DH) void;
+pub extern fn SSL_CTX_set_tmp_dh_callback(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, c_int, c_int) callconv(.C) [*c]DH) void;
+pub extern fn SSL_set_tmp_dh_callback(ssl: ?*SSL, cb: ?*const fn (?*SSL, c_int, c_int) callconv(.C) [*c]DH) void;
pub extern fn SSL_CTX_set1_sigalgs(ctx: ?*SSL_CTX, values: [*c]const c_int, num_values: usize) c_int;
pub extern fn SSL_set1_sigalgs(ssl: ?*SSL, values: [*c]const c_int, num_values: usize) c_int;
pub extern fn SSL_CTX_set1_sigalgs_list(ctx: ?*SSL_CTX, str: [*c]const u8) c_int;
pub extern fn SSL_set1_sigalgs_list(ssl: ?*SSL, str: [*c]const u8) c_int;
-pub const stack_SSL_COMP_free_func = ?fn ([*c]SSL_COMP) callconv(.C) void;
-pub const stack_SSL_COMP_copy_func = ?fn ([*c]SSL_COMP) callconv(.C) [*c]SSL_COMP;
-pub const stack_SSL_COMP_cmp_func = ?fn ([*c][*c]const SSL_COMP, [*c][*c]const SSL_COMP) callconv(.C) c_int;
+pub const stack_SSL_COMP_free_func = ?*const fn ([*c]SSL_COMP) callconv(.C) void;
+pub const stack_SSL_COMP_copy_func = ?*const fn ([*c]SSL_COMP) callconv(.C) [*c]SSL_COMP;
+pub const stack_SSL_COMP_cmp_func = ?*const fn ([*c][*c]const SSL_COMP, [*c][*c]const SSL_COMP) callconv(.C) c_int;
pub fn sk_SSL_COMP_call_free_func(arg_free_func: stack_free_func, arg_ptr: ?*anyopaque) callconv(.C) void {
var free_func = arg_free_func;
var ptr = arg_ptr;
@@ -5950,7 +5950,7 @@ pub fn sk_SSL_COMP_set_cmp_func(arg_sk: ?*struct_stack_st_SSL_COMP, arg_comp: st
var comp = arg_comp;
return @ptrCast(stack_SSL_COMP_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c][*c]const SSL_COMP, [*c][*c]const SSL_COMP) callconv(.C) c_int), sk_set_cmp_func(@ptrCast([*c]_STACK, @alignCast(@import("std").meta.alignment(_STACK), sk)), @ptrCast(stack_cmp_func, @alignCast(@import("std").meta.alignment(fn ([*c]?*const anyopaque, [*c]?*const anyopaque) callconv(.C) c_int), comp)))));
}
-pub fn sk_SSL_COMP_deep_copy(arg_sk: ?*const struct_stack_st_SSL_COMP, arg_copy_func: ?fn ([*c]SSL_COMP) callconv(.C) [*c]SSL_COMP, arg_free_func: ?fn ([*c]SSL_COMP) callconv(.C) void) callconv(.C) ?*struct_stack_st_SSL_COMP {
+pub fn sk_SSL_COMP_deep_copy(arg_sk: ?*const struct_stack_st_SSL_COMP, arg_copy_func: ?*const fn ([*c]SSL_COMP) callconv(.C) [*c]SSL_COMP, arg_free_func: ?*const fn ([*c]SSL_COMP) callconv(.C) void) callconv(.C) ?*struct_stack_st_SSL_COMP {
var sk = arg_sk;
var copy_func = arg_copy_func;
var free_func = arg_free_func;
@@ -5960,7 +5960,7 @@ pub extern fn SSL_cache_hit(ssl: ?*SSL) c_int;
pub extern fn SSL_get_default_timeout(ssl: ?*const SSL) c_long;
pub extern fn SSL_get_version(ssl: ?*const SSL) [*c]const u8;
pub extern fn SSL_get_cipher_list(ssl: ?*const SSL, n: c_int) [*c]const u8;
-pub extern fn SSL_CTX_set_client_cert_cb(ctx: ?*SSL_CTX, cb: ?fn (?*SSL, [*c]?*X509, [*c][*c]EVP_PKEY) callconv(.C) c_int) void;
+pub extern fn SSL_CTX_set_client_cert_cb(ctx: ?*SSL_CTX, cb: ?*const fn (?*SSL, [*c]?*X509, [*c][*c]EVP_PKEY) callconv(.C) c_int) void;
pub extern fn SSL_want(ssl: ?*const SSL) c_int;
pub extern fn SSL_get_finished(ssl: ?*const SSL, buf: ?*anyopaque, count: usize) usize;
pub extern fn SSL_get_peer_finished(ssl: ?*const SSL, buf: ?*anyopaque, count: usize) usize;
@@ -5985,7 +5985,7 @@ pub extern fn SSL_set_tlsext_status_type(ssl: ?*SSL, @"type": c_int) c_int;
pub extern fn SSL_get_tlsext_status_type(ssl: ?*const SSL) c_int;
pub extern fn SSL_set_tlsext_status_ocsp_resp(ssl: ?*SSL, resp: [*c]u8, resp_len: usize) c_int;
pub extern fn SSL_get_tlsext_status_ocsp_resp(ssl: ?*const SSL, out: [*c][*c]const u8) usize;
-pub extern fn SSL_CTX_set_tlsext_status_cb(ctx: ?*SSL_CTX, callback: ?fn (?*SSL, ?*anyopaque) callconv(.C) c_int) c_int;
+pub extern fn SSL_CTX_set_tlsext_status_cb(ctx: ?*SSL_CTX, callback: ?*const fn (?*SSL, ?*anyopaque) callconv(.C) c_int) c_int;
pub extern fn SSL_CTX_set_tlsext_status_arg(ctx: ?*SSL_CTX, arg: ?*anyopaque) c_int;
pub extern fn SSL_CIPHER_get_value(cipher: ?*const SSL_CIPHER) u16;
pub const OPENSSL_VERSION_NUMBER = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x1010107f, .hexadecimal);
@@ -18934,12 +18934,12 @@ fn noop_custom_verify(_: *SSL, _: [*c]u8) callconv(.C) VerifyResult {
threadlocal var auto_crypto_buffer_pool: ?*CRYPTO_BUFFER_POOL = null;
pub const BIOMethod = struct {
- pub const create = fn (*BIO) callconv(.C) c_int;
- pub const destroy = fn (*BIO) callconv(.C) c_int;
- pub const write = fn (*BIO, [*c]const u8, c_int) callconv(.C) c_int;
- pub const read = fn (*BIO, [*c]u8, c_int) callconv(.C) c_int;
- pub const gets = fn (*BIO, [*c]u8, c_int) callconv(.C) c_int;
- pub const ctrl = fn (*BIO, c_int, c_long, ?*anyopaque) callconv(.C) c_long;
+ pub const create = *const fn (*BIO) callconv(.C) c_int;
+ pub const destroy = *const fn (*BIO) callconv(.C) c_int;
+ pub const write = *const fn (*BIO, [*c]const u8, c_int) callconv(.C) c_int;
+ pub const read = *const fn (*BIO, [*c]u8, c_int) callconv(.C) c_int;
+ pub const gets = *const fn (*BIO, [*c]u8, c_int) callconv(.C) c_int;
+ pub const ctrl = *const fn (*BIO, c_int, c_long, ?*anyopaque) callconv(.C) c_long;
pub fn init(
name: [:0]const u8,
comptime create__: ?create,
diff --git a/src/deps/lol-html.zig b/src/deps/lol-html.zig
index 2b8f72272..f042bc111 100644
--- a/src/deps/lol-html.zig
+++ b/src/deps/lol-html.zig
@@ -59,7 +59,7 @@ pub const HTMLRewriter = opaque {
encoding: [*]const u8,
encoding_len: usize,
memory_settings: MemorySettings,
- output_sink: ?fn ([*]const u8, usize, *anyopaque) callconv(.C) void,
+ output_sink: ?*const fn ([*]const u8, usize, *anyopaque) callconv(.C) void,
output_sink_user_data: *anyopaque,
strict: bool,
) ?*HTMLRewriter;
@@ -68,7 +68,7 @@ pub const HTMLRewriter = opaque {
encoding: [*]const u8,
encoding_len: usize,
memory_settings: MemorySettings,
- output_sink: ?fn ([*]const u8, usize, *anyopaque) callconv(.C) void,
+ output_sink: ?*const fn ([*]const u8, usize, *anyopaque) callconv(.C) void,
output_sink_user_data: *anyopaque,
strict: bool,
) ?*HTMLRewriter;
@@ -678,14 +678,14 @@ pub const Comment = opaque {
};
pub const Directive = enum(c_uint) {
- @"stop" = 0,
+ stop = 0,
@"continue" = 1,
};
-pub const lol_html_comment_handler_t = fn (*Comment, ?*anyopaque) callconv(.C) Directive;
-pub const lol_html_text_handler_handler_t = fn (*TextChunk, ?*anyopaque) callconv(.C) Directive;
-pub const lol_html_element_handler_t = fn (*Element, ?*anyopaque) callconv(.C) Directive;
-pub const lol_html_doc_end_handler_t = fn (*DocEnd, ?*anyopaque) callconv(.C) Directive;
-pub const lol_html_end_tag_handler_t = fn (*EndTag, ?*anyopaque) callconv(.C) Directive;
+pub const lol_html_comment_handler_t = *const fn (*Comment, ?*anyopaque) callconv(.C) Directive;
+pub const lol_html_text_handler_handler_t = *const fn (*TextChunk, ?*anyopaque) callconv(.C) Directive;
+pub const lol_html_element_handler_t = *const fn (*Element, ?*anyopaque) callconv(.C) Directive;
+pub const lol_html_doc_end_handler_t = *const fn (*DocEnd, ?*anyopaque) callconv(.C) Directive;
+pub const lol_html_end_tag_handler_t = *const fn (*EndTag, ?*anyopaque) callconv(.C) Directive;
pub const DocEnd = opaque {
extern fn lol_html_doc_end_append(doc_end: ?*DocEnd, content: [*]const u8, content_len: usize, is_html: bool) c_int;
@@ -700,18 +700,18 @@ pub const DocEnd = opaque {
};
fn DirectiveFunctionType(comptime Container: type) type {
- return fn (*Container, ?*anyopaque) callconv(.C) Directive;
+ return *const fn (*Container, ?*anyopaque) callconv(.C) Directive;
}
fn DirectiveFunctionTypeForHandler(comptime Container: type, comptime UserDataType: type) type {
- return fn (*UserDataType, *Container) bool;
+ return *const fn (*UserDataType, *Container) bool;
}
fn DocTypeHandlerCallback(comptime UserDataType: type) type {
- return fn (*DocType, *UserDataType) bool;
+ return *const fn (*DocType, *UserDataType) bool;
}
-pub fn DirectiveHandler(comptime Container: type, comptime UserDataType: type, comptime Callback: (fn (this: *UserDataType, container: *Container) bool)) DirectiveFunctionType(Container) {
+pub fn DirectiveHandler(comptime Container: type, comptime UserDataType: type, comptime Callback: (*const fn (this: *UserDataType, container: *Container) bool)) DirectiveFunctionType(Container) {
return struct {
pub fn callback(this: *Container, user_data: ?*anyopaque) callconv(.C) Directive {
auto_disable();
@@ -744,7 +744,7 @@ pub const DocType = opaque {
extern fn lol_html_doctype_user_data_set(doctype: *const DocType, user_data: ?*anyopaque) void;
extern fn lol_html_doctype_user_data_get(doctype: *const DocType) ?*anyopaque;
- pub const Callback = fn (*DocType, ?*anyopaque) callconv(.C) Directive;
+ pub const Callback = *const fn (*DocType, ?*anyopaque) callconv(.C) Directive;
pub fn getName(this: *const DocType) HTMLString {
auto_disable();
diff --git a/src/deps/picohttp.zig b/src/deps/picohttp.zig
index 141871f26..3ebd34e8a 100644
--- a/src/deps/picohttp.zig
+++ b/src/deps/picohttp.zig
@@ -185,7 +185,7 @@ pub const Response = struct {
.minor_version = @intCast(usize, minor_version),
.status_code = @intCast(usize, status_code),
.status = status,
- .headers = src[0..@minimum(num_headers, src.len)],
+ .headers = src[0..@min(num_headers, src.len)],
.bytes_read = rc,
},
};
diff --git a/src/deps/uws b/src/deps/uws
-Subproject ac56fb3bb07f7c3ad40008cc44eb67114187b57
+Subproject 8cf4bd560ba81fd6aadadfe956ddebf1f6c47ab
diff --git a/src/deps/uws.zig b/src/deps/uws.zig
index 6db662c00..62821c85c 100644
--- a/src/deps/uws.zig
+++ b/src/deps/uws.zig
@@ -219,7 +219,7 @@ pub fn NewSocketHandler(comptime ssl: bool) type {
comptime ContextType: type,
comptime Fields: anytype,
) void {
- const field_type = comptime if (@TypeOf(Fields) != type) @TypeOf(Fields) else Fields;
+ const @"type" = comptime if (@TypeOf(Fields) != type) @TypeOf(Fields) else Fields;
const SocketHandler = struct {
const alignment = if (ContextType == anyopaque)
@@ -302,19 +302,19 @@ pub fn NewSocketHandler(comptime ssl: bool) type {
}
};
- if (comptime @hasDecl(field_type, "onOpen") and @typeInfo(@TypeOf(field_type.onOpen)) != .Null)
+ if (comptime @hasDecl(@"type", "onOpen") and @typeInfo(@TypeOf(@"type".onOpen)) != .Null)
us_socket_context_on_open(ssl_int, ctx, SocketHandler.on_open);
- if (comptime @hasDecl(field_type, "onClose") and @typeInfo(@TypeOf(field_type.onClose)) != .Null)
+ if (comptime @hasDecl(@"type", "onClose") and @typeInfo(@TypeOf(@"type".onClose)) != .Null)
us_socket_context_on_close(ssl_int, ctx, SocketHandler.on_close);
- if (comptime @hasDecl(field_type, "onData") and @typeInfo(@TypeOf(field_type.onData)) != .Null)
+ if (comptime @hasDecl(@"type", "onData") and @typeInfo(@TypeOf(@"type".onData)) != .Null)
us_socket_context_on_data(ssl_int, ctx, SocketHandler.on_data);
- if (comptime @hasDecl(field_type, "onWritable") and @typeInfo(@TypeOf(field_type.onWritable)) != .Null)
+ if (comptime @hasDecl(@"type", "onWritable") and @typeInfo(@TypeOf(@"type".onWritable)) != .Null)
us_socket_context_on_writable(ssl_int, ctx, SocketHandler.on_writable);
- if (comptime @hasDecl(field_type, "onTimeout") and @typeInfo(@TypeOf(field_type.onTimeout)) != .Null)
+ if (comptime @hasDecl(@"type", "onTimeout") and @typeInfo(@TypeOf(@"type".onTimeout)) != .Null)
us_socket_context_on_timeout(ssl_int, ctx, SocketHandler.on_timeout);
- if (comptime @hasDecl(field_type, "onConnectError") and @typeInfo(@TypeOf(field_type.onConnectError)) != .Null)
+ if (comptime @hasDecl(@"type", "onConnectError") and @typeInfo(@TypeOf(@"type".onConnectError)) != .Null)
us_socket_context_on_connect_error(ssl_int, ctx, SocketHandler.on_connect_error);
- if (comptime @hasDecl(field_type, "onEnd") and @typeInfo(@TypeOf(field_type.onEnd)) != .Null)
+ if (comptime @hasDecl(@"type", "onEnd") and @typeInfo(@TypeOf(@"type".onEnd)) != .Null)
us_socket_context_on_end(ssl_int, ctx, SocketHandler.on_end);
}
@@ -360,7 +360,7 @@ pub const Timer = opaque {
return us_create_timer(loop, 1, @sizeOf(Type));
}
- pub fn set(this: *Timer, ptr: anytype, cb: ?fn (*Timer) callconv(.C) void, ms: i32, repeat_ms: i32) void {
+ pub fn set(this: *Timer, ptr: anytype, cb: ?*const fn (*Timer) callconv(.C) void, ms: i32, repeat_ms: i32) void {
us_timer_set(this, cb, ms, repeat_ms);
var value_ptr = us_timer_ext(this);
@setRuntimeSafety(false);
@@ -436,8 +436,8 @@ pub const Loop = extern struct {
iterator: ?*SocketContext,
recv_buf: [*]u8,
ssl_data: ?*anyopaque,
- pre_cb: ?fn (?*Loop) callconv(.C) void,
- post_cb: ?fn (?*Loop) callconv(.C) void,
+ pre_cb: ?*fn (?*Loop) callconv(.C) void,
+ post_cb: ?*fn (?*Loop) callconv(.C) void,
closed_head: ?*Socket,
low_prio_head: ?*Socket,
low_prio_budget: i32,
@@ -479,7 +479,7 @@ pub const Loop = extern struct {
uws_loop_defer(this, user_data, Handler.callback);
}
- fn NewHandler(comptime UserType: type, comptime callback: fn (UserType) void) type {
+ fn NewHandler(comptime UserType: type, comptime callback_fn: fn (UserType) void) type {
return struct {
loop: *Loop,
pub fn removePost(handler: @This()) void {
@@ -489,7 +489,7 @@ pub const Loop = extern struct {
return uws_loop_removePostHandler(handler.loop, callback);
}
pub fn callback(data: *anyopaque, _: *Loop) callconv(.C) void {
- callback(@ptrCast(UserType, @alignCast(@alignOf(std.meta.Child(UserType)), data)));
+ callback_fn(@ptrCast(UserType, @alignCast(@alignOf(std.meta.Child(UserType)), data)));
}
};
}
@@ -516,10 +516,16 @@ pub const Loop = extern struct {
us_loop_run(this);
}
- extern fn uws_loop_defer(loop: *Loop, ctx: *anyopaque, cb: fn (ctx: *anyopaque) callconv(.C) void) void;
+ extern fn uws_loop_defer(loop: *Loop, ctx: *anyopaque, cb: *const (fn (ctx: *anyopaque) callconv(.C) void)) void;
extern fn uws_get_loop() ?*Loop;
- extern fn us_create_loop(hint: ?*anyopaque, wakeup_cb: ?fn (*Loop) callconv(.C) void, pre_cb: ?fn (*Loop) callconv(.C) void, post_cb: ?fn (*Loop) callconv(.C) void, ext_size: c_uint) ?*Loop;
+ extern fn us_create_loop(
+ hint: ?*anyopaque,
+ wakeup_cb: ?*const fn (*Loop) callconv(.C) void,
+ pre_cb: ?*const fn (*Loop) callconv(.C) void,
+ post_cb: ?*const fn (*Loop) callconv(.C) void,
+ ext_size: c_uint,
+ ) ?*Loop;
extern fn us_loop_free(loop: ?*Loop) void;
extern fn us_loop_ext(loop: ?*Loop) ?*anyopaque;
extern fn us_loop_run(loop: ?*Loop) void;
@@ -527,17 +533,17 @@ pub const Loop = extern struct {
extern fn us_wakeup_loop(loop: ?*Loop) void;
extern fn us_loop_integrate(loop: ?*Loop) void;
extern fn us_loop_iteration_number(loop: ?*Loop) c_longlong;
- extern fn uws_loop_addPostHandler(loop: *Loop, ctx: *anyopaque, cb: (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
- extern fn uws_loop_removePostHandler(loop: *Loop, ctx: *anyopaque, cb: (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
- extern fn uws_loop_addPreHandler(loop: *Loop, ctx: *anyopaque, cb: (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
- extern fn uws_loop_removePreHandler(loop: *Loop, ctx: *anyopaque, cb: (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
+ extern fn uws_loop_addPostHandler(loop: *Loop, ctx: *anyopaque, cb: *const (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
+ extern fn uws_loop_removePostHandler(loop: *Loop, ctx: *anyopaque, cb: *const (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
+ extern fn uws_loop_addPreHandler(loop: *Loop, ctx: *anyopaque, cb: *const (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
+ extern fn uws_loop_removePreHandler(loop: *Loop, ctx: *anyopaque, cb: *const (fn (ctx: *anyopaque, loop: *Loop) callconv(.C) void)) void;
};
const uintmax_t = c_ulong;
extern fn us_create_timer(loop: ?*Loop, fallthrough: i32, ext_size: c_uint) *Timer;
extern fn us_timer_ext(timer: ?*Timer) *?*anyopaque;
extern fn us_timer_close(timer: ?*Timer) void;
-extern fn us_timer_set(timer: ?*Timer, cb: ?fn (*Timer) callconv(.C) void, ms: i32, repeat_ms: i32) void;
+extern fn us_timer_set(timer: ?*Timer, cb: ?*const fn (*Timer) callconv(.C) void, ms: i32, repeat_ms: i32) void;
extern fn us_timer_loop(t: ?*Timer) ?*Loop;
pub const us_socket_context_options_t = extern struct {
key_file_name: [*c]const u8 = null,
@@ -552,17 +558,17 @@ pub const us_socket_context_options_t = extern struct {
extern fn SocketContextimestamp(ssl: i32, context: ?*SocketContext) c_ushort;
pub extern fn us_socket_context_add_server_name(ssl: i32, context: ?*SocketContext, hostname_pattern: [*c]const u8, options: us_socket_context_options_t, ?*anyopaque) void;
extern fn us_socket_context_remove_server_name(ssl: i32, context: ?*SocketContext, hostname_pattern: [*c]const u8) void;
-extern fn us_socket_context_on_server_name(ssl: i32, context: ?*SocketContext, cb: ?fn (?*SocketContext, [*c]const u8) callconv(.C) void) void;
+extern fn us_socket_context_on_server_name(ssl: i32, context: ?*SocketContext, cb: ?*const fn (?*SocketContext, [*c]const u8) callconv(.C) void) void;
extern fn us_socket_context_get_native_handle(ssl: i32, context: ?*SocketContext) ?*anyopaque;
pub extern fn us_create_socket_context(ssl: i32, loop: ?*Loop, ext_size: i32, options: us_socket_context_options_t) ?*SocketContext;
pub extern fn us_socket_context_free(ssl: i32, context: ?*SocketContext) void;
-extern fn us_socket_context_on_open(ssl: i32, context: ?*SocketContext, on_open: fn (*Socket, i32, [*c]u8, i32) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_close(ssl: i32, context: ?*SocketContext, on_close: fn (*Socket, i32, ?*anyopaque) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_data(ssl: i32, context: ?*SocketContext, on_data: fn (*Socket, [*c]u8, i32) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_writable(ssl: i32, context: ?*SocketContext, on_writable: fn (*Socket) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_timeout(ssl: i32, context: ?*SocketContext, on_timeout: fn (*Socket) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_connect_error(ssl: i32, context: ?*SocketContext, on_connect_error: fn (*Socket, i32) callconv(.C) ?*Socket) void;
-extern fn us_socket_context_on_end(ssl: i32, context: ?*SocketContext, on_end: fn (*Socket) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_open(ssl: i32, context: ?*SocketContext, on_open: *const fn (*Socket, i32, [*c]u8, i32) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_close(ssl: i32, context: ?*SocketContext, on_close: *const fn (*Socket, i32, ?*anyopaque) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_data(ssl: i32, context: ?*SocketContext, on_data: *const fn (*Socket, [*c]u8, i32) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_writable(ssl: i32, context: ?*SocketContext, on_writable: *const fn (*Socket) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_timeout(ssl: i32, context: ?*SocketContext, on_timeout: *const fn (*Socket) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_connect_error(ssl: i32, context: ?*SocketContext, on_connect_error: *const fn (*Socket, i32) callconv(.C) ?*Socket) void;
+extern fn us_socket_context_on_end(ssl: i32, context: ?*SocketContext, on_end: *const fn (*Socket) callconv(.C) ?*Socket) void;
extern fn us_socket_context_ext(ssl: i32, context: ?*SocketContext) ?*anyopaque;
pub extern fn us_socket_context_listen(ssl: i32, context: ?*SocketContext, host: [*c]const u8, port: i32, options: i32, socket_ext_size: i32) ?*ListenSocket;
@@ -640,7 +646,7 @@ pub const Poll = opaque {
}
// (void* userData, int fd, int events, int error, struct us_poll_t *poll)
- pub const CallbackType = fn (?*anyopaque, i32, i32, i32, *Poll) callconv(.C) void;
+ pub const CallbackType = *const fn (?*anyopaque, i32, i32, i32, *Poll) callconv(.C) void;
extern fn us_create_poll(loop: ?*Loop, fallthrough: i32, ext_size: c_uint) *Poll;
extern fn us_poll_set(poll: *Poll, events: i32, callback: CallbackType) *Poll;
extern fn us_poll_free(p: ?*Poll, loop: ?*Loop) void;
@@ -720,7 +726,7 @@ pub const AnyWebSocket = union(enum) {
const ContextType = @TypeOf(ctx);
const Wrapper = struct {
pub fn wrap(user_data: ?*anyopaque) callconv(.C) void {
- @call(.{ .modifier = .always_inline }, callback, .{bun.cast(ContextType, user_data.?)});
+ @call(.always_inline, callback, .{bun.cast(ContextType, user_data.?)});
}
};
@@ -748,7 +754,7 @@ pub const AnyWebSocket = union(enum) {
};
}
// pub fn iterateTopics(this: AnyWebSocket) {
- // return uws_ws_iterate_topics(ssl_flag, this.raw(), callback: ?fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
+ // return uws_ws_iterate_topics(ssl_flag, this.raw(), callback: ?*const fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
// }
pub fn publish(this: AnyWebSocket, topic: []const u8, message: []const u8) bool {
return switch (this) {
@@ -785,12 +791,12 @@ pub const AnyWebSocket = union(enum) {
pub const RawWebSocket = opaque {};
-pub const uws_websocket_handler = ?fn (*RawWebSocket) callconv(.C) void;
-pub const uws_websocket_message_handler = ?fn (*RawWebSocket, [*c]const u8, usize, Opcode) callconv(.C) void;
-pub const uws_websocket_close_handler = ?fn (*RawWebSocket, i32, [*c]const u8, usize) callconv(.C) void;
-pub const uws_websocket_upgrade_handler = ?fn (*anyopaque, *uws_res, *Request, *uws_socket_context_t, usize) callconv(.C) void;
+pub const uws_websocket_handler = ?*const fn (*RawWebSocket) callconv(.C) void;
+pub const uws_websocket_message_handler = ?*const fn (*RawWebSocket, [*c]const u8, usize, Opcode) callconv(.C) void;
+pub const uws_websocket_close_handler = ?*const fn (*RawWebSocket, i32, [*c]const u8, usize) callconv(.C) void;
+pub const uws_websocket_upgrade_handler = ?*const fn (*anyopaque, *uws_res, *Request, *uws_socket_context_t, usize) callconv(.C) void;
-pub const uws_websocket_ping_pong_handler = ?fn (*RawWebSocket, [*c]const u8, usize) callconv(.C) void;
+pub const uws_websocket_ping_pong_handler = ?*const fn (*RawWebSocket, [*c]const u8, usize) callconv(.C) void;
pub const WebSocketBehavior = extern struct {
compression: uws_compress_options_t = 0,
@@ -824,21 +830,21 @@ pub const WebSocketBehavior = extern struct {
pub fn _open(raw_ws: *RawWebSocket) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
- @call(.{ .modifier = .always_inline }, Type.onOpen, .{ this, ws });
+ @call(.always_inline, Type.onOpen, .{ this, ws });
}
pub fn _message(raw_ws: *RawWebSocket, message: [*c]const u8, length: usize, opcode: Opcode) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
@call(
- .{ .modifier = .always_inline },
+ .always_inline,
Type.onMessage,
- .{ this, ws, if (length > 0) message.?[0..length] else "", opcode },
+ .{ this, ws, if (length > 0) message[0..length] else "", opcode },
);
}
pub fn _drain(raw_ws: *RawWebSocket) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
- @call(.{ .modifier = .always_inline }, Type.onDrain, .{
+ @call(.always_inline, Type.onDrain, .{
this,
ws,
});
@@ -846,38 +852,38 @@ pub const WebSocketBehavior = extern struct {
pub fn _ping(raw_ws: *RawWebSocket, message: [*c]const u8, length: usize) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
- @call(.{ .modifier = .always_inline }, Type.onPing, .{
+ @call(.always_inline, Type.onPing, .{
this,
ws,
- if (length > 0) message.?[0..length] else "",
+ if (length > 0) message[0..length] else "",
});
}
pub fn _pong(raw_ws: *RawWebSocket, message: [*c]const u8, length: usize) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
- @call(.{ .modifier = .always_inline }, Type.onPong, .{
+ @call(.always_inline, Type.onPong, .{
this,
ws,
- if (length > 0) message.?[0..length] else "",
+ if (length > 0) message[0..length] else "",
});
}
pub fn _close(raw_ws: *RawWebSocket, code: i32, message: [*c]const u8, length: usize) callconv(.C) void {
var ws = @unionInit(AnyWebSocket, active_field_name, @ptrCast(*WebSocket, raw_ws));
var this = ws.as(Type).?;
@call(
- .{ .modifier = .always_inline },
+ .always_inline,
Type.onClose,
.{
this,
ws,
code,
- if (length > 0) message.?[0..length] else "",
+ if (length > 0) message[0..length] else "",
},
);
}
pub fn _upgrade(ptr: *anyopaque, res: *uws_res, req: *Request, context: *uws_socket_context_t, id: usize) callconv(.C) void {
@call(
- .{ .modifier = .always_inline },
+ .always_inline,
Server.onWebSocketUpgrade,
.{ bun.cast(*Server, ptr), @ptrCast(*NewApp(is_ssl).Response, res), req, context, id },
);
@@ -905,10 +911,10 @@ pub const WebSocketBehavior = extern struct {
};
}
};
-pub const uws_listen_handler = ?fn (?*ListenSocket, ?*anyopaque) callconv(.C) void;
-pub const uws_method_handler = ?fn (*uws_res, *Request, ?*anyopaque) callconv(.C) void;
-pub const uws_filter_handler = ?fn (*uws_res, i32, ?*anyopaque) callconv(.C) void;
-pub const uws_missing_server_handler = ?fn ([*c]const u8, ?*anyopaque) callconv(.C) void;
+pub const uws_listen_handler = ?*const fn (?*ListenSocket, ?*anyopaque) callconv(.C) void;
+pub const uws_method_handler = ?*const fn (*uws_res, *Request, ?*anyopaque) callconv(.C) void;
+pub const uws_filter_handler = ?*const fn (*uws_res, i32, ?*anyopaque) callconv(.C) void;
+pub const uws_missing_server_handler = ?*const fn ([*c]const u8, ?*anyopaque) callconv(.C) void;
pub const Request = opaque {
pub fn isAncient(req: *Request) bool {
@@ -990,7 +996,7 @@ pub fn NewApp(comptime ssl: bool) type {
if (comptime UserDataType == void) {
return @call(
- .{ .modifier = .always_inline },
+ .always_inline,
handler,
.{
void{},
@@ -1000,7 +1006,7 @@ pub fn NewApp(comptime ssl: bool) type {
);
} else {
return @call(
- .{ .modifier = .always_inline },
+ .always_inline,
handler,
.{
@ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)),
@@ -1159,12 +1165,11 @@ pub fn NewApp(comptime ssl: bool) type {
unreachable;
}
const Wrapper = struct {
- const handler = handler;
pub fn handle(socket: ?*uws.ListenSocket, conf: uws_app_listen_config_t, data: ?*anyopaque) callconv(.C) void {
if (comptime UserData == void) {
- @call(.{ .modifier = .always_inline }, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket), conf });
+ @call(.always_inline, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket), conf });
} else {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
@ptrCast(UserData, @alignCast(@alignOf(UserData), data.?)),
@ptrCast(?*ThisApp.ListenSocket, socket),
conf,
@@ -1183,13 +1188,11 @@ pub fn NewApp(comptime ssl: bool) type {
config: uws_app_listen_config_t,
) void {
const Wrapper = struct {
- const handler = handler;
-
pub fn handle(socket: ?*uws.ListenSocket, data: ?*anyopaque) callconv(.C) void {
if (comptime UserData == void) {
- @call(.{ .modifier = .always_inline }, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket) });
+ @call(.always_inline, handler, .{ void{}, @ptrCast(?*ThisApp.ListenSocket, socket) });
} else {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
@ptrCast(UserData, @alignCast(@alignOf(UserData), data.?)),
@ptrCast(?*ThisApp.ListenSocket, socket),
});
@@ -1307,9 +1310,9 @@ pub fn NewApp(comptime ssl: bool) type {
const Wrapper = struct {
pub fn handle(this: *uws_res, amount: uintmax_t, data: ?*anyopaque) callconv(.C) bool {
if (comptime UserDataType == void) {
- return @call(.{ .modifier = .always_inline }, handler, .{ void{}, amount, castRes(this) });
+ return @call(.always_inline, handler, .{ void{}, amount, castRes(this) });
} else {
- return @call(.{ .modifier = .always_inline }, handler, .{
+ return @call(.always_inline, handler, .{
@ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), data.?)),
amount,
castRes(this),
@@ -1328,9 +1331,9 @@ pub fn NewApp(comptime ssl: bool) type {
const Wrapper = struct {
pub fn handle(this: *uws_res, user_data: ?*anyopaque) callconv(.C) void {
if (comptime UserDataType == void) {
- @call(.{ .modifier = .always_inline }, handler, .{ void{}, castRes(this), void{} });
+ @call(.always_inline, handler, .{ void{}, castRes(this), void{} });
} else {
- @call(.{ .modifier = .always_inline }, handler, .{ @ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)), castRes(this) });
+ @call(.always_inline, handler, .{ @ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)), castRes(this) });
}
}
};
@@ -1350,14 +1353,14 @@ pub fn NewApp(comptime ssl: bool) type {
const Wrapper = struct {
pub fn handle(this: *uws_res, chunk_ptr: [*c]const u8, len: usize, last: bool, user_data: ?*anyopaque) callconv(.C) void {
if (comptime UserDataType == void) {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
void{},
castRes(this),
if (len > 0) chunk_ptr[0..len] else "",
last,
});
} else {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
@ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)),
castRes(this),
if (len > 0) chunk_ptr[0..len] else "",
@@ -1383,7 +1386,7 @@ pub fn NewApp(comptime ssl: bool) type {
opts: @TypeOf(args),
result: @typeInfo(@TypeOf(Function)).Fn.return_type.? = undefined,
pub fn run(this: *@This()) void {
- this.result = @call(.{}, Function, this.opts);
+ this.result = @call(.auto, Function, this.opts);
}
};
var wrapped = Wrapper{
@@ -1403,11 +1406,11 @@ pub fn NewApp(comptime ssl: bool) type {
const Wrapper = struct {
pub fn handle(user_data: ?*anyopaque) callconv(.C) void {
if (comptime UserDataType == void) {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
void{},
});
} else {
- @call(.{ .modifier = .always_inline }, handler, .{
+ @call(.always_inline, handler, .{
@ptrCast(UserDataType, @alignCast(@alignOf(UserDataType), user_data.?)),
});
}
@@ -1426,12 +1429,12 @@ pub fn NewApp(comptime ssl: bool) type {
// const Wrapper = struct {
// pub fn handle(user_data: ?*anyopaque, fd: i32) callconv(.C) void {
// if (comptime UserDataType == void) {
- // @call(.{ .modifier = .always_inline }, handler, .{
+ // @call(.always_inline, handler, .{
// void{},
// fd,
// });
// } else {
- // @call(.{ .modifier = .always_inline }, handler, .{
+ // @call(.always_inline, handler, .{
// @ptrCast(
// UserDataType,
// @alignCast(@alignOf(UserDataType), user_data.?),
@@ -1445,12 +1448,12 @@ pub fn NewApp(comptime ssl: bool) type {
// const OnWritable = struct {
// pub fn handle(socket: *Socket) callconv(.C) ?*Socket {
// if (comptime UserDataType == void) {
- // @call(.{ .modifier = .always_inline }, handler, .{
+ // @call(.always_inline, handler, .{
// void{},
// fd,
// });
// } else {
- // @call(.{ .modifier = .always_inline }, handler, .{
+ // @call(.always_inline, handler, .{
// @ptrCast(
// UserDataType,
// @alignCast(@alignOf(UserDataType), user_data.?),
@@ -1538,7 +1541,7 @@ pub fn NewApp(comptime ssl: bool) type {
const ContextType = @TypeOf(ctx);
const Wrapper = struct {
pub fn wrap(user_data: ?*anyopaque) callconv(.C) void {
- @call(.{ .modifier = .always_inline }, callback, .{bun.cast(ContextType, user_data.?)});
+ @call(.always_inline, callback, .{bun.cast(ContextType, user_data.?)});
}
};
@@ -1554,7 +1557,7 @@ pub fn NewApp(comptime ssl: bool) type {
return uws_ws_is_subscribed(ssl_flag, this.raw(), topic.ptr, topic.len);
}
// pub fn iterateTopics(this: *WebSocket) {
- // return uws_ws_iterate_topics(ssl_flag, this.raw(), callback: ?fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
+ // return uws_ws_iterate_topics(ssl_flag, this.raw(), callback: ?*const fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
// }
pub fn publish(this: *WebSocket, topic: []const u8, message: []const u8) bool {
return uws_ws_publish(ssl_flag, this.raw(), topic.ptr, topic.len, message.ptr, message.len);
@@ -1622,11 +1625,11 @@ extern fn uws_ws_send_first_fragment(ssl: i32, ws: ?*RawWebSocket, message: [*c]
extern fn uws_ws_send_first_fragment_with_opcode(ssl: i32, ws: ?*RawWebSocket, message: [*c]const u8, length: usize, opcode: Opcode, compress: bool) SendStatus;
extern fn uws_ws_send_last_fragment(ssl: i32, ws: ?*RawWebSocket, message: [*c]const u8, length: usize, compress: bool) SendStatus;
extern fn uws_ws_end(ssl: i32, ws: ?*RawWebSocket, code: i32, message: [*c]const u8, length: usize) void;
-extern fn uws_ws_cork(ssl: i32, ws: ?*RawWebSocket, handler: ?fn (?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
+extern fn uws_ws_cork(ssl: i32, ws: ?*RawWebSocket, handler: ?*const fn (?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
extern fn uws_ws_subscribe(ssl: i32, ws: ?*RawWebSocket, topic: [*c]const u8, length: usize) bool;
extern fn uws_ws_unsubscribe(ssl: i32, ws: ?*RawWebSocket, topic: [*c]const u8, length: usize) bool;
extern fn uws_ws_is_subscribed(ssl: i32, ws: ?*RawWebSocket, topic: [*c]const u8, length: usize) bool;
-extern fn uws_ws_iterate_topics(ssl: i32, ws: ?*RawWebSocket, callback: ?fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
+extern fn uws_ws_iterate_topics(ssl: i32, ws: ?*RawWebSocket, callback: ?*const fn ([*c]const u8, usize, ?*anyopaque) callconv(.C) void, user_data: ?*anyopaque) void;
extern fn uws_ws_publish(ssl: i32, ws: ?*RawWebSocket, topic: [*c]const u8, topic_length: usize, message: [*c]const u8, message_length: usize) bool;
extern fn uws_ws_publish_with_options(ssl: i32, ws: ?*RawWebSocket, topic: [*c]const u8, topic_length: usize, message: [*c]const u8, message_length: usize, opcode: Opcode, compress: bool) bool;
extern fn uws_ws_get_buffered_amount(ssl: i32, ws: ?*RawWebSocket) c_uint;
@@ -1654,12 +1657,12 @@ extern fn uws_res_write(ssl: i32, res: *uws_res, data: [*c]const u8, length: usi
extern fn uws_res_get_write_offset(ssl: i32, res: *uws_res) uintmax_t;
extern fn uws_res_override_write_offset(ssl: i32, res: *uws_res, uintmax_t) void;
extern fn uws_res_has_responded(ssl: i32, res: *uws_res) bool;
-extern fn uws_res_on_writable(ssl: i32, res: *uws_res, handler: ?fn (*uws_res, uintmax_t, ?*anyopaque) callconv(.C) bool, user_data: ?*anyopaque) void;
-extern fn uws_res_on_aborted(ssl: i32, res: *uws_res, handler: ?fn (*uws_res, ?*anyopaque) callconv(.C) void, opcional_data: ?*anyopaque) void;
+extern fn uws_res_on_writable(ssl: i32, res: *uws_res, handler: ?*const fn (*uws_res, uintmax_t, ?*anyopaque) callconv(.C) bool, user_data: ?*anyopaque) void;
+extern fn uws_res_on_aborted(ssl: i32, res: *uws_res, handler: ?*const fn (*uws_res, ?*anyopaque) callconv(.C) void, opcional_data: ?*anyopaque) void;
extern fn uws_res_on_data(
ssl: i32,
res: *uws_res,
- handler: ?fn (*uws_res, [*c]const u8, usize, bool, ?*anyopaque) callconv(.C) void,
+ handler: ?*const fn (*uws_res, [*c]const u8, usize, bool, ?*anyopaque) callconv(.C) void,
opcional_data: ?*anyopaque,
) void;
extern fn uws_res_upgrade(
@@ -1674,7 +1677,7 @@ extern fn uws_res_upgrade(
sec_web_socket_extensions_length: usize,
ws: ?*uws_socket_context_t,
) void;
-extern fn uws_res_cork(i32, res: *uws_res, ctx: *anyopaque, corker: fn (?*anyopaque) callconv(.C) void) void;
+extern fn uws_res_cork(i32, res: *uws_res, ctx: *anyopaque, corker: *const (fn (?*anyopaque) callconv(.C) void)) void;
extern fn uws_res_write_headers(i32, res: *uws_res, names: [*]const Api.StringPointer, values: [*]const Api.StringPointer, count: usize, buf: [*]const u8) void;
pub const LIBUS_RECV_BUFFER_LENGTH = 524288;
pub const LIBUS_TIMEOUT_GRANULARITY = @as(i32, 4);
diff --git a/src/deps/zig-clap/clap.zig b/src/deps/zig-clap/clap.zig
index eb1a5e452..a21a1cb1a 100644
--- a/src/deps/zig-clap/clap.zig
+++ b/src/deps/zig-clap/clap.zig
@@ -55,8 +55,8 @@ pub const Values = enum {
/// * Positional parameters must take a value.
pub fn Param(comptime Id: type) type {
return struct {
- id: Id = Id{},
- names: Names = Names{},
+ id: Id = std.mem.zeroes(Id),
+ names: Names = std.mem.zeroes(Names),
takes_value: Values = .none,
};
}
@@ -386,9 +386,9 @@ fn printParam(
switch (param.takes_value) {
.none => {},
- .one => try stream.print(" <{s}>", .{valueText(context, param)}),
- .one_optional => try stream.print(" <{s}>?", .{valueText(context, param)}),
- .many => try stream.print(" <{s}>...", .{valueText(context, param)}),
+ .one => try stream.print(" <{s}>", .{try valueText(context, param)}),
+ .one_optional => try stream.print(" <{s}>?", .{try valueText(context, param)}),
+ .many => try stream.print(" <{s}>...", .{try valueText(context, param)}),
}
}
@@ -398,12 +398,12 @@ pub fn helpEx(
stream: anytype,
comptime Id: type,
params: []const Param(Id),
- helpText: fn (Param(Id)) []const u8,
- valueText: fn (Param(Id)) []const u8,
+ helpText: *const fn (Param(Id)) []const u8,
+ valueText: *const fn (Param(Id)) []const u8,
) !void {
const Context = struct {
- helpText: fn (Param(Id)) []const u8,
- valueText: fn (Param(Id)) []const u8,
+ helpText: *const fn (Param(Id)) []const u8,
+ valueText: *const fn (Param(Id)) []const u8,
pub fn help(c: @This(), p: Param(Id)) error{}![]const u8 {
return c.helpText(p);
diff --git a/src/deps/zig-clap/clap/args.zig b/src/deps/zig-clap/clap/args.zig
index b5f79889f..c53ca7ec6 100644
--- a/src/deps/zig-clap/clap/args.zig
+++ b/src/deps/zig-clap/clap/args.zig
@@ -256,7 +256,7 @@ pub const ShellIterator = struct {
// the rest we have to the list and return that.
if (list.items.len != 0) {
try list.appendSlice(res);
- return list.toOwnedSlice();
+ return try list.toOwnedSlice();
}
return res;
}
diff --git a/src/deps/zig-clap/clap/comptime.zig b/src/deps/zig-clap/clap/comptime.zig
index cfabd7cf4..b4739d646 100644
--- a/src/deps/zig-clap/clap/comptime.zig
+++ b/src/deps/zig-clap/clap/comptime.zig
@@ -81,7 +81,7 @@ pub fn ComptimeClap(
"TODO: implement stop_after_positional_at on windows",
);
- var remaining_ = std.os.argv[@minimum(std.os.argv.len, stream.iter.args.inner.index)..];
+ var remaining_ = std.os.argv[@min(std.os.argv.len, stream.iter.args.inner.index)..];
const first: []const u8 = if (remaining_.len > 0) bun.span(remaining_[0]) else "";
if (first.len > 0 and std.mem.eql(u8, first, "--")) {
remaining_ = remaining_[1..];
@@ -110,9 +110,9 @@ pub fn ComptimeClap(
}
for (multis) |*multi, i|
- res.multi_options[i] = multi.toOwnedSlice();
- res.pos = pos.toOwnedSlice();
- res.passthrough_positionals = passthrough_positionals.toOwnedSlice();
+ res.multi_options[i] = try multi.toOwnedSlice();
+ res.pos = try pos.toOwnedSlice();
+ res.passthrough_positionals = try passthrough_positionals.toOwnedSlice();
return res;
}
diff --git a/src/deps/zig-datetime/src/datetime.zig b/src/deps/zig-datetime/src/datetime.zig
index 6e21190d9..578356fa8 100644
--- a/src/deps/zig-datetime/src/datetime.zig
+++ b/src/deps/zig-datetime/src/datetime.zig
@@ -1022,7 +1022,7 @@ test "time-copy" {
test "time-compare" {
var t1 = try Time.create(8, 30, 0, 0);
var t2 = try Time.create(9, 30, 0, 0);
- var t3 = try Time.create(8, 00, 0, 0);
+ var t3 = try Time.create(8, 0, 0, 0);
var t4 = try Time.create(9, 30, 17, 0);
try testing.expect(t1.lt(t2));
diff --git a/src/deps/zlib b/src/deps/zlib
-Subproject cacf7f1d4e3d44d871b605da3b647f07d718623
+Subproject 885674026394870b7e7a05b7bf1ec5eb7bd8a9c
diff --git a/src/env.zig b/src/env.zig
index 5e4486b23..1a763d90b 100644
--- a/src/env.zig
+++ b/src/env.zig
@@ -30,10 +30,12 @@ const BuildOptions = if (isTest) struct {
pub const baseline = false;
pub const sha = "0000000000000000000000000000000000000000";
pub const is_canary = false;
-} else @import("build_options");
+ pub const base_path = "/tmp";
+} else @import("root").build_options;
pub const baseline = BuildOptions.baseline;
pub const enableSIMD: bool = !baseline;
pub const git_sha = BuildOptions.sha;
pub const is_canary = BuildOptions.is_canary;
pub const dump_source = isDebug and !isTest;
+pub const base_path = BuildOptions.base_path ++ "/";
diff --git a/src/env_loader.zig b/src/env_loader.zig
index b2ee6815a..08d0a0a9d 100644
--- a/src/env_loader.zig
+++ b/src/env_loader.zig
@@ -94,7 +94,7 @@ pub const Lexer = struct {
last_flush = i;
const name = variable.value[start + curly_braces_offset .. i - curly_braces_offset];
- if (@call(.{ .modifier = .always_inline }, getter, .{ ctx, name })) |new_value| {
+ if (@call(.always_inline, getter, .{ ctx, name })) |new_value| {
if (new_value.len > 0) {
try writer.writeAll(new_value);
}
@@ -164,7 +164,7 @@ pub const Lexer = struct {
-1 => {
lexer.end = lexer.current;
- return lexer.source.contents[start..if (any_spaces) @minimum(last_non_space, lexer.source.contents.len) else lexer.source.contents.len];
+ return lexer.source.contents[start..if (any_spaces) @min(last_non_space, lexer.source.contents.len) else lexer.source.contents.len];
},
'$' => {
lexer.has_nested_value = true;
@@ -182,13 +182,13 @@ pub const Lexer = struct {
'\'' => {
lexer.end = lexer.current;
lexer.step();
- return lexer.source.contents[start..@minimum(lexer.end, lexer.source.contents.len)];
+ return lexer.source.contents[start..@min(lexer.end, lexer.source.contents.len)];
},
implicitQuoteCharacter => {
lexer.end = lexer.current;
lexer.step();
- return lexer.source.contents[start..@minimum(if (any_spaces) last_non_space + 1 else lexer.end, lexer.end)];
+ return lexer.source.contents[start..@min(if (any_spaces) last_non_space + 1 else lexer.end, lexer.end)];
},
'"' => {
// We keep going
@@ -201,7 +201,7 @@ pub const Lexer = struct {
lexer.step();
lexer.was_quoted = was_quoted;
- return lexer.source.contents[start..@minimum(
+ return lexer.source.contents[start..@min(
lexer.end,
lexer.source.contents.len,
)];
@@ -293,7 +293,7 @@ pub const Lexer = struct {
0, -1 => {
this.end = this.current;
return if (last_non_space > this.start)
- Variable{ .key = this.source.contents[this.start..@minimum(last_non_space + 1, this.source.contents.len)], .value = "" }
+ Variable{ .key = this.source.contents[this.start..@min(last_non_space + 1, this.source.contents.len)], .value = "" }
else
null;
},
diff --git a/src/fs.zig b/src/fs.zig
index d8aaf33e1..6e278f711 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -117,7 +117,9 @@ pub const FileSystem = struct {
pub fn tmpname(_: *const FileSystem, extname: string, buf: []u8, hash: u64) ![*:0]u8 {
// PRNG was...not so random
- return try std.fmt.bufPrintZ(buf, ".{x}{s}", .{ @truncate(u64, @intCast(u128, hash) * @intCast(u128, std.time.nanoTimestamp())), extname });
+ const hex_value = @truncate(u64, @intCast(u128, hash) * @intCast(u128, std.time.nanoTimestamp()));
+
+ return try std.fmt.bufPrintZ(buf, ".{any}{s}", .{ bun.fmt.hexIntLower(hex_value), extname });
}
pub var max_fd: FileDescriptorType = 0;
@@ -127,7 +129,7 @@ pub const FileSystem = struct {
return;
}
- max_fd = @maximum(fd, max_fd);
+ max_fd = @max(fd, max_fd);
}
pub var instance_loaded: bool = false;
pub var instance: FileSystem = undefined;
@@ -200,7 +202,7 @@ pub const FileSystem = struct {
// // dir.data.remove(name);
// }
- pub fn addEntry(dir: *DirEntry, entry: std.fs.Dir.Entry, allocator: std.mem.Allocator, comptime Iterator: type, iterator: Iterator) !void {
+ pub fn addEntry(dir: *DirEntry, entry: std.fs.IterableDir.Entry, allocator: std.mem.Allocator, comptime Iterator: type, iterator: Iterator) !void {
var _kind: Entry.Kind = undefined;
switch (entry.kind) {
.Directory => {
@@ -445,15 +447,15 @@ pub const FileSystem = struct {
// }
pub fn normalize(_: *@This(), str: string) string {
- return @call(.{ .modifier = .always_inline }, path_handler.normalizeString, .{ str, true, .auto });
+ return @call(.always_inline, path_handler.normalizeString, .{ str, true, .auto });
}
pub fn normalizeBuf(_: *@This(), buf: []u8, str: string) string {
- return @call(.{ .modifier = .always_inline }, path_handler.normalizeStringBuf, .{ str, buf, false, .auto, false });
+ return @call(.always_inline, path_handler.normalizeStringBuf, .{ str, buf, false, .auto, false });
}
pub fn join(_: *@This(), parts: anytype) string {
- return @call(.{ .modifier = .always_inline }, path_handler.joinStringBuf, .{
+ return @call(.always_inline, path_handler.joinStringBuf, .{
&join_buf,
parts,
.auto,
@@ -461,7 +463,7 @@ pub const FileSystem = struct {
}
pub fn joinBuf(_: *@This(), parts: anytype, buf: []u8) string {
- return @call(.{ .modifier = .always_inline }, path_handler.joinStringBuf, .{
+ return @call(.always_inline, path_handler.joinStringBuf, .{
buf,
parts,
.auto,
@@ -469,21 +471,21 @@ pub const FileSystem = struct {
}
pub fn relative(_: *@This(), from: string, to: string) string {
- return @call(.{ .modifier = .always_inline }, path_handler.relative, .{
+ return @call(.always_inline, path_handler.relative, .{
from,
to,
});
}
pub fn relativeTo(f: *@This(), to: string) string {
- return @call(.{ .modifier = .always_inline }, path_handler.relative, .{
+ return @call(.always_inline, path_handler.relative, .{
f.top_level_dir,
to,
});
}
pub fn relativeFrom(f: *@This(), from: string) string {
- return @call(.{ .modifier = .always_inline }, path_handler.relative, .{
+ return @call(.always_inline, path_handler.relative, .{
from,
f.top_level_dir,
});
@@ -567,7 +569,9 @@ pub const FileSystem = struct {
tmpdir_path_set = true;
}
- return try std.fs.openDirAbsolute(tmpdir_path, .{ .access_sub_paths = true, .iterate = true });
+ return (try std.fs.cwd().openIterableDir(tmpdir_path, .{
+ .access_sub_paths = true,
+ })).dir;
}
pub fn getDefaultTempDir() string {
@@ -727,12 +731,14 @@ pub const FileSystem = struct {
this: *const ModKey,
basename: string,
) !string {
+ const hex_int = this.hash();
+
return try std.fmt.bufPrint(
&hash_name_buf,
- "{s}-{x}",
+ "{s}-{any}",
.{
basename,
- this.hash(),
+ bun.fmt.hexIntLower(hex_int),
},
);
}
@@ -814,7 +820,10 @@ pub const FileSystem = struct {
};
pub fn openDir(_: *RealFS, unsafe_dir_string: string) std.fs.File.OpenError!std.fs.Dir {
- return try std.fs.openDirAbsolute(unsafe_dir_string, std.fs.Dir.OpenDirOptions{ .iterate = true, .access_sub_paths = true, .no_follow = false });
+ const dir = try std.os.open(unsafe_dir_string, std.os.O.DIRECTORY, 0);
+ return std.fs.Dir{
+ .fd = dir,
+ };
}
fn readdir(
@@ -824,7 +833,7 @@ pub const FileSystem = struct {
comptime Iterator: type,
iterator: Iterator,
) !DirEntry {
- var iter: std.fs.Dir.Iterator = handle.iterate();
+ var iter = (std.fs.IterableDir{ .dir = handle }).iterate();
var dir = DirEntry.init(_dir);
const allocator = fs.allocator;
errdefer dir.deinit(allocator);
@@ -1353,7 +1362,3 @@ test "PathName.init" {
try std.testing.expectEqualStrings(res.base, "file");
try std.testing.expectEqualStrings(res.ext, ".ext");
}
-
-test "" {
- @import("std").testing.refAllDecls(FileSystem);
-}
diff --git a/src/http.zig b/src/http.zig
index 82fa5734b..1c39654e3 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -340,10 +340,11 @@ pub const RequestContext = struct {
.jsx = bundler_.options.jsx,
};
- if (bundler_.parse(
+ var tmp = bundler_.parse(
bundler_parse_options,
@as(?*bundler.FallbackEntryPoint, &fallback_entry_point),
- )) |*result| {
+ );
+ if (tmp) |*result| {
try bundler_.linker.linkAllowImportingFromBundle(
fallback_entry_point.source.path,
result,
@@ -1480,7 +1481,7 @@ pub const RequestContext = struct {
vm.is_from_devserver = true;
vm.bundler.log = handler.log;
- std.debug.assert(JavaScript.VirtualMachine.vm_loaded);
+ std.debug.assert(JavaScript.VirtualMachine.isLoaded());
javascript_vm = vm;
vm.bundler.options.origin = handler.origin;
const boot = vm.bundler.options.framework.?.server.path;
@@ -1547,11 +1548,11 @@ pub const RequestContext = struct {
while (true) {
__arena = ThreadlocalArena.init() catch unreachable;
- JavaScript.VirtualMachine.vm.arena = &__arena;
- JavaScript.VirtualMachine.vm.has_loaded = true;
- JavaScript.VirtualMachine.vm.tick();
+ JavaScript.VirtualMachine.get().arena = &__arena;
+ JavaScript.VirtualMachine.get().has_loaded = true;
+ JavaScript.VirtualMachine.get().tick();
defer {
- JavaScript.VirtualMachine.vm.flush();
+ JavaScript.VirtualMachine.get().flush();
std.debug.assert(
JavaScript.ZigGlobalObject.resetModuleRegistryMap(vm.global, module_map),
);
@@ -1559,13 +1560,13 @@ pub const RequestContext = struct {
js_ast.Expr.Data.Store.reset();
JavaScript.API.Bun.flushCSSImports();
Output.flush();
- JavaScript.VirtualMachine.vm.arena.deinit();
- JavaScript.VirtualMachine.vm.has_loaded = false;
+ JavaScript.VirtualMachine.get().arena.deinit();
+ JavaScript.VirtualMachine.get().has_loaded = false;
}
var handler: *JavaScriptHandler = try channel.readItem();
- JavaScript.VirtualMachine.vm.tick();
- JavaScript.VirtualMachine.vm.preflush();
+ JavaScript.VirtualMachine.get().tick();
+ JavaScript.VirtualMachine.get().preflush();
const original_origin = vm.origin;
vm.origin = handler.ctx.origin;
defer vm.origin = original_origin;
@@ -1580,7 +1581,7 @@ pub const RequestContext = struct {
HandlerThread.handleFetchEventError,
) catch {};
Server.current.releaseRequestDataPoolNode(req_body);
- JavaScript.VirtualMachine.vm.tick();
+ JavaScript.VirtualMachine.get().tick();
handler.deinit();
}
}
@@ -1684,7 +1685,7 @@ pub const RequestContext = struct {
try ctx.bundler.clone(server.allocator, &clone.bundler);
ctx.bundler = &clone.bundler;
- clone.task = .{ .callback = onTask };
+ clone.task = .{ .callback = &onTask };
clone.message_buffer = try MutableString.init(server.allocator, 0);
clone.ctx.conn = &clone.conn;
clone.ctx.log = logger.Log.init(server.allocator);
@@ -1828,9 +1829,6 @@ pub const RequestContext = struct {
try ctx.sendBadRequest();
},
- else => {
- return err;
- },
}
};
@@ -1914,8 +1912,8 @@ pub const RequestContext = struct {
defer Output.flush();
handler.conn.client.getError() catch |err| {
- Output.prettyErrorln("<r><red>Websocket ERR:<r> <b>{s}<r>", .{err});
handler.tombstone = true;
+ Output.prettyErrorln("<r><red>Websocket ERR:<r> <b>{s}<r>", .{@errorName(err)});
is_socket_closed = true;
};
@@ -1928,7 +1926,7 @@ pub const RequestContext = struct {
continue;
},
else => {
- Output.prettyErrorln("<r><red>Websocket ERR:<r> <b>{s}<r>", .{err});
+ Output.prettyErrorln("<r><red>Websocket ERR:<r> <b>{s}<r>", .{@errorName(err)});
},
}
return;
@@ -2004,7 +2002,7 @@ pub const RequestContext = struct {
@memset(
handler.message_buffer.list.items.ptr,
0,
- @minimum(handler.message_buffer.list.items.len, 128),
+ @min(handler.message_buffer.list.items.len, 128),
);
}
const build_result = handler.builder.build(request_id, cmd.timestamp, arena.allocator()) catch |err| {
@@ -2683,11 +2681,11 @@ pub const RequestContext = struct {
// This makes it Just Work if you pass a line/column number
if (strings.indexOfChar(id, ':')) |colon| {
- line = id[@minimum(id.len, colon + 1)..];
+ line = id[@min(id.len, colon + 1)..];
id = id[0..colon];
if (strings.indexOfChar(line, ':')) |col| {
- column = line[@minimum(line.len, col + 1)..];
+ column = line[@min(line.len, col + 1)..];
line = line[0..col];
}
}
@@ -2710,8 +2708,8 @@ pub const RequestContext = struct {
}
}
- if (JavaScript.VirtualMachine.vm_loaded) {
- var vm = JavaScript.VirtualMachine.vm;
+ if (JavaScript.VirtualMachine.isLoaded()) {
+ var vm = JavaScript.VirtualMachine.get();
if (vm.blobs.?.get(id)) |blob| {
break :brk blob;
}
@@ -3073,7 +3071,7 @@ pub const RequestContext = struct {
const result = try ctx.buildFile(
ctx.url.path["abs:".len..],
);
- try @call(.{ .modifier = .always_inline }, RequestContext.renderServeResult, .{ ctx, result });
+ try @call(.always_inline, RequestContext.renderServeResult, .{ ctx, result });
},
else => {
try ctx.sendNotFound();
@@ -3144,7 +3142,7 @@ pub const RequestContext = struct {
const result = try ctx.buildFile(
ctx.url.pathWithoutAssetPrefix(ctx.bundler.options.routes.asset_prefix_path),
);
- try @call(.{ .modifier = .always_inline }, RequestContext.renderServeResult, .{ ctx, result });
+ try @call(.always_inline, RequestContext.renderServeResult, .{ ctx, result });
}
pub fn handleRequest(ctx: *RequestContext) !void {
@@ -3331,9 +3329,10 @@ pub const Server = struct {
Output.prettyErrorln("<r><d>File changed: {s}<r>", .{ctx.bundler.fs.relativeTo(file_path)});
}
} else {
+ var tmp = ctx.bundler.options.loaders.get(path.ext) orelse .file;
const change_message = Api.WebsocketMessageFileChangeNotification{
.id = id,
- .loader = (ctx.bundler.options.loaders.get(path.ext) orelse .file).toAPI(),
+ .loader = tmp.toAPI(),
};
var content_writer = ByteApiWriter.init(&content_fbs);
@@ -3444,8 +3443,8 @@ pub const Server = struct {
defer listener.deinit();
server.websocket_threadpool.stack_size = @truncate(
u32,
- @minimum(
- @maximum(128_000, Fs.FileSystem.RealFS.Limit.stack),
+ @min(
+ @max(128_000, Fs.FileSystem.RealFS.Limit.stack),
4_000_000,
),
);
@@ -3552,13 +3551,13 @@ pub const Server = struct {
}
} else {
if (server.bundler.options.routes.single_page_app_routing) {
- Output.prettyError(" bun!! <d>v{s}<r>\n\n\n<d> Link:<r> <b><cyan>http://{s}<r>\n <d>{s}/index.html<r> \n\n\n", .{
+ Output.prettyError(" bun!! <d>v{s}<r>\n\n\n<d> Link:<r> <b><cyan>http://{any}<r>\n <d>{s}/index.html<r> \n\n\n", .{
Global.package_json_version_with_sha,
addr,
display_path,
});
} else {
- Output.prettyError(" bun!! <d>v{s}\n\n\n<d> Link:<r> <b><cyan>http://{s}<r>\n\n\n", .{
+ Output.prettyError(" bun!! <d>v{s}\n\n\n<d> Link:<r> <b><cyan>http://{any}<r>\n\n\n", .{
Global.package_json_version_with_sha,
addr,
});
@@ -3629,7 +3628,7 @@ pub const Server = struct {
// https://stackoverflow.com/questions/686217/maximum-on-http-header-values
var read_size = conn.client.read(&req_buf_node.data, SOCKET_FLAGS) catch {
- _ = conn.client.write(RequestContext.printStatusLine(400) ++ "\r\n\r\n", SOCKET_FLAGS) catch {};
+ _ = conn.client.write(comptime RequestContext.printStatusLine(400) ++ "\r\n\r\n", SOCKET_FLAGS) catch {};
return;
};
@@ -3639,7 +3638,7 @@ pub const Server = struct {
}
var req = picohttp.Request.parse(req_buf_node.data[0..read_size], &req_headers_buf) catch |err| {
- _ = conn.client.write(RequestContext.printStatusLine(400) ++ "\r\n\r\n", SOCKET_FLAGS) catch {};
+ _ = conn.client.write(comptime RequestContext.printStatusLine(400) ++ "\r\n\r\n", SOCKET_FLAGS) catch {};
_ = Syscall.close(conn.client.socket.fd);
Output.printErrorln("ERR: {s}", .{@errorName(err)});
return;
diff --git a/src/http/mime_type.zig b/src/http/mime_type.zig
index 157733767..418bcaf2d 100644
--- a/src/http/mime_type.zig
+++ b/src/http/mime_type.zig
@@ -46,8 +46,8 @@ pub const Category = enum {
message,
@"x-conference",
@"x-shader",
- @"chemical",
- @"multipart",
+ chemical,
+ multipart,
pub fn isCode(this: Category) bool {
return switch (this) {
@@ -207,2288 +207,2288 @@ pub fn byExtensionNoDefault(ext: string) ?MimeType {
// this is partially auto-generated
pub const all = struct {
pub const @"application/webassembly" = wasm;
- pub const @"application/1d-interleaved-parityfec": MimeType = MimeType{ .category = .@"application", .value = "application/1d-interleaved-parityfec" };
- pub const @"application/3gpdash-qoe-report+xml": MimeType = MimeType{ .category = .@"application", .value = "application/3gpdash-qoe-report+xml" };
- pub const @"application/3gpp-ims+xml": MimeType = MimeType{ .category = .@"application", .value = "application/3gpp-ims+xml" };
- pub const @"application/3gpphal+json": MimeType = MimeType{ .category = .@"application", .value = "application/3gpphal+json" };
- pub const @"application/3gpphalforms+json": MimeType = MimeType{ .category = .@"application", .value = "application/3gpphalforms+json" };
- pub const @"application/a2l": MimeType = MimeType{ .category = .@"application", .value = "application/a2l" };
- pub const @"application/ace+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/ace+cbor" };
- pub const @"application/activemessage": MimeType = MimeType{ .category = .@"application", .value = "application/activemessage" };
- pub const @"application/activity+json": MimeType = MimeType{ .category = .@"application", .value = "application/activity+json" };
- pub const @"application/alto-cdni+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-cdni+json" };
- pub const @"application/alto-cdnifilter+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-cdnifilter+json" };
- pub const @"application/alto-costmap+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-costmap+json" };
- pub const @"application/alto-costmapfilter+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-costmapfilter+json" };
- pub const @"application/alto-directory+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-directory+json" };
- pub const @"application/alto-endpointcost+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-endpointcost+json" };
- pub const @"application/alto-endpointcostparams+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-endpointcostparams+json" };
- pub const @"application/alto-endpointprop+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-endpointprop+json" };
- pub const @"application/alto-endpointpropparams+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-endpointpropparams+json" };
- pub const @"application/alto-error+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-error+json" };
- pub const @"application/alto-networkmap+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-networkmap+json" };
- pub const @"application/alto-networkmapfilter+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-networkmapfilter+json" };
- pub const @"application/alto-propmap+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-propmap+json" };
- pub const @"application/alto-propmapparams+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-propmapparams+json" };
- pub const @"application/alto-updatestreamcontrol+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-updatestreamcontrol+json" };
- pub const @"application/alto-updatestreamparams+json": MimeType = MimeType{ .category = .@"application", .value = "application/alto-updatestreamparams+json" };
- pub const @"application/aml": MimeType = MimeType{ .category = .@"application", .value = "application/aml" };
- pub const @"application/andrew-inset": MimeType = MimeType{ .category = .@"application", .value = "application/andrew-inset" };
- pub const @"application/applefile": MimeType = MimeType{ .category = .@"application", .value = "application/applefile" };
- pub const @"application/applixware": MimeType = MimeType{ .category = .@"application", .value = "application/applixware" };
- pub const @"application/at+jwt": MimeType = MimeType{ .category = .@"application", .value = "application/at+jwt" };
- pub const @"application/atf": MimeType = MimeType{ .category = .@"application", .value = "application/atf" };
- pub const @"application/atfx": MimeType = MimeType{ .category = .@"application", .value = "application/atfx" };
- pub const @"application/atom+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atom+xml" };
- pub const @"application/atomcat+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atomcat+xml" };
- pub const @"application/atomdeleted+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atomdeleted+xml" };
- pub const @"application/atomicmail": MimeType = MimeType{ .category = .@"application", .value = "application/atomicmail" };
- pub const @"application/atomsvc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atomsvc+xml" };
- pub const @"application/atsc-dwd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atsc-dwd+xml" };
- pub const @"application/atsc-dynamic-event-message": MimeType = MimeType{ .category = .@"application", .value = "application/atsc-dynamic-event-message" };
- pub const @"application/atsc-held+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atsc-held+xml" };
- pub const @"application/atsc-rdt+json": MimeType = MimeType{ .category = .@"application", .value = "application/atsc-rdt+json" };
- pub const @"application/atsc-rsat+xml": MimeType = MimeType{ .category = .@"application", .value = "application/atsc-rsat+xml" };
- pub const @"application/atxml": MimeType = MimeType{ .category = .@"application", .value = "application/atxml" };
- pub const @"application/auth-policy+xml": MimeType = MimeType{ .category = .@"application", .value = "application/auth-policy+xml" };
- pub const @"application/bacnet-xdd+zip": MimeType = MimeType{ .category = .@"application", .value = "application/bacnet-xdd+zip" };
- pub const @"application/batch-smtp": MimeType = MimeType{ .category = .@"application", .value = "application/batch-smtp" };
- pub const @"application/bdoc": MimeType = MimeType{ .category = .@"application", .value = "application/bdoc" };
- pub const @"application/beep+xml": MimeType = MimeType{ .category = .@"application", .value = "application/beep+xml" };
- pub const @"application/calendar+json": MimeType = MimeType{ .category = .@"application", .value = "application/calendar+json" };
- pub const @"application/calendar+xml": MimeType = MimeType{ .category = .@"application", .value = "application/calendar+xml" };
- pub const @"application/call-completion": MimeType = MimeType{ .category = .@"application", .value = "application/call-completion" };
- pub const @"application/cals-1840": MimeType = MimeType{ .category = .@"application", .value = "application/cals-1840" };
- pub const @"application/captive+json": MimeType = MimeType{ .category = .@"application", .value = "application/captive+json" };
- pub const @"application/cbor": MimeType = MimeType{ .category = .@"application", .value = "application/cbor" };
- pub const @"application/cbor-seq": MimeType = MimeType{ .category = .@"application", .value = "application/cbor-seq" };
- pub const @"application/cccex": MimeType = MimeType{ .category = .@"application", .value = "application/cccex" };
- pub const @"application/ccmp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ccmp+xml" };
- pub const @"application/ccxml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ccxml+xml" };
- pub const @"application/cdfx+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cdfx+xml" };
- pub const @"application/cdmi-capability": MimeType = MimeType{ .category = .@"application", .value = "application/cdmi-capability" };
- pub const @"application/cdmi-container": MimeType = MimeType{ .category = .@"application", .value = "application/cdmi-container" };
- pub const @"application/cdmi-domain": MimeType = MimeType{ .category = .@"application", .value = "application/cdmi-domain" };
- pub const @"application/cdmi-object": MimeType = MimeType{ .category = .@"application", .value = "application/cdmi-object" };
- pub const @"application/cdmi-queue": MimeType = MimeType{ .category = .@"application", .value = "application/cdmi-queue" };
- pub const @"application/cdni": MimeType = MimeType{ .category = .@"application", .value = "application/cdni" };
- pub const @"application/cea": MimeType = MimeType{ .category = .@"application", .value = "application/cea" };
- pub const @"application/cea-2018+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cea-2018+xml" };
- pub const @"application/cellml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cellml+xml" };
- pub const @"application/cfw": MimeType = MimeType{ .category = .@"application", .value = "application/cfw" };
- pub const @"application/city+json": MimeType = MimeType{ .category = .@"application", .value = "application/city+json" };
- pub const @"application/clr": MimeType = MimeType{ .category = .@"application", .value = "application/clr" };
- pub const @"application/clue+xml": MimeType = MimeType{ .category = .@"application", .value = "application/clue+xml" };
- pub const @"application/clue_info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/clue_info+xml" };
- pub const @"application/cms": MimeType = MimeType{ .category = .@"application", .value = "application/cms" };
- pub const @"application/cnrp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cnrp+xml" };
- pub const @"application/coap-group+json": MimeType = MimeType{ .category = .@"application", .value = "application/coap-group+json" };
- pub const @"application/coap-payload": MimeType = MimeType{ .category = .@"application", .value = "application/coap-payload" };
- pub const @"application/commonground": MimeType = MimeType{ .category = .@"application", .value = "application/commonground" };
- pub const @"application/conference-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/conference-info+xml" };
- pub const @"application/cose": MimeType = MimeType{ .category = .@"application", .value = "application/cose" };
- pub const @"application/cose-key": MimeType = MimeType{ .category = .@"application", .value = "application/cose-key" };
- pub const @"application/cose-key-set": MimeType = MimeType{ .category = .@"application", .value = "application/cose-key-set" };
- pub const @"application/cpl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cpl+xml" };
- pub const @"application/csrattrs": MimeType = MimeType{ .category = .@"application", .value = "application/csrattrs" };
- pub const @"application/csta+xml": MimeType = MimeType{ .category = .@"application", .value = "application/csta+xml" };
- pub const @"application/cstadata+xml": MimeType = MimeType{ .category = .@"application", .value = "application/cstadata+xml" };
- pub const @"application/csvm+json": MimeType = MimeType{ .category = .@"application", .value = "application/csvm+json" };
- pub const @"application/cu-seeme": MimeType = MimeType{ .category = .@"application", .value = "application/cu-seeme" };
- pub const @"application/cwt": MimeType = MimeType{ .category = .@"application", .value = "application/cwt" };
- pub const @"application/cybercash": MimeType = MimeType{ .category = .@"application", .value = "application/cybercash" };
- pub const @"application/dart": MimeType = MimeType{ .category = .@"application", .value = "application/dart" };
- pub const @"application/dash+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dash+xml" };
- pub const @"application/dash-patch+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dash-patch+xml" };
- pub const @"application/dashdelta": MimeType = MimeType{ .category = .@"application", .value = "application/dashdelta" };
- pub const @"application/davmount+xml": MimeType = MimeType{ .category = .@"application", .value = "application/davmount+xml" };
- pub const @"application/dca-rft": MimeType = MimeType{ .category = .@"application", .value = "application/dca-rft" };
- pub const @"application/dcd": MimeType = MimeType{ .category = .@"application", .value = "application/dcd" };
- pub const @"application/dec-dx": MimeType = MimeType{ .category = .@"application", .value = "application/dec-dx" };
- pub const @"application/dialog-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dialog-info+xml" };
- pub const @"application/dicom": MimeType = MimeType{ .category = .@"application", .value = "application/dicom" };
- pub const @"application/dicom+json": MimeType = MimeType{ .category = .@"application", .value = "application/dicom+json" };
- pub const @"application/dicom+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dicom+xml" };
- pub const @"application/dii": MimeType = MimeType{ .category = .@"application", .value = "application/dii" };
- pub const @"application/dit": MimeType = MimeType{ .category = .@"application", .value = "application/dit" };
- pub const @"application/dns": MimeType = MimeType{ .category = .@"application", .value = "application/dns" };
- pub const @"application/dns+json": MimeType = MimeType{ .category = .@"application", .value = "application/dns+json" };
- pub const @"application/dns-message": MimeType = MimeType{ .category = .@"application", .value = "application/dns-message" };
- pub const @"application/docbook+xml": MimeType = MimeType{ .category = .@"application", .value = "application/docbook+xml" };
- pub const @"application/dots+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/dots+cbor" };
- pub const @"application/dskpp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dskpp+xml" };
- pub const @"application/dssc+der": MimeType = MimeType{ .category = .@"application", .value = "application/dssc+der" };
- pub const @"application/dssc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/dssc+xml" };
- pub const @"application/dvcs": MimeType = MimeType{ .category = .@"application", .value = "application/dvcs" };
- pub const @"application/ecmascript": MimeType = MimeType{ .category = .@"application", .value = "application/ecmascript" };
- pub const @"application/edi-consent": MimeType = MimeType{ .category = .@"application", .value = "application/edi-consent" };
- pub const @"application/edi-x12": MimeType = MimeType{ .category = .@"application", .value = "application/edi-x12" };
- pub const @"application/edifact": MimeType = MimeType{ .category = .@"application", .value = "application/edifact" };
- pub const @"application/efi": MimeType = MimeType{ .category = .@"application", .value = "application/efi" };
- pub const @"application/elm+json": MimeType = MimeType{ .category = .@"application", .value = "application/elm+json" };
- pub const @"application/elm+xml": MimeType = MimeType{ .category = .@"application", .value = "application/elm+xml" };
- pub const @"application/emergencycalldata.cap+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.cap+xml" };
- pub const @"application/emergencycalldata.comment+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.comment+xml" };
- pub const @"application/emergencycalldata.control+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.control+xml" };
- pub const @"application/emergencycalldata.deviceinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.deviceinfo+xml" };
- pub const @"application/emergencycalldata.ecall.msd": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.ecall.msd" };
- pub const @"application/emergencycalldata.providerinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.providerinfo+xml" };
- pub const @"application/emergencycalldata.serviceinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.serviceinfo+xml" };
- pub const @"application/emergencycalldata.subscriberinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.subscriberinfo+xml" };
- pub const @"application/emergencycalldata.veds+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emergencycalldata.veds+xml" };
- pub const @"application/emma+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emma+xml" };
- pub const @"application/emotionml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/emotionml+xml" };
- pub const @"application/encaprtp": MimeType = MimeType{ .category = .@"application", .value = "application/encaprtp" };
- pub const @"application/epp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/epp+xml" };
- pub const @"application/epub+zip": MimeType = MimeType{ .category = .@"application", .value = "application/epub+zip" };
- pub const @"application/eshop": MimeType = MimeType{ .category = .@"application", .value = "application/eshop" };
- pub const @"application/exi": MimeType = MimeType{ .category = .@"application", .value = "application/exi" };
- pub const @"application/expect-ct-report+json": MimeType = MimeType{ .category = .@"application", .value = "application/expect-ct-report+json" };
- pub const @"application/express": MimeType = MimeType{ .category = .@"application", .value = "application/express" };
- pub const @"application/fastinfoset": MimeType = MimeType{ .category = .@"application", .value = "application/fastinfoset" };
- pub const @"application/fastsoap": MimeType = MimeType{ .category = .@"application", .value = "application/fastsoap" };
- pub const @"application/fdt+xml": MimeType = MimeType{ .category = .@"application", .value = "application/fdt+xml" };
- pub const @"application/fhir+json": MimeType = MimeType{ .category = .@"application", .value = "application/fhir+json" };
- pub const @"application/fhir+xml": MimeType = MimeType{ .category = .@"application", .value = "application/fhir+xml" };
- pub const @"application/fido.trusted-apps+json": MimeType = MimeType{ .category = .@"application", .value = "application/fido.trusted-apps+json" };
- pub const @"application/fits": MimeType = MimeType{ .category = .@"application", .value = "application/fits" };
- pub const @"application/flexfec": MimeType = MimeType{ .category = .@"application", .value = "application/flexfec" };
- pub const @"application/font-sfnt": MimeType = MimeType{ .category = .@"application", .value = "application/font-sfnt" };
- pub const @"application/font-tdpfr": MimeType = MimeType{ .category = .@"application", .value = "application/font-tdpfr" };
- pub const @"application/font-woff": MimeType = MimeType{ .category = .@"application", .value = "application/font-woff" };
- pub const @"application/framework-attributes+xml": MimeType = MimeType{ .category = .@"application", .value = "application/framework-attributes+xml" };
- pub const @"application/geo+json": MimeType = MimeType{ .category = .@"application", .value = "application/geo+json" };
- pub const @"application/geo+json-seq": MimeType = MimeType{ .category = .@"application", .value = "application/geo+json-seq" };
- pub const @"application/geopackage+sqlite3": MimeType = MimeType{ .category = .@"application", .value = "application/geopackage+sqlite3" };
- pub const @"application/geoxacml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/geoxacml+xml" };
- pub const @"application/gltf-buffer": MimeType = MimeType{ .category = .@"application", .value = "application/gltf-buffer" };
- pub const @"application/gml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/gml+xml" };
- pub const @"application/gpx+xml": MimeType = MimeType{ .category = .@"application", .value = "application/gpx+xml" };
- pub const @"application/gxf": MimeType = MimeType{ .category = .@"application", .value = "application/gxf" };
- pub const @"application/gzip": MimeType = MimeType{ .category = .@"application", .value = "application/gzip" };
- pub const @"application/h224": MimeType = MimeType{ .category = .@"application", .value = "application/h224" };
- pub const @"application/held+xml": MimeType = MimeType{ .category = .@"application", .value = "application/held+xml" };
- pub const @"application/hjson": MimeType = MimeType{ .category = .@"application", .value = "application/hjson" };
- pub const @"application/http": MimeType = MimeType{ .category = .@"application", .value = "application/http" };
- pub const @"application/hyperstudio": MimeType = MimeType{ .category = .@"application", .value = "application/hyperstudio" };
- pub const @"application/ibe-key-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ibe-key-request+xml" };
- pub const @"application/ibe-pkg-reply+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ibe-pkg-reply+xml" };
- pub const @"application/ibe-pp-data": MimeType = MimeType{ .category = .@"application", .value = "application/ibe-pp-data" };
- pub const @"application/iges": MimeType = MimeType{ .category = .@"application", .value = "application/iges" };
- pub const @"application/im-iscomposing+xml": MimeType = MimeType{ .category = .@"application", .value = "application/im-iscomposing+xml" };
- pub const @"application/index": MimeType = MimeType{ .category = .@"application", .value = "application/index" };
- pub const @"application/index.cmd": MimeType = MimeType{ .category = .@"application", .value = "application/index.cmd" };
- pub const @"application/index.obj": MimeType = MimeType{ .category = .@"application", .value = "application/index.obj" };
- pub const @"application/index.response": MimeType = MimeType{ .category = .@"application", .value = "application/index.response" };
- pub const @"application/index.vnd": MimeType = MimeType{ .category = .@"application", .value = "application/index.vnd" };
- pub const @"application/inkml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/inkml+xml" };
- pub const @"application/iotp": MimeType = MimeType{ .category = .@"application", .value = "application/iotp" };
- pub const @"application/ipfix": MimeType = MimeType{ .category = .@"application", .value = "application/ipfix" };
- pub const @"application/ipp": MimeType = MimeType{ .category = .@"application", .value = "application/ipp" };
- pub const @"application/isup": MimeType = MimeType{ .category = .@"application", .value = "application/isup" };
- pub const @"application/its+xml": MimeType = MimeType{ .category = .@"application", .value = "application/its+xml" };
- pub const @"application/java-archive": MimeType = MimeType{ .category = .@"application", .value = "application/java-archive" };
- pub const @"application/java-serialized-object": MimeType = MimeType{ .category = .@"application", .value = "application/java-serialized-object" };
- pub const @"application/java-vm": MimeType = MimeType{ .category = .@"application", .value = "application/java-vm" };
+ pub const @"application/1d-interleaved-parityfec": MimeType = MimeType{ .category = .application, .value = "application/1d-interleaved-parityfec" };
+ pub const @"application/3gpdash-qoe-report+xml": MimeType = MimeType{ .category = .application, .value = "application/3gpdash-qoe-report+xml" };
+ pub const @"application/3gpp-ims+xml": MimeType = MimeType{ .category = .application, .value = "application/3gpp-ims+xml" };
+ pub const @"application/3gpphal+json": MimeType = MimeType{ .category = .application, .value = "application/3gpphal+json" };
+ pub const @"application/3gpphalforms+json": MimeType = MimeType{ .category = .application, .value = "application/3gpphalforms+json" };
+ pub const @"application/a2l": MimeType = MimeType{ .category = .application, .value = "application/a2l" };
+ pub const @"application/ace+cbor": MimeType = MimeType{ .category = .application, .value = "application/ace+cbor" };
+ pub const @"application/activemessage": MimeType = MimeType{ .category = .application, .value = "application/activemessage" };
+ pub const @"application/activity+json": MimeType = MimeType{ .category = .application, .value = "application/activity+json" };
+ pub const @"application/alto-cdni+json": MimeType = MimeType{ .category = .application, .value = "application/alto-cdni+json" };
+ pub const @"application/alto-cdnifilter+json": MimeType = MimeType{ .category = .application, .value = "application/alto-cdnifilter+json" };
+ pub const @"application/alto-costmap+json": MimeType = MimeType{ .category = .application, .value = "application/alto-costmap+json" };
+ pub const @"application/alto-costmapfilter+json": MimeType = MimeType{ .category = .application, .value = "application/alto-costmapfilter+json" };
+ pub const @"application/alto-directory+json": MimeType = MimeType{ .category = .application, .value = "application/alto-directory+json" };
+ pub const @"application/alto-endpointcost+json": MimeType = MimeType{ .category = .application, .value = "application/alto-endpointcost+json" };
+ pub const @"application/alto-endpointcostparams+json": MimeType = MimeType{ .category = .application, .value = "application/alto-endpointcostparams+json" };
+ pub const @"application/alto-endpointprop+json": MimeType = MimeType{ .category = .application, .value = "application/alto-endpointprop+json" };
+ pub const @"application/alto-endpointpropparams+json": MimeType = MimeType{ .category = .application, .value = "application/alto-endpointpropparams+json" };
+ pub const @"application/alto-error+json": MimeType = MimeType{ .category = .application, .value = "application/alto-error+json" };
+ pub const @"application/alto-networkmap+json": MimeType = MimeType{ .category = .application, .value = "application/alto-networkmap+json" };
+ pub const @"application/alto-networkmapfilter+json": MimeType = MimeType{ .category = .application, .value = "application/alto-networkmapfilter+json" };
+ pub const @"application/alto-propmap+json": MimeType = MimeType{ .category = .application, .value = "application/alto-propmap+json" };
+ pub const @"application/alto-propmapparams+json": MimeType = MimeType{ .category = .application, .value = "application/alto-propmapparams+json" };
+ pub const @"application/alto-updatestreamcontrol+json": MimeType = MimeType{ .category = .application, .value = "application/alto-updatestreamcontrol+json" };
+ pub const @"application/alto-updatestreamparams+json": MimeType = MimeType{ .category = .application, .value = "application/alto-updatestreamparams+json" };
+ pub const @"application/aml": MimeType = MimeType{ .category = .application, .value = "application/aml" };
+ pub const @"application/andrew-inset": MimeType = MimeType{ .category = .application, .value = "application/andrew-inset" };
+ pub const @"application/applefile": MimeType = MimeType{ .category = .application, .value = "application/applefile" };
+ pub const @"application/applixware": MimeType = MimeType{ .category = .application, .value = "application/applixware" };
+ pub const @"application/at+jwt": MimeType = MimeType{ .category = .application, .value = "application/at+jwt" };
+ pub const @"application/atf": MimeType = MimeType{ .category = .application, .value = "application/atf" };
+ pub const @"application/atfx": MimeType = MimeType{ .category = .application, .value = "application/atfx" };
+ pub const @"application/atom+xml": MimeType = MimeType{ .category = .application, .value = "application/atom+xml" };
+ pub const @"application/atomcat+xml": MimeType = MimeType{ .category = .application, .value = "application/atomcat+xml" };
+ pub const @"application/atomdeleted+xml": MimeType = MimeType{ .category = .application, .value = "application/atomdeleted+xml" };
+ pub const @"application/atomicmail": MimeType = MimeType{ .category = .application, .value = "application/atomicmail" };
+ pub const @"application/atomsvc+xml": MimeType = MimeType{ .category = .application, .value = "application/atomsvc+xml" };
+ pub const @"application/atsc-dwd+xml": MimeType = MimeType{ .category = .application, .value = "application/atsc-dwd+xml" };
+ pub const @"application/atsc-dynamic-event-message": MimeType = MimeType{ .category = .application, .value = "application/atsc-dynamic-event-message" };
+ pub const @"application/atsc-held+xml": MimeType = MimeType{ .category = .application, .value = "application/atsc-held+xml" };
+ pub const @"application/atsc-rdt+json": MimeType = MimeType{ .category = .application, .value = "application/atsc-rdt+json" };
+ pub const @"application/atsc-rsat+xml": MimeType = MimeType{ .category = .application, .value = "application/atsc-rsat+xml" };
+ pub const @"application/atxml": MimeType = MimeType{ .category = .application, .value = "application/atxml" };
+ pub const @"application/auth-policy+xml": MimeType = MimeType{ .category = .application, .value = "application/auth-policy+xml" };
+ pub const @"application/bacnet-xdd+zip": MimeType = MimeType{ .category = .application, .value = "application/bacnet-xdd+zip" };
+ pub const @"application/batch-smtp": MimeType = MimeType{ .category = .application, .value = "application/batch-smtp" };
+ pub const @"application/bdoc": MimeType = MimeType{ .category = .application, .value = "application/bdoc" };
+ pub const @"application/beep+xml": MimeType = MimeType{ .category = .application, .value = "application/beep+xml" };
+ pub const @"application/calendar+json": MimeType = MimeType{ .category = .application, .value = "application/calendar+json" };
+ pub const @"application/calendar+xml": MimeType = MimeType{ .category = .application, .value = "application/calendar+xml" };
+ pub const @"application/call-completion": MimeType = MimeType{ .category = .application, .value = "application/call-completion" };
+ pub const @"application/cals-1840": MimeType = MimeType{ .category = .application, .value = "application/cals-1840" };
+ pub const @"application/captive+json": MimeType = MimeType{ .category = .application, .value = "application/captive+json" };
+ pub const @"application/cbor": MimeType = MimeType{ .category = .application, .value = "application/cbor" };
+ pub const @"application/cbor-seq": MimeType = MimeType{ .category = .application, .value = "application/cbor-seq" };
+ pub const @"application/cccex": MimeType = MimeType{ .category = .application, .value = "application/cccex" };
+ pub const @"application/ccmp+xml": MimeType = MimeType{ .category = .application, .value = "application/ccmp+xml" };
+ pub const @"application/ccxml+xml": MimeType = MimeType{ .category = .application, .value = "application/ccxml+xml" };
+ pub const @"application/cdfx+xml": MimeType = MimeType{ .category = .application, .value = "application/cdfx+xml" };
+ pub const @"application/cdmi-capability": MimeType = MimeType{ .category = .application, .value = "application/cdmi-capability" };
+ pub const @"application/cdmi-container": MimeType = MimeType{ .category = .application, .value = "application/cdmi-container" };
+ pub const @"application/cdmi-domain": MimeType = MimeType{ .category = .application, .value = "application/cdmi-domain" };
+ pub const @"application/cdmi-object": MimeType = MimeType{ .category = .application, .value = "application/cdmi-object" };
+ pub const @"application/cdmi-queue": MimeType = MimeType{ .category = .application, .value = "application/cdmi-queue" };
+ pub const @"application/cdni": MimeType = MimeType{ .category = .application, .value = "application/cdni" };
+ pub const @"application/cea": MimeType = MimeType{ .category = .application, .value = "application/cea" };
+ pub const @"application/cea-2018+xml": MimeType = MimeType{ .category = .application, .value = "application/cea-2018+xml" };
+ pub const @"application/cellml+xml": MimeType = MimeType{ .category = .application, .value = "application/cellml+xml" };
+ pub const @"application/cfw": MimeType = MimeType{ .category = .application, .value = "application/cfw" };
+ pub const @"application/city+json": MimeType = MimeType{ .category = .application, .value = "application/city+json" };
+ pub const @"application/clr": MimeType = MimeType{ .category = .application, .value = "application/clr" };
+ pub const @"application/clue+xml": MimeType = MimeType{ .category = .application, .value = "application/clue+xml" };
+ pub const @"application/clue_info+xml": MimeType = MimeType{ .category = .application, .value = "application/clue_info+xml" };
+ pub const @"application/cms": MimeType = MimeType{ .category = .application, .value = "application/cms" };
+ pub const @"application/cnrp+xml": MimeType = MimeType{ .category = .application, .value = "application/cnrp+xml" };
+ pub const @"application/coap-group+json": MimeType = MimeType{ .category = .application, .value = "application/coap-group+json" };
+ pub const @"application/coap-payload": MimeType = MimeType{ .category = .application, .value = "application/coap-payload" };
+ pub const @"application/commonground": MimeType = MimeType{ .category = .application, .value = "application/commonground" };
+ pub const @"application/conference-info+xml": MimeType = MimeType{ .category = .application, .value = "application/conference-info+xml" };
+ pub const @"application/cose": MimeType = MimeType{ .category = .application, .value = "application/cose" };
+ pub const @"application/cose-key": MimeType = MimeType{ .category = .application, .value = "application/cose-key" };
+ pub const @"application/cose-key-set": MimeType = MimeType{ .category = .application, .value = "application/cose-key-set" };
+ pub const @"application/cpl+xml": MimeType = MimeType{ .category = .application, .value = "application/cpl+xml" };
+ pub const @"application/csrattrs": MimeType = MimeType{ .category = .application, .value = "application/csrattrs" };
+ pub const @"application/csta+xml": MimeType = MimeType{ .category = .application, .value = "application/csta+xml" };
+ pub const @"application/cstadata+xml": MimeType = MimeType{ .category = .application, .value = "application/cstadata+xml" };
+ pub const @"application/csvm+json": MimeType = MimeType{ .category = .application, .value = "application/csvm+json" };
+ pub const @"application/cu-seeme": MimeType = MimeType{ .category = .application, .value = "application/cu-seeme" };
+ pub const @"application/cwt": MimeType = MimeType{ .category = .application, .value = "application/cwt" };
+ pub const @"application/cybercash": MimeType = MimeType{ .category = .application, .value = "application/cybercash" };
+ pub const @"application/dart": MimeType = MimeType{ .category = .application, .value = "application/dart" };
+ pub const @"application/dash+xml": MimeType = MimeType{ .category = .application, .value = "application/dash+xml" };
+ pub const @"application/dash-patch+xml": MimeType = MimeType{ .category = .application, .value = "application/dash-patch+xml" };
+ pub const @"application/dashdelta": MimeType = MimeType{ .category = .application, .value = "application/dashdelta" };
+ pub const @"application/davmount+xml": MimeType = MimeType{ .category = .application, .value = "application/davmount+xml" };
+ pub const @"application/dca-rft": MimeType = MimeType{ .category = .application, .value = "application/dca-rft" };
+ pub const @"application/dcd": MimeType = MimeType{ .category = .application, .value = "application/dcd" };
+ pub const @"application/dec-dx": MimeType = MimeType{ .category = .application, .value = "application/dec-dx" };
+ pub const @"application/dialog-info+xml": MimeType = MimeType{ .category = .application, .value = "application/dialog-info+xml" };
+ pub const @"application/dicom": MimeType = MimeType{ .category = .application, .value = "application/dicom" };
+ pub const @"application/dicom+json": MimeType = MimeType{ .category = .application, .value = "application/dicom+json" };
+ pub const @"application/dicom+xml": MimeType = MimeType{ .category = .application, .value = "application/dicom+xml" };
+ pub const @"application/dii": MimeType = MimeType{ .category = .application, .value = "application/dii" };
+ pub const @"application/dit": MimeType = MimeType{ .category = .application, .value = "application/dit" };
+ pub const @"application/dns": MimeType = MimeType{ .category = .application, .value = "application/dns" };
+ pub const @"application/dns+json": MimeType = MimeType{ .category = .application, .value = "application/dns+json" };
+ pub const @"application/dns-message": MimeType = MimeType{ .category = .application, .value = "application/dns-message" };
+ pub const @"application/docbook+xml": MimeType = MimeType{ .category = .application, .value = "application/docbook+xml" };
+ pub const @"application/dots+cbor": MimeType = MimeType{ .category = .application, .value = "application/dots+cbor" };
+ pub const @"application/dskpp+xml": MimeType = MimeType{ .category = .application, .value = "application/dskpp+xml" };
+ pub const @"application/dssc+der": MimeType = MimeType{ .category = .application, .value = "application/dssc+der" };
+ pub const @"application/dssc+xml": MimeType = MimeType{ .category = .application, .value = "application/dssc+xml" };
+ pub const @"application/dvcs": MimeType = MimeType{ .category = .application, .value = "application/dvcs" };
+ pub const @"application/ecmascript": MimeType = MimeType{ .category = .application, .value = "application/ecmascript" };
+ pub const @"application/edi-consent": MimeType = MimeType{ .category = .application, .value = "application/edi-consent" };
+ pub const @"application/edi-x12": MimeType = MimeType{ .category = .application, .value = "application/edi-x12" };
+ pub const @"application/edifact": MimeType = MimeType{ .category = .application, .value = "application/edifact" };
+ pub const @"application/efi": MimeType = MimeType{ .category = .application, .value = "application/efi" };
+ pub const @"application/elm+json": MimeType = MimeType{ .category = .application, .value = "application/elm+json" };
+ pub const @"application/elm+xml": MimeType = MimeType{ .category = .application, .value = "application/elm+xml" };
+ pub const @"application/emergencycalldata.cap+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.cap+xml" };
+ pub const @"application/emergencycalldata.comment+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.comment+xml" };
+ pub const @"application/emergencycalldata.control+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.control+xml" };
+ pub const @"application/emergencycalldata.deviceinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.deviceinfo+xml" };
+ pub const @"application/emergencycalldata.ecall.msd": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.ecall.msd" };
+ pub const @"application/emergencycalldata.providerinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.providerinfo+xml" };
+ pub const @"application/emergencycalldata.serviceinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.serviceinfo+xml" };
+ pub const @"application/emergencycalldata.subscriberinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.subscriberinfo+xml" };
+ pub const @"application/emergencycalldata.veds+xml": MimeType = MimeType{ .category = .application, .value = "application/emergencycalldata.veds+xml" };
+ pub const @"application/emma+xml": MimeType = MimeType{ .category = .application, .value = "application/emma+xml" };
+ pub const @"application/emotionml+xml": MimeType = MimeType{ .category = .application, .value = "application/emotionml+xml" };
+ pub const @"application/encaprtp": MimeType = MimeType{ .category = .application, .value = "application/encaprtp" };
+ pub const @"application/epp+xml": MimeType = MimeType{ .category = .application, .value = "application/epp+xml" };
+ pub const @"application/epub+zip": MimeType = MimeType{ .category = .application, .value = "application/epub+zip" };
+ pub const @"application/eshop": MimeType = MimeType{ .category = .application, .value = "application/eshop" };
+ pub const @"application/exi": MimeType = MimeType{ .category = .application, .value = "application/exi" };
+ pub const @"application/expect-ct-report+json": MimeType = MimeType{ .category = .application, .value = "application/expect-ct-report+json" };
+ pub const @"application/express": MimeType = MimeType{ .category = .application, .value = "application/express" };
+ pub const @"application/fastinfoset": MimeType = MimeType{ .category = .application, .value = "application/fastinfoset" };
+ pub const @"application/fastsoap": MimeType = MimeType{ .category = .application, .value = "application/fastsoap" };
+ pub const @"application/fdt+xml": MimeType = MimeType{ .category = .application, .value = "application/fdt+xml" };
+ pub const @"application/fhir+json": MimeType = MimeType{ .category = .application, .value = "application/fhir+json" };
+ pub const @"application/fhir+xml": MimeType = MimeType{ .category = .application, .value = "application/fhir+xml" };
+ pub const @"application/fido.trusted-apps+json": MimeType = MimeType{ .category = .application, .value = "application/fido.trusted-apps+json" };
+ pub const @"application/fits": MimeType = MimeType{ .category = .application, .value = "application/fits" };
+ pub const @"application/flexfec": MimeType = MimeType{ .category = .application, .value = "application/flexfec" };
+ pub const @"application/font-sfnt": MimeType = MimeType{ .category = .application, .value = "application/font-sfnt" };
+ pub const @"application/font-tdpfr": MimeType = MimeType{ .category = .application, .value = "application/font-tdpfr" };
+ pub const @"application/font-woff": MimeType = MimeType{ .category = .application, .value = "application/font-woff" };
+ pub const @"application/framework-attributes+xml": MimeType = MimeType{ .category = .application, .value = "application/framework-attributes+xml" };
+ pub const @"application/geo+json": MimeType = MimeType{ .category = .application, .value = "application/geo+json" };
+ pub const @"application/geo+json-seq": MimeType = MimeType{ .category = .application, .value = "application/geo+json-seq" };
+ pub const @"application/geopackage+sqlite3": MimeType = MimeType{ .category = .application, .value = "application/geopackage+sqlite3" };
+ pub const @"application/geoxacml+xml": MimeType = MimeType{ .category = .application, .value = "application/geoxacml+xml" };
+ pub const @"application/gltf-buffer": MimeType = MimeType{ .category = .application, .value = "application/gltf-buffer" };
+ pub const @"application/gml+xml": MimeType = MimeType{ .category = .application, .value = "application/gml+xml" };
+ pub const @"application/gpx+xml": MimeType = MimeType{ .category = .application, .value = "application/gpx+xml" };
+ pub const @"application/gxf": MimeType = MimeType{ .category = .application, .value = "application/gxf" };
+ pub const @"application/gzip": MimeType = MimeType{ .category = .application, .value = "application/gzip" };
+ pub const @"application/h224": MimeType = MimeType{ .category = .application, .value = "application/h224" };
+ pub const @"application/held+xml": MimeType = MimeType{ .category = .application, .value = "application/held+xml" };
+ pub const @"application/hjson": MimeType = MimeType{ .category = .application, .value = "application/hjson" };
+ pub const @"application/http": MimeType = MimeType{ .category = .application, .value = "application/http" };
+ pub const @"application/hyperstudio": MimeType = MimeType{ .category = .application, .value = "application/hyperstudio" };
+ pub const @"application/ibe-key-request+xml": MimeType = MimeType{ .category = .application, .value = "application/ibe-key-request+xml" };
+ pub const @"application/ibe-pkg-reply+xml": MimeType = MimeType{ .category = .application, .value = "application/ibe-pkg-reply+xml" };
+ pub const @"application/ibe-pp-data": MimeType = MimeType{ .category = .application, .value = "application/ibe-pp-data" };
+ pub const @"application/iges": MimeType = MimeType{ .category = .application, .value = "application/iges" };
+ pub const @"application/im-iscomposing+xml": MimeType = MimeType{ .category = .application, .value = "application/im-iscomposing+xml" };
+ pub const @"application/index": MimeType = MimeType{ .category = .application, .value = "application/index" };
+ pub const @"application/index.cmd": MimeType = MimeType{ .category = .application, .value = "application/index.cmd" };
+ pub const @"application/index.obj": MimeType = MimeType{ .category = .application, .value = "application/index.obj" };
+ pub const @"application/index.response": MimeType = MimeType{ .category = .application, .value = "application/index.response" };
+ pub const @"application/index.vnd": MimeType = MimeType{ .category = .application, .value = "application/index.vnd" };
+ pub const @"application/inkml+xml": MimeType = MimeType{ .category = .application, .value = "application/inkml+xml" };
+ pub const @"application/iotp": MimeType = MimeType{ .category = .application, .value = "application/iotp" };
+ pub const @"application/ipfix": MimeType = MimeType{ .category = .application, .value = "application/ipfix" };
+ pub const @"application/ipp": MimeType = MimeType{ .category = .application, .value = "application/ipp" };
+ pub const @"application/isup": MimeType = MimeType{ .category = .application, .value = "application/isup" };
+ pub const @"application/its+xml": MimeType = MimeType{ .category = .application, .value = "application/its+xml" };
+ pub const @"application/java-archive": MimeType = MimeType{ .category = .application, .value = "application/java-archive" };
+ pub const @"application/java-serialized-object": MimeType = MimeType{ .category = .application, .value = "application/java-serialized-object" };
+ pub const @"application/java-vm": MimeType = MimeType{ .category = .application, .value = "application/java-vm" };
pub const @"application/javascript" = javascript;
- pub const @"application/jf2feed+json": MimeType = MimeType{ .category = .@"application", .value = "application/jf2feed+json" };
- pub const @"application/jose": MimeType = MimeType{ .category = .@"application", .value = "application/jose" };
- pub const @"application/jose+json": MimeType = MimeType{ .category = .@"application", .value = "application/jose+json" };
- pub const @"application/jrd+json": MimeType = MimeType{ .category = .@"application", .value = "application/jrd+json" };
- pub const @"application/jscalendar+json": MimeType = MimeType{ .category = .@"application", .value = "application/jscalendar+json" };
+ pub const @"application/jf2feed+json": MimeType = MimeType{ .category = .application, .value = "application/jf2feed+json" };
+ pub const @"application/jose": MimeType = MimeType{ .category = .application, .value = "application/jose" };
+ pub const @"application/jose+json": MimeType = MimeType{ .category = .application, .value = "application/jose+json" };
+ pub const @"application/jrd+json": MimeType = MimeType{ .category = .application, .value = "application/jrd+json" };
+ pub const @"application/jscalendar+json": MimeType = MimeType{ .category = .application, .value = "application/jscalendar+json" };
pub const @"application/json" = json;
- pub const @"application/json-patch+json": MimeType = MimeType{ .category = .@"application", .value = "application/json-patch+json" };
- pub const @"application/json-seq": MimeType = MimeType{ .category = .@"application", .value = "application/json-seq" };
- pub const @"application/json5": MimeType = MimeType{ .category = .@"application", .value = "application/json5" };
- pub const @"application/jsonml+json": MimeType = MimeType{ .category = .@"application", .value = "application/jsonml+json" };
- pub const @"application/jwk+json": MimeType = MimeType{ .category = .@"application", .value = "application/jwk+json" };
- pub const @"application/jwk-set+json": MimeType = MimeType{ .category = .@"application", .value = "application/jwk-set+json" };
- pub const @"application/jwt": MimeType = MimeType{ .category = .@"application", .value = "application/jwt" };
- pub const @"application/kpml-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/kpml-request+xml" };
- pub const @"application/kpml-response+xml": MimeType = MimeType{ .category = .@"application", .value = "application/kpml-response+xml" };
- pub const @"application/ld+json": MimeType = MimeType{ .category = .@"application", .value = "application/ld+json" };
- pub const @"application/lgr+xml": MimeType = MimeType{ .category = .@"application", .value = "application/lgr+xml" };
- pub const @"application/link-format": MimeType = MimeType{ .category = .@"application", .value = "application/link-format" };
- pub const @"application/load-control+xml": MimeType = MimeType{ .category = .@"application", .value = "application/load-control+xml" };
- pub const @"application/lost+xml": MimeType = MimeType{ .category = .@"application", .value = "application/lost+xml" };
- pub const @"application/lostsync+xml": MimeType = MimeType{ .category = .@"application", .value = "application/lostsync+xml" };
- pub const @"application/lpf+zip": MimeType = MimeType{ .category = .@"application", .value = "application/lpf+zip" };
- pub const @"application/lxf": MimeType = MimeType{ .category = .@"application", .value = "application/lxf" };
- pub const @"application/mac-binhex40": MimeType = MimeType{ .category = .@"application", .value = "application/mac-binhex40" };
- pub const @"application/mac-compactpro": MimeType = MimeType{ .category = .@"application", .value = "application/mac-compactpro" };
- pub const @"application/macwriteii": MimeType = MimeType{ .category = .@"application", .value = "application/macwriteii" };
- pub const @"application/mads+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mads+xml" };
- pub const @"application/manifest+json": MimeType = MimeType{ .category = .@"application", .value = "application/manifest+json" };
- pub const @"application/marc": MimeType = MimeType{ .category = .@"application", .value = "application/marc" };
- pub const @"application/marcxml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/marcxml+xml" };
- pub const @"application/mathematica": MimeType = MimeType{ .category = .@"application", .value = "application/mathematica" };
- pub const @"application/mathml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mathml+xml" };
- pub const @"application/mathml-content+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mathml-content+xml" };
- pub const @"application/mathml-presentation+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mathml-presentation+xml" };
- pub const @"application/mbms-associated-procedure-description+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-associated-procedure-description+xml" };
- pub const @"application/mbms-deregister+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-deregister+xml" };
- pub const @"application/mbms-envelope+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-envelope+xml" };
- pub const @"application/mbms-msk+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-msk+xml" };
- pub const @"application/mbms-msk-response+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-msk-response+xml" };
- pub const @"application/mbms-protection-description+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-protection-description+xml" };
- pub const @"application/mbms-reception-report+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-reception-report+xml" };
- pub const @"application/mbms-register+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-register+xml" };
- pub const @"application/mbms-register-response+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-register-response+xml" };
- pub const @"application/mbms-schedule+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-schedule+xml" };
- pub const @"application/mbms-user-service-description+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mbms-user-service-description+xml" };
- pub const @"application/mbox": MimeType = MimeType{ .category = .@"application", .value = "application/mbox" };
- pub const @"application/media-policy-dataset+xml": MimeType = MimeType{ .category = .@"application", .value = "application/media-policy-dataset+xml" };
- pub const @"application/media_control+xml": MimeType = MimeType{ .category = .@"application", .value = "application/media_control+xml" };
- pub const @"application/mediaservercontrol+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mediaservercontrol+xml" };
- pub const @"application/merge-patch+json": MimeType = MimeType{ .category = .@"application", .value = "application/merge-patch+json" };
- pub const @"application/metalink+xml": MimeType = MimeType{ .category = .@"application", .value = "application/metalink+xml" };
- pub const @"application/metalink4+xml": MimeType = MimeType{ .category = .@"application", .value = "application/metalink4+xml" };
- pub const @"application/mets+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mets+xml" };
- pub const @"application/mf4": MimeType = MimeType{ .category = .@"application", .value = "application/mf4" };
- pub const @"application/mikey": MimeType = MimeType{ .category = .@"application", .value = "application/mikey" };
- pub const @"application/mipc": MimeType = MimeType{ .category = .@"application", .value = "application/mipc" };
- pub const @"application/missing-blocks+cbor-seq": MimeType = MimeType{ .category = .@"application", .value = "application/missing-blocks+cbor-seq" };
- pub const @"application/mmt-aei+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mmt-aei+xml" };
- pub const @"application/mmt-usd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mmt-usd+xml" };
- pub const @"application/mods+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mods+xml" };
- pub const @"application/moss-keys": MimeType = MimeType{ .category = .@"application", .value = "application/moss-keys" };
- pub const @"application/moss-signature": MimeType = MimeType{ .category = .@"application", .value = "application/moss-signature" };
- pub const @"application/mosskey-data": MimeType = MimeType{ .category = .@"application", .value = "application/mosskey-data" };
- pub const @"application/mosskey-request": MimeType = MimeType{ .category = .@"application", .value = "application/mosskey-request" };
- pub const @"application/mp21": MimeType = MimeType{ .category = .@"application", .value = "application/mp21" };
- pub const @"application/mp4": MimeType = MimeType{ .category = .@"application", .value = "application/mp4" };
- pub const @"application/mpeg4-generic": MimeType = MimeType{ .category = .@"application", .value = "application/mpeg4-generic" };
- pub const @"application/mpeg4-iod": MimeType = MimeType{ .category = .@"application", .value = "application/mpeg4-iod" };
- pub const @"application/mpeg4-iod-xmt": MimeType = MimeType{ .category = .@"application", .value = "application/mpeg4-iod-xmt" };
- pub const @"application/mrb-consumer+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mrb-consumer+xml" };
- pub const @"application/mrb-publish+xml": MimeType = MimeType{ .category = .@"application", .value = "application/mrb-publish+xml" };
- pub const @"application/msc-ivr+xml": MimeType = MimeType{ .category = .@"application", .value = "application/msc-ivr+xml" };
- pub const @"application/msc-mixer+xml": MimeType = MimeType{ .category = .@"application", .value = "application/msc-mixer+xml" };
- pub const @"application/msword": MimeType = MimeType{ .category = .@"application", .value = "application/msword" };
- pub const @"application/mud+json": MimeType = MimeType{ .category = .@"application", .value = "application/mud+json" };
- pub const @"application/multipart-core": MimeType = MimeType{ .category = .@"application", .value = "application/multipart-core" };
- pub const @"application/mxf": MimeType = MimeType{ .category = .@"application", .value = "application/mxf" };
- pub const @"application/n-quads": MimeType = MimeType{ .category = .@"application", .value = "application/n-quads" };
- pub const @"application/n-triples": MimeType = MimeType{ .category = .@"application", .value = "application/n-triples" };
- pub const @"application/nasdata": MimeType = MimeType{ .category = .@"application", .value = "application/nasdata" };
- pub const @"application/news-checkgroups": MimeType = MimeType{ .category = .@"application", .value = "application/news-checkgroups" };
- pub const @"application/news-groupinfo": MimeType = MimeType{ .category = .@"application", .value = "application/news-groupinfo" };
- pub const @"application/news-transmission": MimeType = MimeType{ .category = .@"application", .value = "application/news-transmission" };
- pub const @"application/nlsml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/nlsml+xml" };
- pub const @"application/nss": MimeType = MimeType{ .category = .@"application", .value = "application/nss" };
- pub const @"application/oauth-authz-req+jwt": MimeType = MimeType{ .category = .@"application", .value = "application/oauth-authz-req+jwt" };
- pub const @"application/oblivious-dns-message": MimeType = MimeType{ .category = .@"application", .value = "application/oblivious-dns-message" };
- pub const @"application/ocsp-request": MimeType = MimeType{ .category = .@"application", .value = "application/ocsp-request" };
- pub const @"application/ocsp-response": MimeType = MimeType{ .category = .@"application", .value = "application/ocsp-response" };
- pub const @"application/octet-stream": MimeType = MimeType{ .category = .@"application", .value = "application/octet-stream" };
- pub const @"application/oda": MimeType = MimeType{ .category = .@"application", .value = "application/oda" };
- pub const @"application/odm+xml": MimeType = MimeType{ .category = .@"application", .value = "application/odm+xml" };
- pub const @"application/odx": MimeType = MimeType{ .category = .@"application", .value = "application/odx" };
- pub const @"application/oebps-package+xml": MimeType = MimeType{ .category = .@"application", .value = "application/oebps-package+xml" };
- pub const @"application/ogg": MimeType = MimeType{ .category = .@"application", .value = "application/ogg" };
- pub const @"application/omdoc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/omdoc+xml" };
- pub const @"application/onenote": MimeType = MimeType{ .category = .@"application", .value = "application/onenote" };
- pub const @"application/opc-nodeset+xml": MimeType = MimeType{ .category = .@"application", .value = "application/opc-nodeset+xml" };
- pub const @"application/oscore": MimeType = MimeType{ .category = .@"application", .value = "application/oscore" };
- pub const @"application/oxps": MimeType = MimeType{ .category = .@"application", .value = "application/oxps" };
- pub const @"application/p21": MimeType = MimeType{ .category = .@"application", .value = "application/p21" };
- pub const @"application/p21+zip": MimeType = MimeType{ .category = .@"application", .value = "application/p21+zip" };
- pub const @"application/p2p-overlay+xml": MimeType = MimeType{ .category = .@"application", .value = "application/p2p-overlay+xml" };
- pub const @"application/parityfec": MimeType = MimeType{ .category = .@"application", .value = "application/parityfec" };
- pub const @"application/passport": MimeType = MimeType{ .category = .@"application", .value = "application/passport" };
- pub const @"application/patch-ops-error+xml": MimeType = MimeType{ .category = .@"application", .value = "application/patch-ops-error+xml" };
- pub const @"application/pdf": MimeType = MimeType{ .category = .@"application", .value = "application/pdf" };
- pub const @"application/pdx": MimeType = MimeType{ .category = .@"application", .value = "application/pdx" };
- pub const @"application/pem-certificate-chain": MimeType = MimeType{ .category = .@"application", .value = "application/pem-certificate-chain" };
- pub const @"application/pgp-encrypted": MimeType = MimeType{ .category = .@"application", .value = "application/pgp-encrypted" };
- pub const @"application/pgp-keys": MimeType = MimeType{ .category = .@"application", .value = "application/pgp-keys" };
- pub const @"application/pgp-signature": MimeType = MimeType{ .category = .@"application", .value = "application/pgp-signature" };
- pub const @"application/pics-rules": MimeType = MimeType{ .category = .@"application", .value = "application/pics-rules" };
- pub const @"application/pidf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/pidf+xml" };
- pub const @"application/pidf-diff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/pidf-diff+xml" };
- pub const @"application/pkcs10": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs10" };
- pub const @"application/pkcs12": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs12" };
- pub const @"application/pkcs7-mime": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs7-mime" };
- pub const @"application/pkcs7-signature": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs7-signature" };
- pub const @"application/pkcs8": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs8" };
- pub const @"application/pkcs8-encrypted": MimeType = MimeType{ .category = .@"application", .value = "application/pkcs8-encrypted" };
- pub const @"application/pkix-attr-cert": MimeType = MimeType{ .category = .@"application", .value = "application/pkix-attr-cert" };
- pub const @"application/pkix-cert": MimeType = MimeType{ .category = .@"application", .value = "application/pkix-cert" };
- pub const @"application/pkix-crl": MimeType = MimeType{ .category = .@"application", .value = "application/pkix-crl" };
- pub const @"application/pkix-pkipath": MimeType = MimeType{ .category = .@"application", .value = "application/pkix-pkipath" };
- pub const @"application/pkixcmp": MimeType = MimeType{ .category = .@"application", .value = "application/pkixcmp" };
- pub const @"application/pls+xml": MimeType = MimeType{ .category = .@"application", .value = "application/pls+xml" };
- pub const @"application/poc-settings+xml": MimeType = MimeType{ .category = .@"application", .value = "application/poc-settings+xml" };
- pub const @"application/postscript": MimeType = MimeType{ .category = .@"application", .value = "application/postscript" };
- pub const @"application/ppsp-tracker+json": MimeType = MimeType{ .category = .@"application", .value = "application/ppsp-tracker+json" };
- pub const @"application/problem+json": MimeType = MimeType{ .category = .@"application", .value = "application/problem+json" };
- pub const @"application/problem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/problem+xml" };
- pub const @"application/provenance+xml": MimeType = MimeType{ .category = .@"application", .value = "application/provenance+xml" };
- pub const @"application/prs.alvestrand.titrax-sheet": MimeType = MimeType{ .category = .@"application", .value = "application/prs.alvestrand.titrax-sheet" };
- pub const @"application/prs.cww": MimeType = MimeType{ .category = .@"application", .value = "application/prs.cww" };
- pub const @"application/prs.cyn": MimeType = MimeType{ .category = .@"application", .value = "application/prs.cyn" };
- pub const @"application/prs.hpub+zip": MimeType = MimeType{ .category = .@"application", .value = "application/prs.hpub+zip" };
- pub const @"application/prs.nprend": MimeType = MimeType{ .category = .@"application", .value = "application/prs.nprend" };
- pub const @"application/prs.plucker": MimeType = MimeType{ .category = .@"application", .value = "application/prs.plucker" };
- pub const @"application/prs.rdf-xml-crypt": MimeType = MimeType{ .category = .@"application", .value = "application/prs.rdf-xml-crypt" };
- pub const @"application/prs.xsf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/prs.xsf+xml" };
- pub const @"application/pskc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/pskc+xml" };
- pub const @"application/pvd+json": MimeType = MimeType{ .category = .@"application", .value = "application/pvd+json" };
- pub const @"application/qsig": MimeType = MimeType{ .category = .@"application", .value = "application/qsig" };
- pub const @"application/raml+yaml": MimeType = MimeType{ .category = .@"application", .value = "application/raml+yaml" };
- pub const @"application/raptorfec": MimeType = MimeType{ .category = .@"application", .value = "application/raptorfec" };
- pub const @"application/rdap+json": MimeType = MimeType{ .category = .@"application", .value = "application/rdap+json" };
- pub const @"application/rdf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rdf+xml" };
- pub const @"application/reginfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/reginfo+xml" };
- pub const @"application/relax-ng-compact-syntax": MimeType = MimeType{ .category = .@"application", .value = "application/relax-ng-compact-syntax" };
- pub const @"application/remote-printing": MimeType = MimeType{ .category = .@"application", .value = "application/remote-printing" };
- pub const @"application/reputon+json": MimeType = MimeType{ .category = .@"application", .value = "application/reputon+json" };
- pub const @"application/resource-lists+xml": MimeType = MimeType{ .category = .@"application", .value = "application/resource-lists+xml" };
- pub const @"application/resource-lists-diff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/resource-lists-diff+xml" };
- pub const @"application/rfc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rfc+xml" };
- pub const @"application/riscos": MimeType = MimeType{ .category = .@"application", .value = "application/riscos" };
- pub const @"application/rlmi+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rlmi+xml" };
- pub const @"application/rls-services+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rls-services+xml" };
- pub const @"application/route-apd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/route-apd+xml" };
- pub const @"application/route-s-tsid+xml": MimeType = MimeType{ .category = .@"application", .value = "application/route-s-tsid+xml" };
- pub const @"application/route-usd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/route-usd+xml" };
- pub const @"application/rpki-ghostbusters": MimeType = MimeType{ .category = .@"application", .value = "application/rpki-ghostbusters" };
- pub const @"application/rpki-manifest": MimeType = MimeType{ .category = .@"application", .value = "application/rpki-manifest" };
- pub const @"application/rpki-publication": MimeType = MimeType{ .category = .@"application", .value = "application/rpki-publication" };
- pub const @"application/rpki-roa": MimeType = MimeType{ .category = .@"application", .value = "application/rpki-roa" };
- pub const @"application/rpki-updown": MimeType = MimeType{ .category = .@"application", .value = "application/rpki-updown" };
- pub const @"application/rsd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rsd+xml" };
- pub const @"application/rss+xml": MimeType = MimeType{ .category = .@"application", .value = "application/rss+xml" };
- pub const @"application/rtf": MimeType = MimeType{ .category = .@"application", .value = "application/rtf" };
- pub const @"application/rtploopback": MimeType = MimeType{ .category = .@"application", .value = "application/rtploopback" };
- pub const @"application/rtx": MimeType = MimeType{ .category = .@"application", .value = "application/rtx" };
- pub const @"application/samlassertion+xml": MimeType = MimeType{ .category = .@"application", .value = "application/samlassertion+xml" };
- pub const @"application/samlmetadata+xml": MimeType = MimeType{ .category = .@"application", .value = "application/samlmetadata+xml" };
- pub const @"application/sarif+json": MimeType = MimeType{ .category = .@"application", .value = "application/sarif+json" };
- pub const @"application/sarif-external-properties+json": MimeType = MimeType{ .category = .@"application", .value = "application/sarif-external-properties+json" };
- pub const @"application/sbe": MimeType = MimeType{ .category = .@"application", .value = "application/sbe" };
- pub const @"application/sbml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/sbml+xml" };
- pub const @"application/scaip+xml": MimeType = MimeType{ .category = .@"application", .value = "application/scaip+xml" };
- pub const @"application/scim+json": MimeType = MimeType{ .category = .@"application", .value = "application/scim+json" };
- pub const @"application/scvp-cv-request": MimeType = MimeType{ .category = .@"application", .value = "application/scvp-cv-request" };
- pub const @"application/scvp-cv-response": MimeType = MimeType{ .category = .@"application", .value = "application/scvp-cv-response" };
- pub const @"application/scvp-vp-request": MimeType = MimeType{ .category = .@"application", .value = "application/scvp-vp-request" };
- pub const @"application/scvp-vp-response": MimeType = MimeType{ .category = .@"application", .value = "application/scvp-vp-response" };
- pub const @"application/sdp": MimeType = MimeType{ .category = .@"application", .value = "application/sdp" };
- pub const @"application/secevent+jwt": MimeType = MimeType{ .category = .@"application", .value = "application/secevent+jwt" };
- pub const @"application/senml+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/senml+cbor" };
- pub const @"application/senml+json": MimeType = MimeType{ .category = .@"application", .value = "application/senml+json" };
- pub const @"application/senml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/senml+xml" };
- pub const @"application/senml-etch+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/senml-etch+cbor" };
- pub const @"application/senml-etch+json": MimeType = MimeType{ .category = .@"application", .value = "application/senml-etch+json" };
- pub const @"application/senml-exi": MimeType = MimeType{ .category = .@"application", .value = "application/senml-exi" };
- pub const @"application/sensml+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/sensml+cbor" };
- pub const @"application/sensml+json": MimeType = MimeType{ .category = .@"application", .value = "application/sensml+json" };
- pub const @"application/sensml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/sensml+xml" };
- pub const @"application/sensml-exi": MimeType = MimeType{ .category = .@"application", .value = "application/sensml-exi" };
- pub const @"application/sep+xml": MimeType = MimeType{ .category = .@"application", .value = "application/sep+xml" };
- pub const @"application/sep-exi": MimeType = MimeType{ .category = .@"application", .value = "application/sep-exi" };
- pub const @"application/session-info": MimeType = MimeType{ .category = .@"application", .value = "application/session-info" };
- pub const @"application/set-payment": MimeType = MimeType{ .category = .@"application", .value = "application/set-payment" };
- pub const @"application/set-payment-initiation": MimeType = MimeType{ .category = .@"application", .value = "application/set-payment-initiation" };
- pub const @"application/set-registration": MimeType = MimeType{ .category = .@"application", .value = "application/set-registration" };
- pub const @"application/set-registration-initiation": MimeType = MimeType{ .category = .@"application", .value = "application/set-registration-initiation" };
- pub const @"application/sgml": MimeType = MimeType{ .category = .@"application", .value = "application/sgml" };
- pub const @"application/sgml-open-catalog": MimeType = MimeType{ .category = .@"application", .value = "application/sgml-open-catalog" };
- pub const @"application/shf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/shf+xml" };
- pub const @"application/sieve": MimeType = MimeType{ .category = .@"application", .value = "application/sieve" };
- pub const @"application/simple-filter+xml": MimeType = MimeType{ .category = .@"application", .value = "application/simple-filter+xml" };
- pub const @"application/simple-message-summary": MimeType = MimeType{ .category = .@"application", .value = "application/simple-message-summary" };
- pub const @"application/simplesymbolcontainer": MimeType = MimeType{ .category = .@"application", .value = "application/simplesymbolcontainer" };
- pub const @"application/sipc": MimeType = MimeType{ .category = .@"application", .value = "application/sipc" };
- pub const @"application/slate": MimeType = MimeType{ .category = .@"application", .value = "application/slate" };
- pub const @"application/smil": MimeType = MimeType{ .category = .@"application", .value = "application/smil" };
- pub const @"application/smil+xml": MimeType = MimeType{ .category = .@"application", .value = "application/smil+xml" };
- pub const @"application/smpte336m": MimeType = MimeType{ .category = .@"application", .value = "application/smpte336m" };
- pub const @"application/soap+fastinfoset": MimeType = MimeType{ .category = .@"application", .value = "application/soap+fastinfoset" };
- pub const @"application/soap+xml": MimeType = MimeType{ .category = .@"application", .value = "application/soap+xml" };
- pub const @"application/sparql-query": MimeType = MimeType{ .category = .@"application", .value = "application/sparql-query" };
- pub const @"application/sparql-results+xml": MimeType = MimeType{ .category = .@"application", .value = "application/sparql-results+xml" };
- pub const @"application/spdx+json": MimeType = MimeType{ .category = .@"application", .value = "application/spdx+json" };
- pub const @"application/spirits-event+xml": MimeType = MimeType{ .category = .@"application", .value = "application/spirits-event+xml" };
- pub const @"application/sql": MimeType = MimeType{ .category = .@"application", .value = "application/sql" };
- pub const @"application/srgs": MimeType = MimeType{ .category = .@"application", .value = "application/srgs" };
- pub const @"application/srgs+xml": MimeType = MimeType{ .category = .@"application", .value = "application/srgs+xml" };
- pub const @"application/sru+xml": MimeType = MimeType{ .category = .@"application", .value = "application/sru+xml" };
- pub const @"application/ssdl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ssdl+xml" };
- pub const @"application/ssml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ssml+xml" };
- pub const @"application/stix+json": MimeType = MimeType{ .category = .@"application", .value = "application/stix+json" };
- pub const @"application/swid+xml": MimeType = MimeType{ .category = .@"application", .value = "application/swid+xml" };
- pub const @"application/tamp-apex-update": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-apex-update" };
- pub const @"application/tamp-apex-update-confirm": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-apex-update-confirm" };
- pub const @"application/tamp-community-update": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-community-update" };
- pub const @"application/tamp-community-update-confirm": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-community-update-confirm" };
- pub const @"application/tamp-error": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-error" };
- pub const @"application/tamp-sequence-adjust": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-sequence-adjust" };
- pub const @"application/tamp-sequence-adjust-confirm": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-sequence-adjust-confirm" };
- pub const @"application/tamp-status-query": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-status-query" };
- pub const @"application/tamp-status-response": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-status-response" };
- pub const @"application/tamp-update": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-update" };
- pub const @"application/tamp-update-confirm": MimeType = MimeType{ .category = .@"application", .value = "application/tamp-update-confirm" };
- pub const @"application/tar": MimeType = MimeType{ .category = .@"application", .value = "application/tar" };
- pub const @"application/taxii+json": MimeType = MimeType{ .category = .@"application", .value = "application/taxii+json" };
- pub const @"application/td+json": MimeType = MimeType{ .category = .@"application", .value = "application/td+json" };
- pub const @"application/tei+xml": MimeType = MimeType{ .category = .@"application", .value = "application/tei+xml" };
- pub const @"application/tetra_isi": MimeType = MimeType{ .category = .@"application", .value = "application/tetra_isi" };
- pub const @"application/thraud+xml": MimeType = MimeType{ .category = .@"application", .value = "application/thraud+xml" };
- pub const @"application/timestamp-query": MimeType = MimeType{ .category = .@"application", .value = "application/timestamp-query" };
- pub const @"application/timestamp-reply": MimeType = MimeType{ .category = .@"application", .value = "application/timestamp-reply" };
- pub const @"application/timestamped-data": MimeType = MimeType{ .category = .@"application", .value = "application/timestamped-data" };
- pub const @"application/tlsrpt+gzip": MimeType = MimeType{ .category = .@"application", .value = "application/tlsrpt+gzip" };
- pub const @"application/tlsrpt+json": MimeType = MimeType{ .category = .@"application", .value = "application/tlsrpt+json" };
- pub const @"application/tnauthlist": MimeType = MimeType{ .category = .@"application", .value = "application/tnauthlist" };
- pub const @"application/token-introspection+jwt": MimeType = MimeType{ .category = .@"application", .value = "application/token-introspection+jwt" };
- pub const @"application/toml": MimeType = MimeType{ .category = .@"application", .value = "application/toml" };
- pub const @"application/trickle-ice-sdpfrag": MimeType = MimeType{ .category = .@"application", .value = "application/trickle-ice-sdpfrag" };
- pub const @"application/trig": MimeType = MimeType{ .category = .@"application", .value = "application/trig" };
- pub const @"application/ttml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/ttml+xml" };
- pub const @"application/tve-trigger": MimeType = MimeType{ .category = .@"application", .value = "application/tve-trigger" };
- pub const @"application/tzif": MimeType = MimeType{ .category = .@"application", .value = "application/tzif" };
- pub const @"application/tzif-leap": MimeType = MimeType{ .category = .@"application", .value = "application/tzif-leap" };
- pub const @"application/ubjson": MimeType = MimeType{ .category = .@"application", .value = "application/ubjson" };
- pub const @"application/ulpfec": MimeType = MimeType{ .category = .@"application", .value = "application/ulpfec" };
- pub const @"application/urc-grpsheet+xml": MimeType = MimeType{ .category = .@"application", .value = "application/urc-grpsheet+xml" };
- pub const @"application/urc-ressheet+xml": MimeType = MimeType{ .category = .@"application", .value = "application/urc-ressheet+xml" };
- pub const @"application/urc-targetdesc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/urc-targetdesc+xml" };
- pub const @"application/urc-uisocketdesc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/urc-uisocketdesc+xml" };
- pub const @"application/vcard+json": MimeType = MimeType{ .category = .@"application", .value = "application/vcard+json" };
- pub const @"application/vcard+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vcard+xml" };
- pub const @"application/vemmi": MimeType = MimeType{ .category = .@"application", .value = "application/vemmi" };
- pub const @"application/vividence.scriptfile": MimeType = MimeType{ .category = .@"application", .value = "application/vividence.scriptfile" };
- pub const @"application/vnd.1000minds.decision-model+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.1000minds.decision-model+xml" };
- pub const @"application/vnd.3gpp-prose+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp-prose+xml" };
- pub const @"application/vnd.3gpp-prose-pc3ch+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp-prose-pc3ch+xml" };
- pub const @"application/vnd.3gpp-v2x-local-service-information": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp-v2x-local-service-information" };
- pub const @"application/vnd.3gpp.5gnas": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.5gnas" };
- pub const @"application/vnd.3gpp.access-transfer-events+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.access-transfer-events+xml" };
- pub const @"application/vnd.3gpp.bsf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.bsf+xml" };
- pub const @"application/vnd.3gpp.gmop+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.gmop+xml" };
- pub const @"application/vnd.3gpp.gtpc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.gtpc" };
- pub const @"application/vnd.3gpp.interworking-data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.interworking-data" };
- pub const @"application/vnd.3gpp.lpp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.lpp" };
- pub const @"application/vnd.3gpp.mc-signalling-ear": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mc-signalling-ear" };
- pub const @"application/vnd.3gpp.mcdata-affiliation-command+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-affiliation-command+xml" };
- pub const @"application/vnd.3gpp.mcdata-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-info+xml" };
- pub const @"application/vnd.3gpp.mcdata-payload": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-payload" };
- pub const @"application/vnd.3gpp.mcdata-service-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-service-config+xml" };
- pub const @"application/vnd.3gpp.mcdata-signalling": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-signalling" };
- pub const @"application/vnd.3gpp.mcdata-ue-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-ue-config+xml" };
- pub const @"application/vnd.3gpp.mcdata-user-profile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcdata-user-profile+xml" };
- pub const @"application/vnd.3gpp.mcptt-affiliation-command+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-affiliation-command+xml" };
- pub const @"application/vnd.3gpp.mcptt-floor-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-floor-request+xml" };
- pub const @"application/vnd.3gpp.mcptt-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-info+xml" };
- pub const @"application/vnd.3gpp.mcptt-location-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-location-info+xml" };
- pub const @"application/vnd.3gpp.mcptt-mbms-usage-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-mbms-usage-info+xml" };
- pub const @"application/vnd.3gpp.mcptt-service-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-service-config+xml" };
- pub const @"application/vnd.3gpp.mcptt-signed+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-signed+xml" };
- pub const @"application/vnd.3gpp.mcptt-ue-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-ue-config+xml" };
- pub const @"application/vnd.3gpp.mcptt-ue-init-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-ue-init-config+xml" };
- pub const @"application/vnd.3gpp.mcptt-user-profile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcptt-user-profile+xml" };
- pub const @"application/vnd.3gpp.mcvideo-affiliation-command+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-affiliation-command+xml" };
- pub const @"application/vnd.3gpp.mcvideo-affiliation-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-affiliation-info+xml" };
- pub const @"application/vnd.3gpp.mcvideo-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-info+xml" };
- pub const @"application/vnd.3gpp.mcvideo-location-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-location-info+xml" };
- pub const @"application/vnd.3gpp.mcvideo-mbms-usage-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-mbms-usage-info+xml" };
- pub const @"application/vnd.3gpp.mcvideo-service-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-service-config+xml" };
- pub const @"application/vnd.3gpp.mcvideo-transmission-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-transmission-request+xml" };
- pub const @"application/vnd.3gpp.mcvideo-ue-config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-ue-config+xml" };
- pub const @"application/vnd.3gpp.mcvideo-user-profile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mcvideo-user-profile+xml" };
- pub const @"application/vnd.3gpp.mid-call+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.mid-call+xml" };
- pub const @"application/vnd.3gpp.ngap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.ngap" };
- pub const @"application/vnd.3gpp.pfcp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.pfcp" };
- pub const @"application/vnd.3gpp.pic-bw-large": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.pic-bw-large" };
- pub const @"application/vnd.3gpp.pic-bw-small": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.pic-bw-small" };
- pub const @"application/vnd.3gpp.pic-bw-var": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.pic-bw-var" };
- pub const @"application/vnd.3gpp.s1ap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.s1ap" };
- pub const @"application/vnd.3gpp.sms": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.sms" };
- pub const @"application/vnd.3gpp.sms+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.sms+xml" };
- pub const @"application/vnd.3gpp.srvcc-ext+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.srvcc-ext+xml" };
- pub const @"application/vnd.3gpp.srvcc-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.srvcc-info+xml" };
- pub const @"application/vnd.3gpp.state-and-event-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.state-and-event-info+xml" };
- pub const @"application/vnd.3gpp.ussd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp.ussd+xml" };
- pub const @"application/vnd.3gpp2.bcmcsinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp2.bcmcsinfo+xml" };
- pub const @"application/vnd.3gpp2.sms": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp2.sms" };
- pub const @"application/vnd.3gpp2.tcap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3gpp2.tcap" };
- pub const @"application/vnd.3lightssoftware.imagescal": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3lightssoftware.imagescal" };
- pub const @"application/vnd.3m.post-it-notes": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.3m.post-it-notes" };
- pub const @"application/vnd.accpac.simply.aso": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.accpac.simply.aso" };
- pub const @"application/vnd.accpac.simply.imp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.accpac.simply.imp" };
- pub const @"application/vnd.acucobol": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.acucobol" };
- pub const @"application/vnd.acucorp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.acucorp" };
- pub const @"application/vnd.adobe.air-application-installer-package+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.air-application-installer-package+zip" };
- pub const @"application/vnd.adobe.flash.movie": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.flash.movie" };
- pub const @"application/vnd.adobe.formscentral.fcdt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.formscentral.fcdt" };
- pub const @"application/vnd.adobe.fxp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.fxp" };
- pub const @"application/vnd.adobe.partial-upload": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.partial-upload" };
- pub const @"application/vnd.adobe.xdp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.xdp+xml" };
- pub const @"application/vnd.adobe.xfdf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.adobe.xfdf" };
- pub const @"application/vnd.aether.imp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.aether.imp" };
- pub const @"application/vnd.afpc.afplinedata": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.afplinedata" };
- pub const @"application/vnd.afpc.afplinedata-pagedef": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.afplinedata-pagedef" };
- pub const @"application/vnd.afpc.cmoca-cmresource": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.cmoca-cmresource" };
- pub const @"application/vnd.afpc.foca-charset": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.foca-charset" };
- pub const @"application/vnd.afpc.foca-codedfont": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.foca-codedfont" };
- pub const @"application/vnd.afpc.foca-codepage": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.foca-codepage" };
- pub const @"application/vnd.afpc.modca": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca" };
- pub const @"application/vnd.afpc.modca-cmtable": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-cmtable" };
- pub const @"application/vnd.afpc.modca-formdef": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-formdef" };
- pub const @"application/vnd.afpc.modca-mediummap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-mediummap" };
- pub const @"application/vnd.afpc.modca-objectcontainer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-objectcontainer" };
- pub const @"application/vnd.afpc.modca-overlay": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-overlay" };
- pub const @"application/vnd.afpc.modca-pagesegment": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.afpc.modca-pagesegment" };
- pub const @"application/vnd.age": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.age" };
- pub const @"application/vnd.ah-barcode": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ah-barcode" };
- pub const @"application/vnd.ahead.space": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ahead.space" };
- pub const @"application/vnd.airzip.filesecure.azf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.airzip.filesecure.azf" };
- pub const @"application/vnd.airzip.filesecure.azs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.airzip.filesecure.azs" };
- pub const @"application/vnd.amadeus+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.amadeus+json" };
- pub const @"application/vnd.amazon.ebook": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.amazon.ebook" };
- pub const @"application/vnd.amazon.mobi8-ebook": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.amazon.mobi8-ebook" };
- pub const @"application/vnd.americandynamics.acc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.americandynamics.acc" };
- pub const @"application/vnd.amiga.ami": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.amiga.ami" };
- pub const @"application/vnd.amundsen.maze+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.amundsen.maze+xml" };
- pub const @"application/vnd.android.ota": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.android.ota" };
- pub const @"application/vnd.android.package-archive": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.android.package-archive" };
- pub const @"application/vnd.anki": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.anki" };
- pub const @"application/vnd.anser-web-certificate-issue-initiation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.anser-web-certificate-issue-initiation" };
- pub const @"application/vnd.anser-web-funds-transfer-initiation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.anser-web-funds-transfer-initiation" };
- pub const @"application/vnd.antix.game-component": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.antix.game-component" };
- pub const @"application/vnd.apache.arrow.file": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apache.arrow.file" };
- pub const @"application/vnd.apache.arrow.stream": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apache.arrow.stream" };
- pub const @"application/vnd.apache.thrift.binary": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apache.thrift.binary" };
- pub const @"application/vnd.apache.thrift.compact": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apache.thrift.compact" };
- pub const @"application/vnd.apache.thrift.json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apache.thrift.json" };
- pub const @"application/vnd.api+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.api+json" };
- pub const @"application/vnd.aplextor.warrp+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.aplextor.warrp+json" };
- pub const @"application/vnd.apothekende.reservation+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apothekende.reservation+json" };
- pub const @"application/vnd.apple.installer+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.installer+xml" };
- pub const @"application/vnd.apple.keynote": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.keynote" };
- pub const @"application/vnd.apple.mpegurl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.mpegurl" };
- pub const @"application/vnd.apple.numbers": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.numbers" };
- pub const @"application/vnd.apple.pages": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.pages" };
- pub const @"application/vnd.apple.pkpass": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.apple.pkpass" };
- pub const @"application/vnd.arastra.swi": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.arastra.swi" };
- pub const @"application/vnd.aristanetworks.swi": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.aristanetworks.swi" };
- pub const @"application/vnd.artisan+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.artisan+json" };
- pub const @"application/vnd.artsquare": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.artsquare" };
- pub const @"application/vnd.astraea-software.iota": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.astraea-software.iota" };
- pub const @"application/vnd.audiograph": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.audiograph" };
- pub const @"application/vnd.autopackage": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.autopackage" };
- pub const @"application/vnd.avalon+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.avalon+json" };
- pub const @"application/vnd.avistar+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.avistar+xml" };
- pub const @"application/vnd.balsamiq.bmml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.balsamiq.bmml+xml" };
- pub const @"application/vnd.balsamiq.bmpr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.balsamiq.bmpr" };
- pub const @"application/vnd.banana-accounting": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.banana-accounting" };
- pub const @"application/vnd.bbf.usp.error": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bbf.usp.error" };
- pub const @"application/vnd.bbf.usp.msg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bbf.usp.msg" };
- pub const @"application/vnd.bbf.usp.msg+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bbf.usp.msg+json" };
- pub const @"application/vnd.bekitzur-stech+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bekitzur-stech+json" };
- pub const @"application/vnd.bint.med-content": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bint.med-content" };
- pub const @"application/vnd.biopax.rdf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.biopax.rdf+xml" };
- pub const @"application/vnd.blink-idb-value-wrapper": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.blink-idb-value-wrapper" };
- pub const @"application/vnd.blueice.multipass": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.blueice.multipass" };
- pub const @"application/vnd.bluetooth.ep.oob": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bluetooth.ep.oob" };
- pub const @"application/vnd.bluetooth.le.oob": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bluetooth.le.oob" };
- pub const @"application/vnd.bmi": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bmi" };
- pub const @"application/vnd.bpf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bpf" };
- pub const @"application/vnd.bpf3": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.bpf3" };
- pub const @"application/vnd.businessobjects": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.businessobjects" };
- pub const @"application/vnd.byu.uapi+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.byu.uapi+json" };
- pub const @"application/vnd.cab-jscript": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cab-jscript" };
- pub const @"application/vnd.canon-cpdl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.canon-cpdl" };
- pub const @"application/vnd.canon-lips": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.canon-lips" };
- pub const @"application/vnd.capasystems-pg+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.capasystems-pg+json" };
- pub const @"application/vnd.cendio.thinlinc.clientconf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cendio.thinlinc.clientconf" };
- pub const @"application/vnd.century-systems.tcp_stream": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.century-systems.tcp_stream" };
- pub const @"application/vnd.chemdraw+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.chemdraw+xml" };
- pub const @"application/vnd.chess-pgn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.chess-pgn" };
- pub const @"application/vnd.chipnuts.karaoke-mmd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.chipnuts.karaoke-mmd" };
- pub const @"application/vnd.ciedi": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ciedi" };
- pub const @"application/vnd.cinderella": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cinderella" };
- pub const @"application/vnd.cirpack.isdn-ext": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cirpack.isdn-ext" };
- pub const @"application/vnd.citationstyles.style+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.citationstyles.style+xml" };
- pub const @"application/vnd.claymore": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.claymore" };
- pub const @"application/vnd.cloanto.rp9": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cloanto.rp9" };
- pub const @"application/vnd.clonk.c4group": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.clonk.c4group" };
- pub const @"application/vnd.cluetrust.cartomobile-config": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cluetrust.cartomobile-config" };
- pub const @"application/vnd.cluetrust.cartomobile-config-pkg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cluetrust.cartomobile-config-pkg" };
- pub const @"application/vnd.coffeescript": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.coffeescript" };
- pub const @"application/vnd.collabio.xodocuments.document": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.document" };
- pub const @"application/vnd.collabio.xodocuments.document-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.document-template" };
- pub const @"application/vnd.collabio.xodocuments.presentation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.presentation" };
- pub const @"application/vnd.collabio.xodocuments.presentation-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.presentation-template" };
- pub const @"application/vnd.collabio.xodocuments.spreadsheet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.spreadsheet" };
- pub const @"application/vnd.collabio.xodocuments.spreadsheet-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collabio.xodocuments.spreadsheet-template" };
- pub const @"application/vnd.collection+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collection+json" };
- pub const @"application/vnd.collection.doc+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collection.doc+json" };
- pub const @"application/vnd.collection.next+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.collection.next+json" };
- pub const @"application/vnd.comicbook+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.comicbook+zip" };
- pub const @"application/vnd.comicbook-rar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.comicbook-rar" };
- pub const @"application/vnd.commerce-battelle": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.commerce-battelle" };
- pub const @"application/vnd.commonspace": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.commonspace" };
- pub const @"application/vnd.contact.cmsg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.contact.cmsg" };
- pub const @"application/vnd.coreos.ignition+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.coreos.ignition+json" };
- pub const @"application/vnd.cosmocaller": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cosmocaller" };
- pub const @"application/vnd.crick.clicker": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crick.clicker" };
- pub const @"application/vnd.crick.clicker.keyboard": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crick.clicker.keyboard" };
- pub const @"application/vnd.crick.clicker.palette": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crick.clicker.palette" };
- pub const @"application/vnd.crick.clicker.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crick.clicker.template" };
- pub const @"application/vnd.crick.clicker.wordbank": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crick.clicker.wordbank" };
- pub const @"application/vnd.criticaltools.wbs+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.criticaltools.wbs+xml" };
- pub const @"application/vnd.cryptii.pipe+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cryptii.pipe+json" };
- pub const @"application/vnd.crypto-shade-file": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.crypto-shade-file" };
- pub const @"application/vnd.cryptomator.encrypted": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cryptomator.encrypted" };
- pub const @"application/vnd.cryptomator.vault": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cryptomator.vault" };
- pub const @"application/vnd.ctc-posml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ctc-posml" };
- pub const @"application/vnd.ctct.ws+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ctct.ws+xml" };
- pub const @"application/vnd.cups-pdf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cups-pdf" };
- pub const @"application/vnd.cups-postscript": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cups-postscript" };
- pub const @"application/vnd.cups-ppd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cups-ppd" };
- pub const @"application/vnd.cups-raster": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cups-raster" };
- pub const @"application/vnd.cups-raw": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cups-raw" };
- pub const @"application/vnd.curl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.curl" };
- pub const @"application/vnd.curl.car": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.curl.car" };
- pub const @"application/vnd.curl.pcurl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.curl.pcurl" };
- pub const @"application/vnd.cyan.dean.root+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cyan.dean.root+xml" };
- pub const @"application/vnd.cybank": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cybank" };
- pub const @"application/vnd.cyclonedx+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cyclonedx+json" };
- pub const @"application/vnd.cyclonedx+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.cyclonedx+xml" };
- pub const @"application/vnd.d2l.coursepackage1p0+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.d2l.coursepackage1p0+zip" };
- pub const @"application/vnd.d3m-dataset": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.d3m-dataset" };
- pub const @"application/vnd.d3m-problem": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.d3m-problem" };
- pub const @"application/vnd.dart": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dart" };
- pub const @"application/vnd.data-vision.rdz": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.data-vision.rdz" };
- pub const @"application/vnd.datapackage+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.datapackage+json" };
- pub const @"application/vnd.dataresource+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dataresource+json" };
- pub const @"application/vnd.dbf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dbf" };
- pub const @"application/vnd.debian.binary-package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.debian.binary-package" };
- pub const @"application/vnd.dece.data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dece.data" };
- pub const @"application/vnd.dece.ttml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dece.ttml+xml" };
- pub const @"application/vnd.dece.unspecified": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dece.unspecified" };
- pub const @"application/vnd.dece.zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dece.zip" };
- pub const @"application/vnd.denovo.fcselayout-link": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.denovo.fcselayout-link" };
- pub const @"application/vnd.desmume.movie": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.desmume.movie" };
- pub const @"application/vnd.dir-bi.plate-dl-nosuffix": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dir-bi.plate-dl-nosuffix" };
- pub const @"application/vnd.dm.delegation+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dm.delegation+xml" };
- pub const @"application/vnd.dna": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dna" };
- pub const @"application/vnd.document+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.document+json" };
- pub const @"application/vnd.dolby.mlp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dolby.mlp" };
- pub const @"application/vnd.dolby.mobile.1": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dolby.mobile.1" };
- pub const @"application/vnd.dolby.mobile.2": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dolby.mobile.2" };
- pub const @"application/vnd.doremir.scorecloud-binary-document": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.doremir.scorecloud-binary-document" };
- pub const @"application/vnd.dpgraph": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dpgraph" };
- pub const @"application/vnd.dreamfactory": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dreamfactory" };
- pub const @"application/vnd.drive+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.drive+json" };
- pub const @"application/vnd.ds-keypoint": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ds-keypoint" };
- pub const @"application/vnd.dtg.local": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dtg.local" };
- pub const @"application/vnd.dtg.local.flash": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dtg.local.flash" };
- pub const @"application/vnd.dtg.local.html": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dtg.local.html" };
- pub const @"application/vnd.dvb.ait": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ait" };
- pub const @"application/vnd.dvb.dvbisl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.dvbisl+xml" };
- pub const @"application/vnd.dvb.dvbj": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.dvbj" };
- pub const @"application/vnd.dvb.esgcontainer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.esgcontainer" };
- pub const @"application/vnd.dvb.ipdcdftnotifaccess": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ipdcdftnotifaccess" };
- pub const @"application/vnd.dvb.ipdcesgaccess": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ipdcesgaccess" };
- pub const @"application/vnd.dvb.ipdcesgaccess2": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ipdcesgaccess2" };
- pub const @"application/vnd.dvb.ipdcesgpdd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ipdcesgpdd" };
- pub const @"application/vnd.dvb.ipdcroaming": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.ipdcroaming" };
- pub const @"application/vnd.dvb.iptv.alfec-base": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.iptv.alfec-base" };
- pub const @"application/vnd.dvb.iptv.alfec-enhancement": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.iptv.alfec-enhancement" };
- pub const @"application/vnd.dvb.notif-aggregate-root+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-aggregate-root+xml" };
- pub const @"application/vnd.dvb.notif-container+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-container+xml" };
- pub const @"application/vnd.dvb.notif-generic+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-generic+xml" };
- pub const @"application/vnd.dvb.notif-ia-msglist+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-ia-msglist+xml" };
- pub const @"application/vnd.dvb.notif-ia-registration-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-ia-registration-request+xml" };
- pub const @"application/vnd.dvb.notif-ia-registration-response+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-ia-registration-response+xml" };
- pub const @"application/vnd.dvb.notif-init+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.notif-init+xml" };
- pub const @"application/vnd.dvb.pfr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.pfr" };
- pub const @"application/vnd.dvb.service": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dvb.service" };
- pub const @"application/vnd.dxr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dxr" };
- pub const @"application/vnd.dynageo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dynageo" };
- pub const @"application/vnd.dzr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.dzr" };
- pub const @"application/vnd.easykaraoke.cdgdownload": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.easykaraoke.cdgdownload" };
- pub const @"application/vnd.ecdis-update": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecdis-update" };
- pub const @"application/vnd.ecip.rlp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecip.rlp" };
- pub const @"application/vnd.eclipse.ditto+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.eclipse.ditto+json" };
- pub const @"application/vnd.ecowin.chart": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.chart" };
- pub const @"application/vnd.ecowin.filerequest": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.filerequest" };
- pub const @"application/vnd.ecowin.fileupdate": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.fileupdate" };
- pub const @"application/vnd.ecowin.series": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.series" };
- pub const @"application/vnd.ecowin.seriesrequest": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.seriesrequest" };
- pub const @"application/vnd.ecowin.seriesupdate": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ecowin.seriesupdate" };
- pub const @"application/vnd.efi.img": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.efi.img" };
- pub const @"application/vnd.efi.iso": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.efi.iso" };
- pub const @"application/vnd.emclient.accessrequest+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.emclient.accessrequest+xml" };
- pub const @"application/vnd.enliven": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.enliven" };
- pub const @"application/vnd.enphase.envoy": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.enphase.envoy" };
- pub const @"application/vnd.eprints.data+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.eprints.data+xml" };
- pub const @"application/vnd.epson.esf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.epson.esf" };
- pub const @"application/vnd.epson.msf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.epson.msf" };
- pub const @"application/vnd.epson.quickanime": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.epson.quickanime" };
- pub const @"application/vnd.epson.salt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.epson.salt" };
- pub const @"application/vnd.epson.ssf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.epson.ssf" };
- pub const @"application/vnd.ericsson.quickcall": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ericsson.quickcall" };
- pub const @"application/vnd.espass-espass+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.espass-espass+zip" };
- pub const @"application/vnd.eszigno3+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.eszigno3+xml" };
- pub const @"application/vnd.etsi.aoc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.aoc+xml" };
- pub const @"application/vnd.etsi.asic-e+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.asic-e+zip" };
- pub const @"application/vnd.etsi.asic-s+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.asic-s+zip" };
- pub const @"application/vnd.etsi.cug+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.cug+xml" };
- pub const @"application/vnd.etsi.iptvcommand+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvcommand+xml" };
- pub const @"application/vnd.etsi.iptvdiscovery+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvdiscovery+xml" };
- pub const @"application/vnd.etsi.iptvprofile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvprofile+xml" };
- pub const @"application/vnd.etsi.iptvsad-bc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvsad-bc+xml" };
- pub const @"application/vnd.etsi.iptvsad-cod+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvsad-cod+xml" };
- pub const @"application/vnd.etsi.iptvsad-npvr+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvsad-npvr+xml" };
- pub const @"application/vnd.etsi.iptvservice+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvservice+xml" };
- pub const @"application/vnd.etsi.iptvsync+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvsync+xml" };
- pub const @"application/vnd.etsi.iptvueprofile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.iptvueprofile+xml" };
- pub const @"application/vnd.etsi.mcid+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.mcid+xml" };
- pub const @"application/vnd.etsi.mheg5": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.mheg5" };
- pub const @"application/vnd.etsi.overload-control-policy-dataset+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.overload-control-policy-dataset+xml" };
- pub const @"application/vnd.etsi.pstn+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.pstn+xml" };
- pub const @"application/vnd.etsi.sci+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.sci+xml" };
- pub const @"application/vnd.etsi.simservs+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.simservs+xml" };
- pub const @"application/vnd.etsi.timestamp-token": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.timestamp-token" };
- pub const @"application/vnd.etsi.tsl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.tsl+xml" };
- pub const @"application/vnd.etsi.tsl.der": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.etsi.tsl.der" };
- pub const @"application/vnd.eu.kasparian.car+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.eu.kasparian.car+json" };
- pub const @"application/vnd.eudora.data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.eudora.data" };
- pub const @"application/vnd.evolv.ecig.profile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.evolv.ecig.profile" };
- pub const @"application/vnd.evolv.ecig.settings": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.evolv.ecig.settings" };
- pub const @"application/vnd.evolv.ecig.theme": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.evolv.ecig.theme" };
- pub const @"application/vnd.exstream-empower+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.exstream-empower+zip" };
- pub const @"application/vnd.exstream-package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.exstream-package" };
- pub const @"application/vnd.ezpix-album": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ezpix-album" };
- pub const @"application/vnd.ezpix-package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ezpix-package" };
- pub const @"application/vnd.f-secure.mobile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.f-secure.mobile" };
- pub const @"application/vnd.familysearch.gedcom+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.familysearch.gedcom+zip" };
- pub const @"application/vnd.fastcopy-disk-image": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fastcopy-disk-image" };
- pub const @"application/vnd.fdf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fdf" };
- pub const @"application/vnd.fdsn.mseed": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fdsn.mseed" };
- pub const @"application/vnd.fdsn.seed": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fdsn.seed" };
- pub const @"application/vnd.ffsns": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ffsns" };
- pub const @"application/vnd.ficlab.flb+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ficlab.flb+zip" };
- pub const @"application/vnd.filmit.zfc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.filmit.zfc" };
- pub const @"application/vnd.fints": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fints" };
- pub const @"application/vnd.firemonkeys.cloudcell": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.firemonkeys.cloudcell" };
- pub const @"application/vnd.flographit": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.flographit" };
- pub const @"application/vnd.fluxtime.clip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fluxtime.clip" };
- pub const @"application/vnd.font-fontforge-sfd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.font-fontforge-sfd" };
- pub const @"application/vnd.framemaker": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.framemaker" };
- pub const @"application/vnd.frogans.fnc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.frogans.fnc" };
- pub const @"application/vnd.frogans.ltf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.frogans.ltf" };
- pub const @"application/vnd.fsc.weblaunch": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fsc.weblaunch" };
- pub const @"application/vnd.fujifilm.fb.docuworks": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujifilm.fb.docuworks" };
- pub const @"application/vnd.fujifilm.fb.docuworks.binder": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujifilm.fb.docuworks.binder" };
- pub const @"application/vnd.fujifilm.fb.docuworks.container": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujifilm.fb.docuworks.container" };
- pub const @"application/vnd.fujifilm.fb.jfi+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujifilm.fb.jfi+xml" };
- pub const @"application/vnd.fujitsu.oasys": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujitsu.oasys" };
- pub const @"application/vnd.fujitsu.oasys2": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujitsu.oasys2" };
- pub const @"application/vnd.fujitsu.oasys3": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujitsu.oasys3" };
- pub const @"application/vnd.fujitsu.oasysgp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujitsu.oasysgp" };
- pub const @"application/vnd.fujitsu.oasysprs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujitsu.oasysprs" };
- pub const @"application/vnd.fujixerox.art-ex": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.art-ex" };
- pub const @"application/vnd.fujixerox.art4": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.art4" };
- pub const @"application/vnd.fujixerox.ddd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.ddd" };
- pub const @"application/vnd.fujixerox.docuworks": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.docuworks" };
- pub const @"application/vnd.fujixerox.docuworks.binder": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.docuworks.binder" };
- pub const @"application/vnd.fujixerox.docuworks.container": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.docuworks.container" };
- pub const @"application/vnd.fujixerox.hbpl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fujixerox.hbpl" };
- pub const @"application/vnd.fut-misnet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fut-misnet" };
- pub const @"application/vnd.futoin+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.futoin+cbor" };
- pub const @"application/vnd.futoin+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.futoin+json" };
- pub const @"application/vnd.fuzzysheet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.fuzzysheet" };
- pub const @"application/vnd.genomatix.tuxedo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.genomatix.tuxedo" };
- pub const @"application/vnd.gentics.grd+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gentics.grd+json" };
- pub const @"application/vnd.geo+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geo+json" };
- pub const @"application/vnd.geocube+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geocube+xml" };
- pub const @"application/vnd.geogebra.file": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geogebra.file" };
- pub const @"application/vnd.geogebra.slides": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geogebra.slides" };
- pub const @"application/vnd.geogebra.tool": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geogebra.tool" };
- pub const @"application/vnd.geometry-explorer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geometry-explorer" };
- pub const @"application/vnd.geonext": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geonext" };
- pub const @"application/vnd.geoplan": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geoplan" };
- pub const @"application/vnd.geospace": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.geospace" };
- pub const @"application/vnd.gerber": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gerber" };
- pub const @"application/vnd.globalplatform.card-content-mgt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.globalplatform.card-content-mgt" };
- pub const @"application/vnd.globalplatform.card-content-mgt-response": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.globalplatform.card-content-mgt-response" };
- pub const @"application/vnd.gmx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gmx" };
- pub const @"application/vnd.gnu.taler.exchange+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gnu.taler.exchange+json" };
- pub const @"application/vnd.gnu.taler.merchant+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gnu.taler.merchant+json" };
- pub const @"application/vnd.google-apps.document": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.google-apps.document" };
- pub const @"application/vnd.google-apps.presentation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.google-apps.presentation" };
- pub const @"application/vnd.google-apps.spreadsheet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.google-apps.spreadsheet" };
- pub const @"application/vnd.google-earth.kml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.google-earth.kml+xml" };
- pub const @"application/vnd.google-earth.kmz": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.google-earth.kmz" };
- pub const @"application/vnd.gov.sk.e-form+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gov.sk.e-form+xml" };
- pub const @"application/vnd.gov.sk.e-form+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gov.sk.e-form+zip" };
- pub const @"application/vnd.gov.sk.xmldatacontainer+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gov.sk.xmldatacontainer+xml" };
- pub const @"application/vnd.grafeq": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.grafeq" };
- pub const @"application/vnd.gridmp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.gridmp" };
- pub const @"application/vnd.groove-account": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-account" };
- pub const @"application/vnd.groove-help": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-help" };
- pub const @"application/vnd.groove-identity-message": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-identity-message" };
- pub const @"application/vnd.groove-injector": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-injector" };
- pub const @"application/vnd.groove-tool-message": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-tool-message" };
- pub const @"application/vnd.groove-tool-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-tool-template" };
- pub const @"application/vnd.groove-vcard": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.groove-vcard" };
- pub const @"application/vnd.hal+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hal+json" };
- pub const @"application/vnd.hal+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hal+xml" };
- pub const @"application/vnd.handheld-entertainment+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.handheld-entertainment+xml" };
- pub const @"application/vnd.hbci": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hbci" };
- pub const @"application/vnd.hc+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hc+json" };
- pub const @"application/vnd.hcl-bireports": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hcl-bireports" };
- pub const @"application/vnd.hdt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hdt" };
- pub const @"application/vnd.heroku+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.heroku+json" };
- pub const @"application/vnd.hhe.lesson-player": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hhe.lesson-player" };
- pub const @"application/vnd.hl7cda+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hl7cda+xml" };
- pub const @"application/vnd.hl7v2+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hl7v2+xml" };
- pub const @"application/vnd.hp-hpgl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-hpgl" };
- pub const @"application/vnd.hp-hpid": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-hpid" };
- pub const @"application/vnd.hp-hps": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-hps" };
- pub const @"application/vnd.hp-jlyt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-jlyt" };
- pub const @"application/vnd.hp-pcl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-pcl" };
- pub const @"application/vnd.hp-pclxl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hp-pclxl" };
- pub const @"application/vnd.httphone": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.httphone" };
- pub const @"application/vnd.hydrostatix.sof-data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hydrostatix.sof-data" };
- pub const @"application/vnd.hyper+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hyper+json" };
- pub const @"application/vnd.hyper-item+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hyper-item+json" };
- pub const @"application/vnd.hyperdrive+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hyperdrive+json" };
- pub const @"application/vnd.hzn-3d-crossword": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.hzn-3d-crossword" };
- pub const @"application/vnd.ibm.afplinedata": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.afplinedata" };
- pub const @"application/vnd.ibm.electronic-media": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.electronic-media" };
- pub const @"application/vnd.ibm.minipay": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.minipay" };
- pub const @"application/vnd.ibm.modcap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.modcap" };
- pub const @"application/vnd.ibm.rights-management": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.rights-management" };
- pub const @"application/vnd.ibm.secure-container": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ibm.secure-container" };
- pub const @"application/vnd.iccprofile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iccprofile" };
- pub const @"application/vnd.ieee.1905": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ieee.1905" };
- pub const @"application/vnd.igloader": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.igloader" };
- pub const @"application/vnd.imagemeter.folder+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.imagemeter.folder+zip" };
- pub const @"application/vnd.imagemeter.image+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.imagemeter.image+zip" };
- pub const @"application/vnd.immervision-ivp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.immervision-ivp" };
- pub const @"application/vnd.immervision-ivu": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.immervision-ivu" };
- pub const @"application/vnd.ims.imsccv1p1": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.imsccv1p1" };
- pub const @"application/vnd.ims.imsccv1p2": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.imsccv1p2" };
- pub const @"application/vnd.ims.imsccv1p3": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.imsccv1p3" };
- pub const @"application/vnd.ims.lis.v2.result+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lis.v2.result+json" };
- pub const @"application/vnd.ims.lti.v2.toolconsumerprofile+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lti.v2.toolconsumerprofile+json" };
- pub const @"application/vnd.ims.lti.v2.toolproxy+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lti.v2.toolproxy+json" };
- pub const @"application/vnd.ims.lti.v2.toolproxy.id+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lti.v2.toolproxy.id+json" };
- pub const @"application/vnd.ims.lti.v2.toolsettings+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lti.v2.toolsettings+json" };
- pub const @"application/vnd.ims.lti.v2.toolsettings.simple+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ims.lti.v2.toolsettings.simple+json" };
- pub const @"application/vnd.informedcontrol.rms+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.informedcontrol.rms+xml" };
- pub const @"application/vnd.informix-visionary": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.informix-visionary" };
- pub const @"application/vnd.infotech.project": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.infotech.project" };
- pub const @"application/vnd.infotech.project+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.infotech.project+xml" };
- pub const @"application/vnd.innopath.wamp.notification": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.innopath.wamp.notification" };
- pub const @"application/vnd.insors.igm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.insors.igm" };
- pub const @"application/vnd.intercon.formnet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intercon.formnet" };
- pub const @"application/vnd.intergeo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intergeo" };
- pub const @"application/vnd.intertrust.digibox": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intertrust.digibox" };
- pub const @"application/vnd.intertrust.nncp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intertrust.nncp" };
- pub const @"application/vnd.intu.qbo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intu.qbo" };
- pub const @"application/vnd.intu.qfx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.intu.qfx" };
- pub const @"application/vnd.iptc.g2.catalogitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.catalogitem+xml" };
- pub const @"application/vnd.iptc.g2.conceptitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.conceptitem+xml" };
- pub const @"application/vnd.iptc.g2.knowledgeitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.knowledgeitem+xml" };
- pub const @"application/vnd.iptc.g2.newsitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.newsitem+xml" };
- pub const @"application/vnd.iptc.g2.newsmessage+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.newsmessage+xml" };
- pub const @"application/vnd.iptc.g2.packageitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.packageitem+xml" };
- pub const @"application/vnd.iptc.g2.planningitem+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iptc.g2.planningitem+xml" };
- pub const @"application/vnd.ipunplugged.rcprofile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ipunplugged.rcprofile" };
- pub const @"application/vnd.irepository.package+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.irepository.package+xml" };
- pub const @"application/vnd.is-xpr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.is-xpr" };
- pub const @"application/vnd.isac.fcs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.isac.fcs" };
- pub const @"application/vnd.iso11783-10+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.iso11783-10+zip" };
- pub const @"application/vnd.jam": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.jam" };
- pub const @"application/vnd.japannet-directory-service": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-directory-service" };
- pub const @"application/vnd.japannet-jpnstore-wakeup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-jpnstore-wakeup" };
- pub const @"application/vnd.japannet-payment-wakeup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-payment-wakeup" };
- pub const @"application/vnd.japannet-registration": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-registration" };
- pub const @"application/vnd.japannet-registration-wakeup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-registration-wakeup" };
- pub const @"application/vnd.japannet-setstore-wakeup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-setstore-wakeup" };
- pub const @"application/vnd.japannet-verification": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-verification" };
- pub const @"application/vnd.japannet-verification-wakeup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.japannet-verification-wakeup" };
- pub const @"application/vnd.jcp.javame.midlet-rms": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.jcp.javame.midlet-rms" };
- pub const @"application/vnd.jisp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.jisp" };
- pub const @"application/vnd.joost.joda-archive": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.joost.joda-archive" };
- pub const @"application/vnd.jsk.isdn-ngn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.jsk.isdn-ngn" };
- pub const @"application/vnd.kahootz": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kahootz" };
- pub const @"application/vnd.kde.karbon": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.karbon" };
- pub const @"application/vnd.kde.kchart": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kchart" };
- pub const @"application/vnd.kde.kformula": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kformula" };
- pub const @"application/vnd.kde.kivio": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kivio" };
- pub const @"application/vnd.kde.kontour": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kontour" };
- pub const @"application/vnd.kde.kpresenter": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kpresenter" };
- pub const @"application/vnd.kde.kspread": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kspread" };
- pub const @"application/vnd.kde.kword": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kde.kword" };
- pub const @"application/vnd.kenameaapp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kenameaapp" };
- pub const @"application/vnd.kidspiration": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kidspiration" };
- pub const @"application/vnd.kinar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kinar" };
- pub const @"application/vnd.koan": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.koan" };
- pub const @"application/vnd.kodak-descriptor": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.kodak-descriptor" };
- pub const @"application/vnd.las": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.las" };
- pub const @"application/vnd.las.las+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.las.las+json" };
- pub const @"application/vnd.las.las+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.las.las+xml" };
- pub const @"application/vnd.laszip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.laszip" };
- pub const @"application/vnd.leap+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.leap+json" };
- pub const @"application/vnd.liberty-request+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.liberty-request+xml" };
- pub const @"application/vnd.llamagraphics.life-balance.desktop": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.llamagraphics.life-balance.desktop" };
- pub const @"application/vnd.llamagraphics.life-balance.exchange+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.llamagraphics.life-balance.exchange+xml" };
- pub const @"application/vnd.logipipe.circuit+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.logipipe.circuit+zip" };
- pub const @"application/vnd.loom": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.loom" };
- pub const @"application/vnd.lotus-1-2-3": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-1-2-3" };
- pub const @"application/vnd.lotus-approach": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-approach" };
- pub const @"application/vnd.lotus-freelance": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-freelance" };
- pub const @"application/vnd.lotus-notes": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-notes" };
- pub const @"application/vnd.lotus-organizer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-organizer" };
- pub const @"application/vnd.lotus-screencam": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-screencam" };
- pub const @"application/vnd.lotus-wordpro": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.lotus-wordpro" };
- pub const @"application/vnd.macports.portpkg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.macports.portpkg" };
- pub const @"application/vnd.mapbox-vector-tile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mapbox-vector-tile" };
- pub const @"application/vnd.marlin.drm.actiontoken+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.marlin.drm.actiontoken+xml" };
- pub const @"application/vnd.marlin.drm.conftoken+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.marlin.drm.conftoken+xml" };
- pub const @"application/vnd.marlin.drm.license+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.marlin.drm.license+xml" };
- pub const @"application/vnd.marlin.drm.mdcf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.marlin.drm.mdcf" };
- pub const @"application/vnd.mason+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mason+json" };
- pub const @"application/vnd.maxar.archive.3tz+zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.maxar.archive.3tz+zip" };
- pub const @"application/vnd.maxmind.maxmind-db": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.maxmind.maxmind-db" };
- pub const @"application/vnd.mcd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mcd" };
- pub const @"application/vnd.medcalcdata": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.medcalcdata" };
- pub const @"application/vnd.mediastation.cdkey": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mediastation.cdkey" };
- pub const @"application/vnd.meridian-slingshot": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.meridian-slingshot" };
- pub const @"application/vnd.mfer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mfer" };
- pub const @"application/vnd.mfmp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mfmp" };
- pub const @"application/vnd.micro+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.micro+json" };
- pub const @"application/vnd.micrografx.flo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.micrografx.flo" };
- pub const @"application/vnd.micrografx.igx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.micrografx.igx" };
- pub const @"application/vnd.microsoft.portable-executable": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.microsoft.portable-executable" };
- pub const @"application/vnd.microsoft.windows.thumbnail-cache": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.microsoft.windows.thumbnail-cache" };
- pub const @"application/vnd.miele+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.miele+json" };
- pub const @"application/vnd.mif": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mif" };
- pub const @"application/vnd.minisoft-hp3000-save": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.minisoft-hp3000-save" };
- pub const @"application/vnd.mitsubishi.misty-guard.trustweb": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mitsubishi.misty-guard.trustweb" };
- pub const @"application/vnd.mobius.daf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.daf" };
- pub const @"application/vnd.mobius.dis": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.dis" };
- pub const @"application/vnd.mobius.mbk": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.mbk" };
- pub const @"application/vnd.mobius.mqy": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.mqy" };
- pub const @"application/vnd.mobius.msl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.msl" };
- pub const @"application/vnd.mobius.plc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.plc" };
- pub const @"application/vnd.mobius.txf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mobius.txf" };
- pub const @"application/vnd.mophun.application": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mophun.application" };
- pub const @"application/vnd.mophun.certificate": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mophun.certificate" };
- pub const @"application/vnd.motorola.flexsuite": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite" };
- pub const @"application/vnd.motorola.flexsuite.adsi": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.adsi" };
- pub const @"application/vnd.motorola.flexsuite.fis": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.fis" };
- pub const @"application/vnd.motorola.flexsuite.gotap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.gotap" };
- pub const @"application/vnd.motorola.flexsuite.kmr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.kmr" };
- pub const @"application/vnd.motorola.flexsuite.ttc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.ttc" };
- pub const @"application/vnd.motorola.flexsuite.wem": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.flexsuite.wem" };
- pub const @"application/vnd.motorola.iprm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.motorola.iprm" };
- pub const @"application/vnd.mozilla.xul+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mozilla.xul+xml" };
- pub const @"application/vnd.ms-3mfdocument": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-3mfdocument" };
- pub const @"application/vnd.ms-artgalry": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-artgalry" };
- pub const @"application/vnd.ms-asf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-asf" };
- pub const @"application/vnd.ms-cab-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-cab-compressed" };
- pub const @"application/vnd.ms-color.iccprofile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-color.iccprofile" };
- pub const @"application/vnd.ms-excel": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-excel" };
- pub const @"application/vnd.ms-excel.addin.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-excel.addin.macroenabled.12" };
- pub const @"application/vnd.ms-excel.sheet.binary.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-excel.sheet.binary.macroenabled.12" };
- pub const @"application/vnd.ms-excel.sheet.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-excel.sheet.macroenabled.12" };
- pub const @"application/vnd.ms-excel.template.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-excel.template.macroenabled.12" };
- pub const @"application/vnd.ms-fontobject": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-fontobject" };
- pub const @"application/vnd.ms-htmlhelp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-htmlhelp" };
- pub const @"application/vnd.ms-ims": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-ims" };
- pub const @"application/vnd.ms-lrm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-lrm" };
- pub const @"application/vnd.ms-office.activex+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-office.activex+xml" };
- pub const @"application/vnd.ms-officetheme": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-officetheme" };
- pub const @"application/vnd.ms-opentype": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-opentype" };
- pub const @"application/vnd.ms-outlook": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-outlook" };
- pub const @"application/vnd.ms-package.obfuscated-opentype": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-package.obfuscated-opentype" };
- pub const @"application/vnd.ms-pki.seccat": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-pki.seccat" };
- pub const @"application/vnd.ms-pki.stl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-pki.stl" };
- pub const @"application/vnd.ms-playready.initiator+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-playready.initiator+xml" };
- pub const @"application/vnd.ms-powerpoint": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint" };
- pub const @"application/vnd.ms-powerpoint.addin.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint.addin.macroenabled.12" };
- pub const @"application/vnd.ms-powerpoint.presentation.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint.presentation.macroenabled.12" };
- pub const @"application/vnd.ms-powerpoint.slide.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint.slide.macroenabled.12" };
- pub const @"application/vnd.ms-powerpoint.slideshow.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint.slideshow.macroenabled.12" };
- pub const @"application/vnd.ms-powerpoint.template.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-powerpoint.template.macroenabled.12" };
- pub const @"application/vnd.ms-printdevicecapabilities+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-printdevicecapabilities+xml" };
- pub const @"application/vnd.ms-printing.printticket+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-printing.printticket+xml" };
- pub const @"application/vnd.ms-printschematicket+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-printschematicket+xml" };
- pub const @"application/vnd.ms-project": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-project" };
- pub const @"application/vnd.ms-tnef": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-tnef" };
- pub const @"application/vnd.ms-windows.devicepairing": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-windows.devicepairing" };
- pub const @"application/vnd.ms-windows.nwprinting.oob": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-windows.nwprinting.oob" };
- pub const @"application/vnd.ms-windows.printerpairing": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-windows.printerpairing" };
- pub const @"application/vnd.ms-windows.wsd.oob": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-windows.wsd.oob" };
- pub const @"application/vnd.ms-wmdrm.lic-chlg-req": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-wmdrm.lic-chlg-req" };
- pub const @"application/vnd.ms-wmdrm.lic-resp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-wmdrm.lic-resp" };
- pub const @"application/vnd.ms-wmdrm.meter-chlg-req": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-wmdrm.meter-chlg-req" };
- pub const @"application/vnd.ms-wmdrm.meter-resp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-wmdrm.meter-resp" };
- pub const @"application/vnd.ms-word.document.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-word.document.macroenabled.12" };
- pub const @"application/vnd.ms-word.template.macroenabled.12": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-word.template.macroenabled.12" };
- pub const @"application/vnd.ms-works": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-works" };
- pub const @"application/vnd.ms-wpl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-wpl" };
- pub const @"application/vnd.ms-xpsdocument": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ms-xpsdocument" };
- pub const @"application/vnd.msa-disk-image": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.msa-disk-image" };
- pub const @"application/vnd.mseq": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mseq" };
- pub const @"application/vnd.msign": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.msign" };
- pub const @"application/vnd.multiad.creator": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.multiad.creator" };
- pub const @"application/vnd.multiad.creator.cif": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.multiad.creator.cif" };
- pub const @"application/vnd.music-niff": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.music-niff" };
- pub const @"application/vnd.musician": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.musician" };
- pub const @"application/vnd.muvee.style": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.muvee.style" };
- pub const @"application/vnd.mynfc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.mynfc" };
- pub const @"application/vnd.nacamar.ybrid+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nacamar.ybrid+json" };
- pub const @"application/vnd.ncd.control": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ncd.control" };
- pub const @"application/vnd.ncd.reference": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ncd.reference" };
- pub const @"application/vnd.nearst.inv+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nearst.inv+json" };
- pub const @"application/vnd.nebumind.line": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nebumind.line" };
- pub const @"application/vnd.nervana": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nervana" };
- pub const @"application/vnd.netfpx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.netfpx" };
- pub const @"application/vnd.neurolanguage.nlu": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.neurolanguage.nlu" };
- pub const @"application/vnd.nimn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nimn" };
- pub const @"application/vnd.nintendo.nitro.rom": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nintendo.nitro.rom" };
- pub const @"application/vnd.nintendo.snes.rom": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nintendo.snes.rom" };
- pub const @"application/vnd.nitf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nitf" };
- pub const @"application/vnd.noblenet-directory": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.noblenet-directory" };
- pub const @"application/vnd.noblenet-sealer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.noblenet-sealer" };
- pub const @"application/vnd.noblenet-web": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.noblenet-web" };
- pub const @"application/vnd.nokia.catalogs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.catalogs" };
- pub const @"application/vnd.nokia.conml+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.conml+wbxml" };
- pub const @"application/vnd.nokia.conml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.conml+xml" };
- pub const @"application/vnd.nokia.iptv.config+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.iptv.config+xml" };
- pub const @"application/vnd.nokia.isds-radio-presets": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.isds-radio-presets" };
- pub const @"application/vnd.nokia.landmark+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.landmark+wbxml" };
- pub const @"application/vnd.nokia.landmark+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.landmark+xml" };
- pub const @"application/vnd.nokia.landmarkcollection+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.landmarkcollection+xml" };
- pub const @"application/vnd.nokia.n-gage.ac+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.n-gage.ac+xml" };
- pub const @"application/vnd.nokia.n-gage.data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.n-gage.data" };
- pub const @"application/vnd.nokia.n-gage.symbian.install": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.n-gage.symbian.install" };
- pub const @"application/vnd.nokia.ncd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.ncd" };
- pub const @"application/vnd.nokia.pcd+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.pcd+wbxml" };
- pub const @"application/vnd.nokia.pcd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.pcd+xml" };
- pub const @"application/vnd.nokia.radio-preset": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.radio-preset" };
- pub const @"application/vnd.nokia.radio-presets": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.nokia.radio-presets" };
- pub const @"application/vnd.novadigm.edm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.novadigm.edm" };
- pub const @"application/vnd.novadigm.edx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.novadigm.edx" };
- pub const @"application/vnd.novadigm.ext": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.novadigm.ext" };
- pub const @"application/vnd.ntt-local.content-share": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ntt-local.content-share" };
- pub const @"application/vnd.ntt-local.file-transfer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ntt-local.file-transfer" };
- pub const @"application/vnd.ntt-local.ogw_remote-access": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ntt-local.ogw_remote-access" };
- pub const @"application/vnd.ntt-local.sip-ta_remote": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ntt-local.sip-ta_remote" };
- pub const @"application/vnd.ntt-local.sip-ta_tcp_stream": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ntt-local.sip-ta_tcp_stream" };
- pub const @"application/vnd.oasis.opendocument.chart": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.chart" };
- pub const @"application/vnd.oasis.opendocument.chart-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.chart-template" };
- pub const @"application/vnd.oasis.opendocument.database": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.database" };
- pub const @"application/vnd.oasis.opendocument.formula": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.formula" };
- pub const @"application/vnd.oasis.opendocument.formula-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.formula-template" };
- pub const @"application/vnd.oasis.opendocument.graphics": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.graphics" };
- pub const @"application/vnd.oasis.opendocument.graphics-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.graphics-template" };
- pub const @"application/vnd.oasis.opendocument.image": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.image" };
- pub const @"application/vnd.oasis.opendocument.image-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.image-template" };
- pub const @"application/vnd.oasis.opendocument.presentation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.presentation" };
- pub const @"application/vnd.oasis.opendocument.presentation-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.presentation-template" };
- pub const @"application/vnd.oasis.opendocument.spreadsheet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.spreadsheet" };
- pub const @"application/vnd.oasis.opendocument.spreadsheet-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.spreadsheet-template" };
- pub const @"application/vnd.oasis.opendocument.text": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.text" };
- pub const @"application/vnd.oasis.opendocument.text-master": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.text-master" };
- pub const @"application/vnd.oasis.opendocument.text-template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.text-template" };
- pub const @"application/vnd.oasis.opendocument.text-web": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oasis.opendocument.text-web" };
- pub const @"application/vnd.obn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.obn" };
- pub const @"application/vnd.ocf+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ocf+cbor" };
- pub const @"application/vnd.oci.image.manifest.v1+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oci.image.manifest.v1+json" };
- pub const @"application/vnd.oftn.l10n+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oftn.l10n+json" };
- pub const @"application/vnd.oipf.contentaccessdownload+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.contentaccessdownload+xml" };
- pub const @"application/vnd.oipf.contentaccessstreaming+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.contentaccessstreaming+xml" };
- pub const @"application/vnd.oipf.cspg-hexbinary": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.cspg-hexbinary" };
- pub const @"application/vnd.oipf.dae.svg+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.dae.svg+xml" };
- pub const @"application/vnd.oipf.dae.xhtml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.dae.xhtml+xml" };
- pub const @"application/vnd.oipf.mippvcontrolmessage+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.mippvcontrolmessage+xml" };
- pub const @"application/vnd.oipf.pae.gem": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.pae.gem" };
- pub const @"application/vnd.oipf.spdiscovery+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.spdiscovery+xml" };
- pub const @"application/vnd.oipf.spdlist+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.spdlist+xml" };
- pub const @"application/vnd.oipf.ueprofile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.ueprofile+xml" };
- pub const @"application/vnd.oipf.userprofile+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oipf.userprofile+xml" };
- pub const @"application/vnd.olpc-sugar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.olpc-sugar" };
- pub const @"application/vnd.oma-scws-config": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma-scws-config" };
- pub const @"application/vnd.oma-scws-http-request": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma-scws-http-request" };
- pub const @"application/vnd.oma-scws-http-response": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma-scws-http-response" };
- pub const @"application/vnd.oma.bcast.associated-procedure-parameter+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.associated-procedure-parameter+xml" };
- pub const @"application/vnd.oma.bcast.drm-trigger+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.drm-trigger+xml" };
- pub const @"application/vnd.oma.bcast.imd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.imd+xml" };
- pub const @"application/vnd.oma.bcast.ltkm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.ltkm" };
- pub const @"application/vnd.oma.bcast.notification+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.notification+xml" };
- pub const @"application/vnd.oma.bcast.provisioningtrigger": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.provisioningtrigger" };
- pub const @"application/vnd.oma.bcast.sgboot": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.sgboot" };
- pub const @"application/vnd.oma.bcast.sgdd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.sgdd+xml" };
- pub const @"application/vnd.oma.bcast.sgdu": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.sgdu" };
- pub const @"application/vnd.oma.bcast.simple-symbol-container": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.simple-symbol-container" };
- pub const @"application/vnd.oma.bcast.smartcard-trigger+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.smartcard-trigger+xml" };
- pub const @"application/vnd.oma.bcast.sprov+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.sprov+xml" };
- pub const @"application/vnd.oma.bcast.stkm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.bcast.stkm" };
- pub const @"application/vnd.oma.cab-address-book+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.cab-address-book+xml" };
- pub const @"application/vnd.oma.cab-feature-handler+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.cab-feature-handler+xml" };
- pub const @"application/vnd.oma.cab-pcc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.cab-pcc+xml" };
- pub const @"application/vnd.oma.cab-subs-invite+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.cab-subs-invite+xml" };
- pub const @"application/vnd.oma.cab-user-prefs+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.cab-user-prefs+xml" };
- pub const @"application/vnd.oma.dcd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.dcd" };
- pub const @"application/vnd.oma.dcdc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.dcdc" };
- pub const @"application/vnd.oma.dd2+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.dd2+xml" };
- pub const @"application/vnd.oma.drm.risd+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.drm.risd+xml" };
- pub const @"application/vnd.oma.group-usage-list+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.group-usage-list+xml" };
- pub const @"application/vnd.oma.lwm2m+cbor": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.lwm2m+cbor" };
- pub const @"application/vnd.oma.lwm2m+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.lwm2m+json" };
- pub const @"application/vnd.oma.lwm2m+tlv": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.lwm2m+tlv" };
- pub const @"application/vnd.oma.pal+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.pal+xml" };
- pub const @"application/vnd.oma.poc.detailed-progress-report+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.poc.detailed-progress-report+xml" };
- pub const @"application/vnd.oma.poc.final-report+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.poc.final-report+xml" };
- pub const @"application/vnd.oma.poc.groups+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.poc.groups+xml" };
- pub const @"application/vnd.oma.poc.invocation-descriptor+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.poc.invocation-descriptor+xml" };
- pub const @"application/vnd.oma.poc.optimized-progress-report+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.poc.optimized-progress-report+xml" };
- pub const @"application/vnd.oma.push": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.push" };
- pub const @"application/vnd.oma.scidm.messages+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.scidm.messages+xml" };
- pub const @"application/vnd.oma.xcap-directory+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oma.xcap-directory+xml" };
- pub const @"application/vnd.omads-email+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.omads-email+xml" };
- pub const @"application/vnd.omads-file+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.omads-file+xml" };
- pub const @"application/vnd.omads-folder+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.omads-folder+xml" };
- pub const @"application/vnd.omaloc-supl-init": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.omaloc-supl-init" };
- pub const @"application/vnd.onepager": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepager" };
- pub const @"application/vnd.onepagertamp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepagertamp" };
- pub const @"application/vnd.onepagertamx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepagertamx" };
- pub const @"application/vnd.onepagertat": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepagertat" };
- pub const @"application/vnd.onepagertatp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepagertatp" };
- pub const @"application/vnd.onepagertatx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.onepagertatx" };
- pub const @"application/vnd.openblox.game+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openblox.game+xml" };
- pub const @"application/vnd.openblox.game-binary": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openblox.game-binary" };
- pub const @"application/vnd.openeye.oeb": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openeye.oeb" };
- pub const @"application/vnd.openofficeorg.extension": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openofficeorg.extension" };
- pub const @"application/vnd.openstreetmap.data+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openstreetmap.data+xml" };
- pub const @"application/vnd.opentimestamps.ots": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.opentimestamps.ots" };
- pub const @"application/vnd.openxmlformats-officedocument.custom-properties+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.custom-properties+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.customxmlproperties+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.customxmlproperties+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawing+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawing+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.chart+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.extended-properties+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.extended-properties+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.comments+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.comments+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.presentation": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.presentation" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slide": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slide" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slide+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideshow": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slideshow" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.tags+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.tags+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.template" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.template" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.theme+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.theme+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.themeoverride+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.themeoverride+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.vmldrawing": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.vmldrawing" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.template" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" };
- pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml" };
- pub const @"application/vnd.openxmlformats-package.core-properties+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-package.core-properties+xml" };
- pub const @"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml" };
- pub const @"application/vnd.openxmlformats-package.relationships+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.openxmlformats-package.relationships+xml" };
- pub const @"application/vnd.oracle.resource+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oracle.resource+json" };
- pub const @"application/vnd.orange.indata": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.orange.indata" };
- pub const @"application/vnd.osa.netdeploy": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.osa.netdeploy" };
- pub const @"application/vnd.osgeo.mapguide.package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.osgeo.mapguide.package" };
- pub const @"application/vnd.osgi.bundle": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.osgi.bundle" };
- pub const @"application/vnd.osgi.dp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.osgi.dp" };
- pub const @"application/vnd.osgi.subsystem": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.osgi.subsystem" };
- pub const @"application/vnd.otps.ct-kip+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.otps.ct-kip+xml" };
- pub const @"application/vnd.oxli.countgraph": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.oxli.countgraph" };
- pub const @"application/vnd.pagerduty+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pagerduty+json" };
- pub const @"application/vnd.palm": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.palm" };
- pub const @"application/vnd.panoply": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.panoply" };
- pub const @"application/vnd.paos.xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.paos.xml" };
- pub const @"application/vnd.patentdive": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.patentdive" };
- pub const @"application/vnd.patientecommsdoc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.patientecommsdoc" };
- pub const @"application/vnd.pawaafile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pawaafile" };
- pub const @"application/vnd.pcos": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pcos" };
- pub const @"application/vnd.pg.format": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pg.format" };
- pub const @"application/vnd.pg.osasli": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pg.osasli" };
- pub const @"application/vnd.piaccess.application-licence": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.piaccess.application-licence" };
- pub const @"application/vnd.picsel": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.picsel" };
- pub const @"application/vnd.pmi.widget": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pmi.widget" };
- pub const @"application/vnd.poc.group-advertisement+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.poc.group-advertisement+xml" };
- pub const @"application/vnd.pocketlearn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pocketlearn" };
- pub const @"application/vnd.powerbuilder6": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder6" };
- pub const @"application/vnd.powerbuilder6-s": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder6-s" };
- pub const @"application/vnd.powerbuilder7": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder7" };
- pub const @"application/vnd.powerbuilder7-s": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder7-s" };
- pub const @"application/vnd.powerbuilder75": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder75" };
- pub const @"application/vnd.powerbuilder75-s": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.powerbuilder75-s" };
- pub const @"application/vnd.preminet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.preminet" };
- pub const @"application/vnd.previewsystems.box": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.previewsystems.box" };
- pub const @"application/vnd.proteus.magazine": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.proteus.magazine" };
- pub const @"application/vnd.psfs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.psfs" };
- pub const @"application/vnd.publishare-delta-tree": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.publishare-delta-tree" };
- pub const @"application/vnd.pvi.ptid1": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pvi.ptid1" };
- pub const @"application/vnd.pwg-multiplexed": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pwg-multiplexed" };
- pub const @"application/vnd.pwg-xhtml-print+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.pwg-xhtml-print+xml" };
- pub const @"application/vnd.qualcomm.brew-app-res": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.qualcomm.brew-app-res" };
- pub const @"application/vnd.quarantainenet": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.quarantainenet" };
- pub const @"application/vnd.quark.quarkxpress": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.quark.quarkxpress" };
- pub const @"application/vnd.quobject-quoxdocument": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.quobject-quoxdocument" };
- pub const @"application/vnd.radisys.moml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.moml+xml" };
- pub const @"application/vnd.radisys.msml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml+xml" };
- pub const @"application/vnd.radisys.msml-audit+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-audit+xml" };
- pub const @"application/vnd.radisys.msml-audit-conf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-audit-conf+xml" };
- pub const @"application/vnd.radisys.msml-audit-conn+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-audit-conn+xml" };
- pub const @"application/vnd.radisys.msml-audit-dialog+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-audit-dialog+xml" };
- pub const @"application/vnd.radisys.msml-audit-stream+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-audit-stream+xml" };
- pub const @"application/vnd.radisys.msml-conf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-conf+xml" };
- pub const @"application/vnd.radisys.msml-dialog+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog+xml" };
- pub const @"application/vnd.radisys.msml-dialog-base+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-base+xml" };
- pub const @"application/vnd.radisys.msml-dialog-fax-detect+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-fax-detect+xml" };
- pub const @"application/vnd.radisys.msml-dialog-fax-sendrecv+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-fax-sendrecv+xml" };
- pub const @"application/vnd.radisys.msml-dialog-group+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-group+xml" };
- pub const @"application/vnd.radisys.msml-dialog-speech+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-speech+xml" };
- pub const @"application/vnd.radisys.msml-dialog-transform+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.radisys.msml-dialog-transform+xml" };
- pub const @"application/vnd.rainstor.data": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rainstor.data" };
- pub const @"application/vnd.rapid": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rapid" };
- pub const @"application/vnd.rar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rar" };
- pub const @"application/vnd.realvnc.bed": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.realvnc.bed" };
- pub const @"application/vnd.recordare.musicxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.recordare.musicxml" };
- pub const @"application/vnd.recordare.musicxml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.recordare.musicxml+xml" };
- pub const @"application/vnd.renlearn.rlprint": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.renlearn.rlprint" };
- pub const @"application/vnd.resilient.logic": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.resilient.logic" };
- pub const @"application/vnd.restful+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.restful+json" };
- pub const @"application/vnd.rig.cryptonote": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rig.cryptonote" };
- pub const @"application/vnd.rim.cod": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rim.cod" };
- pub const @"application/vnd.rn-realmedia": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rn-realmedia" };
- pub const @"application/vnd.rn-realmedia-vbr": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rn-realmedia-vbr" };
- pub const @"application/vnd.route66.link66+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.route66.link66+xml" };
- pub const @"application/vnd.rs-274x": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.rs-274x" };
- pub const @"application/vnd.ruckus.download": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ruckus.download" };
- pub const @"application/vnd.s3sms": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.s3sms" };
- pub const @"application/vnd.sailingtracker.track": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sailingtracker.track" };
- pub const @"application/vnd.sar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sar" };
- pub const @"application/vnd.sbm.cid": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sbm.cid" };
- pub const @"application/vnd.sbm.mid2": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sbm.mid2" };
- pub const @"application/vnd.scribus": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.scribus" };
- pub const @"application/vnd.sealed.3df": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.3df" };
- pub const @"application/vnd.sealed.csf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.csf" };
- pub const @"application/vnd.sealed.doc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.doc" };
- pub const @"application/vnd.sealed.eml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.eml" };
- pub const @"application/vnd.sealed.mht": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.mht" };
- pub const @"application/vnd.sealed.net": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.net" };
- pub const @"application/vnd.sealed.ppt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.ppt" };
- pub const @"application/vnd.sealed.tiff": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.tiff" };
- pub const @"application/vnd.sealed.xls": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealed.xls" };
- pub const @"application/vnd.sealedmedia.softseal.html": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealedmedia.softseal.html" };
- pub const @"application/vnd.sealedmedia.softseal.pdf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sealedmedia.softseal.pdf" };
- pub const @"application/vnd.seemail": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.seemail" };
- pub const @"application/vnd.seis+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.seis+json" };
- pub const @"application/vnd.sema": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sema" };
- pub const @"application/vnd.semd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.semd" };
- pub const @"application/vnd.semf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.semf" };
- pub const @"application/vnd.shade-save-file": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shade-save-file" };
- pub const @"application/vnd.shana.informed.formdata": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shana.informed.formdata" };
- pub const @"application/vnd.shana.informed.formtemplate": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shana.informed.formtemplate" };
- pub const @"application/vnd.shana.informed.interchange": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shana.informed.interchange" };
- pub const @"application/vnd.shana.informed.package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shana.informed.package" };
- pub const @"application/vnd.shootproof+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shootproof+json" };
- pub const @"application/vnd.shopkick+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shopkick+json" };
- pub const @"application/vnd.shp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shp" };
- pub const @"application/vnd.shx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.shx" };
- pub const @"application/vnd.sigrok.session": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sigrok.session" };
- pub const @"application/vnd.simtech-mindmapper": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.simtech-mindmapper" };
- pub const @"application/vnd.siren+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.siren+json" };
- pub const @"application/vnd.smaf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.smaf" };
- pub const @"application/vnd.smart.notebook": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.smart.notebook" };
- pub const @"application/vnd.smart.teacher": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.smart.teacher" };
- pub const @"application/vnd.snesdev-page-table": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.snesdev-page-table" };
- pub const @"application/vnd.software602.filler.form+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.software602.filler.form+xml" };
- pub const @"application/vnd.software602.filler.form-xml-zip": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.software602.filler.form-xml-zip" };
- pub const @"application/vnd.solent.sdkm+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.solent.sdkm+xml" };
- pub const @"application/vnd.spotfire.dxp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.spotfire.dxp" };
- pub const @"application/vnd.spotfire.sfs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.spotfire.sfs" };
- pub const @"application/vnd.sqlite3": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sqlite3" };
- pub const @"application/vnd.sss-cod": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sss-cod" };
- pub const @"application/vnd.sss-dtf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sss-dtf" };
- pub const @"application/vnd.sss-ntf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sss-ntf" };
- pub const @"application/vnd.stardivision.calc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.calc" };
- pub const @"application/vnd.stardivision.draw": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.draw" };
- pub const @"application/vnd.stardivision.impress": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.impress" };
- pub const @"application/vnd.stardivision.math": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.math" };
- pub const @"application/vnd.stardivision.writer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.writer" };
- pub const @"application/vnd.stardivision.writer-global": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stardivision.writer-global" };
- pub const @"application/vnd.stepmania.package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stepmania.package" };
- pub const @"application/vnd.stepmania.stepchart": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.stepmania.stepchart" };
- pub const @"application/vnd.street-stream": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.street-stream" };
- pub const @"application/vnd.sun.wadl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.wadl+xml" };
- pub const @"application/vnd.sun.xml.calc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.calc" };
- pub const @"application/vnd.sun.xml.calc.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.calc.template" };
- pub const @"application/vnd.sun.xml.draw": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.draw" };
- pub const @"application/vnd.sun.xml.draw.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.draw.template" };
- pub const @"application/vnd.sun.xml.impress": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.impress" };
- pub const @"application/vnd.sun.xml.impress.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.impress.template" };
- pub const @"application/vnd.sun.xml.math": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.math" };
- pub const @"application/vnd.sun.xml.writer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.writer" };
- pub const @"application/vnd.sun.xml.writer.global": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.writer.global" };
- pub const @"application/vnd.sun.xml.writer.template": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sun.xml.writer.template" };
- pub const @"application/vnd.sus-calendar": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sus-calendar" };
- pub const @"application/vnd.svd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.svd" };
- pub const @"application/vnd.swiftview-ics": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.swiftview-ics" };
- pub const @"application/vnd.sycle+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.sycle+xml" };
- pub const @"application/vnd.syft+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syft+json" };
- pub const @"application/vnd.symbian.install": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.symbian.install" };
- pub const @"application/vnd.syncml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml+xml" };
- pub const @"application/vnd.syncml.dm+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dm+wbxml" };
- pub const @"application/vnd.syncml.dm+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dm+xml" };
- pub const @"application/vnd.syncml.dm.notification": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dm.notification" };
- pub const @"application/vnd.syncml.dmddf+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dmddf+wbxml" };
- pub const @"application/vnd.syncml.dmddf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dmddf+xml" };
- pub const @"application/vnd.syncml.dmtnds+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dmtnds+wbxml" };
- pub const @"application/vnd.syncml.dmtnds+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.dmtnds+xml" };
- pub const @"application/vnd.syncml.ds.notification": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.syncml.ds.notification" };
- pub const @"application/vnd.tableschema+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tableschema+json" };
- pub const @"application/vnd.tao.intent-module-archive": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tao.intent-module-archive" };
- pub const @"application/vnd.tcpdump.pcap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tcpdump.pcap" };
- pub const @"application/vnd.think-cell.ppttc+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.think-cell.ppttc+json" };
- pub const @"application/vnd.tmd.mediaflex.api+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tmd.mediaflex.api+xml" };
- pub const @"application/vnd.tml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tml" };
- pub const @"application/vnd.tmobile-livetv": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tmobile-livetv" };
- pub const @"application/vnd.tri.onesource": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.tri.onesource" };
- pub const @"application/vnd.trid.tpt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.trid.tpt" };
- pub const @"application/vnd.triscape.mxs": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.triscape.mxs" };
- pub const @"application/vnd.trueapp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.trueapp" };
- pub const @"application/vnd.truedoc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.truedoc" };
- pub const @"application/vnd.ubisoft.webplayer": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ubisoft.webplayer" };
- pub const @"application/vnd.ufdl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ufdl" };
- pub const @"application/vnd.uiq.theme": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uiq.theme" };
- pub const @"application/vnd.umajin": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.umajin" };
- pub const @"application/vnd.unity": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.unity" };
- pub const @"application/vnd.uoml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uoml+xml" };
- pub const @"application/vnd.uplanet.alert": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.alert" };
- pub const @"application/vnd.uplanet.alert-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.alert-wbxml" };
- pub const @"application/vnd.uplanet.bearer-choice": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.bearer-choice" };
- pub const @"application/vnd.uplanet.bearer-choice-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.bearer-choice-wbxml" };
- pub const @"application/vnd.uplanet.cacheop": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.cacheop" };
- pub const @"application/vnd.uplanet.cacheop-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.cacheop-wbxml" };
- pub const @"application/vnd.uplanet.channel": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.channel" };
- pub const @"application/vnd.uplanet.channel-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.channel-wbxml" };
- pub const @"application/vnd.uplanet.list": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.list" };
- pub const @"application/vnd.uplanet.list-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.list-wbxml" };
- pub const @"application/vnd.uplanet.listcmd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.listcmd" };
- pub const @"application/vnd.uplanet.listcmd-wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.listcmd-wbxml" };
- pub const @"application/vnd.uplanet.signal": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uplanet.signal" };
- pub const @"application/vnd.uri-map": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.uri-map" };
- pub const @"application/vnd.valve.source.material": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.valve.source.material" };
- pub const @"application/vnd.vcx": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vcx" };
- pub const @"application/vnd.vd-study": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vd-study" };
- pub const @"application/vnd.vectorworks": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vectorworks" };
- pub const @"application/vnd.vel+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vel+json" };
- pub const @"application/vnd.verimatrix.vcas": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.verimatrix.vcas" };
- pub const @"application/vnd.veritone.aion+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.veritone.aion+json" };
- pub const @"application/vnd.veryant.thin": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.veryant.thin" };
- pub const @"application/vnd.ves.encrypted": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.ves.encrypted" };
- pub const @"application/vnd.vidsoft.vidconference": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vidsoft.vidconference" };
- pub const @"application/vnd.visio": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.visio" };
- pub const @"application/vnd.visionary": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.visionary" };
- pub const @"application/vnd.vividence.scriptfile": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vividence.scriptfile" };
- pub const @"application/vnd.vsf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.vsf" };
- pub const @"application/vnd.wap.sic": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wap.sic" };
- pub const @"application/vnd.wap.slc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wap.slc" };
- pub const @"application/vnd.wap.wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wap.wbxml" };
- pub const @"application/vnd.wap.wmlc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wap.wmlc" };
- pub const @"application/vnd.wap.wmlscriptc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wap.wmlscriptc" };
- pub const @"application/vnd.webturbo": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.webturbo" };
- pub const @"application/vnd.wfa.dpp": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wfa.dpp" };
- pub const @"application/vnd.wfa.p2p": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wfa.p2p" };
- pub const @"application/vnd.wfa.wsc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wfa.wsc" };
- pub const @"application/vnd.windows.devicepairing": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.windows.devicepairing" };
- pub const @"application/vnd.wmc": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wmc" };
- pub const @"application/vnd.wmf.bootstrap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wmf.bootstrap" };
- pub const @"application/vnd.wolfram.mathematica": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wolfram.mathematica" };
- pub const @"application/vnd.wolfram.mathematica.package": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wolfram.mathematica.package" };
- pub const @"application/vnd.wolfram.player": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wolfram.player" };
- pub const @"application/vnd.wordperfect": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wordperfect" };
- pub const @"application/vnd.wqd": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wqd" };
- pub const @"application/vnd.wrq-hp3000-labelled": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wrq-hp3000-labelled" };
- pub const @"application/vnd.wt.stf": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wt.stf" };
- pub const @"application/vnd.wv.csp+wbxml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wv.csp+wbxml" };
- pub const @"application/vnd.wv.csp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wv.csp+xml" };
- pub const @"application/vnd.wv.ssp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.wv.ssp+xml" };
- pub const @"application/vnd.xacml+json": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xacml+json" };
- pub const @"application/vnd.xara": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xara" };
- pub const @"application/vnd.xfdl": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xfdl" };
- pub const @"application/vnd.xfdl.webform": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xfdl.webform" };
- pub const @"application/vnd.xmi+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmi+xml" };
- pub const @"application/vnd.xmpie.cpkg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmpie.cpkg" };
- pub const @"application/vnd.xmpie.dpkg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmpie.dpkg" };
- pub const @"application/vnd.xmpie.plan": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmpie.plan" };
- pub const @"application/vnd.xmpie.ppkg": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmpie.ppkg" };
- pub const @"application/vnd.xmpie.xlim": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.xmpie.xlim" };
- pub const @"application/vnd.yamaha.hv-dic": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.hv-dic" };
- pub const @"application/vnd.yamaha.hv-script": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.hv-script" };
- pub const @"application/vnd.yamaha.hv-voice": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.hv-voice" };
- pub const @"application/vnd.yamaha.openscoreformat": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.openscoreformat" };
- pub const @"application/vnd.yamaha.openscoreformat.osfpvg+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.openscoreformat.osfpvg+xml" };
- pub const @"application/vnd.yamaha.remote-setup": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.remote-setup" };
- pub const @"application/vnd.yamaha.smaf-audio": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.smaf-audio" };
- pub const @"application/vnd.yamaha.smaf-phrase": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.smaf-phrase" };
- pub const @"application/vnd.yamaha.through-ngn": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.through-ngn" };
- pub const @"application/vnd.yamaha.tunnel-udpencap": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yamaha.tunnel-udpencap" };
- pub const @"application/vnd.yaoweme": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yaoweme" };
- pub const @"application/vnd.yellowriver-custom-menu": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.yellowriver-custom-menu" };
- pub const @"application/vnd.youtube.yt": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.youtube.yt" };
- pub const @"application/vnd.zul": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.zul" };
- pub const @"application/vnd.zzazz.deck+xml": MimeType = MimeType{ .category = .@"application", .value = "application/vnd.zzazz.deck+xml" };
- pub const @"application/voicexml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/voicexml+xml" };
- pub const @"application/voucher-cms+json": MimeType = MimeType{ .category = .@"application", .value = "application/voucher-cms+json" };
- pub const @"application/vq-rtcpxr": MimeType = MimeType{ .category = .@"application", .value = "application/vq-rtcpxr" };
- pub const @"application/watcherinfo+xml": MimeType = MimeType{ .category = .@"application", .value = "application/watcherinfo+xml" };
- pub const @"application/webpush-options+json": MimeType = MimeType{ .category = .@"application", .value = "application/webpush-options+json" };
- pub const @"application/whoispp-query": MimeType = MimeType{ .category = .@"application", .value = "application/whoispp-query" };
- pub const @"application/whoispp-response": MimeType = MimeType{ .category = .@"application", .value = "application/whoispp-response" };
- pub const @"application/widget": MimeType = MimeType{ .category = .@"application", .value = "application/widget" };
- pub const @"application/winhlp": MimeType = MimeType{ .category = .@"application", .value = "application/winhlp" };
- pub const @"application/wita": MimeType = MimeType{ .category = .@"application", .value = "application/wita" };
- pub const @"application/wordperfect5.1": MimeType = MimeType{ .category = .@"application", .value = "application/wordperfect5.1" };
- pub const @"application/wsdl+xml": MimeType = MimeType{ .category = .@"application", .value = "application/wsdl+xml" };
- pub const @"application/wspolicy+xml": MimeType = MimeType{ .category = .@"application", .value = "application/wspolicy+xml" };
- pub const @"application/x-7z-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-7z-compressed" };
- pub const @"application/x-abiword": MimeType = MimeType{ .category = .@"application", .value = "application/x-abiword" };
- pub const @"application/x-ace-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-ace-compressed" };
- pub const @"application/x-amf": MimeType = MimeType{ .category = .@"application", .value = "application/x-amf" };
- pub const @"application/x-apple-diskimage": MimeType = MimeType{ .category = .@"application", .value = "application/x-apple-diskimage" };
- pub const @"application/x-arj": MimeType = MimeType{ .category = .@"application", .value = "application/x-arj" };
- pub const @"application/x-authorware-bin": MimeType = MimeType{ .category = .@"application", .value = "application/x-authorware-bin" };
- pub const @"application/x-authorware-map": MimeType = MimeType{ .category = .@"application", .value = "application/x-authorware-map" };
- pub const @"application/x-authorware-seg": MimeType = MimeType{ .category = .@"application", .value = "application/x-authorware-seg" };
- pub const @"application/x-bcpio": MimeType = MimeType{ .category = .@"application", .value = "application/x-bcpio" };
- pub const @"application/x-bdoc": MimeType = MimeType{ .category = .@"application", .value = "application/x-bdoc" };
- pub const @"application/x-bittorrent": MimeType = MimeType{ .category = .@"application", .value = "application/x-bittorrent" };
- pub const @"application/x-blorb": MimeType = MimeType{ .category = .@"application", .value = "application/x-blorb" };
- pub const @"application/x-bzip": MimeType = MimeType{ .category = .@"application", .value = "application/x-bzip" };
- pub const @"application/x-bzip2": MimeType = MimeType{ .category = .@"application", .value = "application/x-bzip2" };
- pub const @"application/x-cbr": MimeType = MimeType{ .category = .@"application", .value = "application/x-cbr" };
- pub const @"application/x-cdlink": MimeType = MimeType{ .category = .@"application", .value = "application/x-cdlink" };
- pub const @"application/x-cfs-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-cfs-compressed" };
- pub const @"application/x-chat": MimeType = MimeType{ .category = .@"application", .value = "application/x-chat" };
- pub const @"application/x-chess-pgn": MimeType = MimeType{ .category = .@"application", .value = "application/x-chess-pgn" };
- pub const @"application/x-chrome-extension": MimeType = MimeType{ .category = .@"application", .value = "application/x-chrome-extension" };
- pub const @"application/x-cocoa": MimeType = MimeType{ .category = .@"application", .value = "application/x-cocoa" };
- pub const @"application/x-compress": MimeType = MimeType{ .category = .@"application", .value = "application/x-compress" };
- pub const @"application/x-conference": MimeType = MimeType{ .category = .@"application", .value = "application/x-conference" };
- pub const @"application/x-cpio": MimeType = MimeType{ .category = .@"application", .value = "application/x-cpio" };
- pub const @"application/x-csh": MimeType = MimeType{ .category = .@"application", .value = "application/x-csh" };
- pub const @"application/x-deb": MimeType = MimeType{ .category = .@"application", .value = "application/x-deb" };
- pub const @"application/x-debian-package": MimeType = MimeType{ .category = .@"application", .value = "application/x-debian-package" };
- pub const @"application/x-dgc-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-dgc-compressed" };
- pub const @"application/x-director": MimeType = MimeType{ .category = .@"application", .value = "application/x-director" };
- pub const @"application/x-doom": MimeType = MimeType{ .category = .@"application", .value = "application/x-doom" };
- pub const @"application/x-dtbncx+xml": MimeType = MimeType{ .category = .@"application", .value = "application/x-dtbncx+xml" };
- pub const @"application/x-dtbook+xml": MimeType = MimeType{ .category = .@"application", .value = "application/x-dtbook+xml" };
- pub const @"application/x-dtbresource+xml": MimeType = MimeType{ .category = .@"application", .value = "application/x-dtbresource+xml" };
- pub const @"application/x-dvi": MimeType = MimeType{ .category = .@"application", .value = "application/x-dvi" };
- pub const @"application/x-envoy": MimeType = MimeType{ .category = .@"application", .value = "application/x-envoy" };
- pub const @"application/x-eva": MimeType = MimeType{ .category = .@"application", .value = "application/x-eva" };
- pub const @"application/x-font-bdf": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-bdf" };
- pub const @"application/x-font-dos": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-dos" };
- pub const @"application/x-font-framemaker": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-framemaker" };
- pub const @"application/x-font-ghostscript": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-ghostscript" };
- pub const @"application/x-font-libgrx": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-libgrx" };
- pub const @"application/x-font-linux-psf": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-linux-psf" };
- pub const @"application/x-font-pcf": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-pcf" };
- pub const @"application/x-font-snf": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-snf" };
- pub const @"application/x-font-speedo": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-speedo" };
- pub const @"application/x-font-sunos-news": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-sunos-news" };
- pub const @"application/x-font-type1": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-type1" };
- pub const @"application/x-font-vfont": MimeType = MimeType{ .category = .@"application", .value = "application/x-font-vfont" };
- pub const @"application/x-freearc": MimeType = MimeType{ .category = .@"application", .value = "application/x-freearc" };
- pub const @"application/x-futuresplash": MimeType = MimeType{ .category = .@"application", .value = "application/x-futuresplash" };
- pub const @"application/x-gca-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-gca-compressed" };
- pub const @"application/x-glulx": MimeType = MimeType{ .category = .@"application", .value = "application/x-glulx" };
- pub const @"application/x-gnumeric": MimeType = MimeType{ .category = .@"application", .value = "application/x-gnumeric" };
- pub const @"application/x-gramps-xml": MimeType = MimeType{ .category = .@"application", .value = "application/x-gramps-xml" };
- pub const @"application/x-gtar": MimeType = MimeType{ .category = .@"application", .value = "application/x-gtar" };
- pub const @"application/x-gzip": MimeType = MimeType{ .category = .@"application", .value = "application/x-gzip" };
- pub const @"application/x-hdf": MimeType = MimeType{ .category = .@"application", .value = "application/x-hdf" };
- pub const @"application/x-httpd-php": MimeType = MimeType{ .category = .@"application", .value = "application/x-httpd-php" };
- pub const @"application/x-install-instructions": MimeType = MimeType{ .category = .@"application", .value = "application/x-install-instructions" };
- pub const @"application/x-iso9660-image": MimeType = MimeType{ .category = .@"application", .value = "application/x-iso9660-image" };
- pub const @"application/x-iwork-keynote-sffkey": MimeType = MimeType{ .category = .@"application", .value = "application/x-iwork-keynote-sffkey" };
- pub const @"application/x-iwork-numbers-sffnumbers": MimeType = MimeType{ .category = .@"application", .value = "application/x-iwork-numbers-sffnumbers" };
- pub const @"application/x-iwork-pages-sffpages": MimeType = MimeType{ .category = .@"application", .value = "application/x-iwork-pages-sffpages" };
- pub const @"application/x-java-archive-diff": MimeType = MimeType{ .category = .@"application", .value = "application/x-java-archive-diff" };
- pub const @"application/x-java-jnlp-file": MimeType = MimeType{ .category = .@"application", .value = "application/x-java-jnlp-file" };
- pub const @"application/x-javascript": MimeType = MimeType{ .category = .@"application", .value = "application/x-javascript" };
- pub const @"application/x-keepass2": MimeType = MimeType{ .category = .@"application", .value = "application/x-keepass2" };
- pub const @"application/x-latex": MimeType = MimeType{ .category = .@"application", .value = "application/x-latex" };
- pub const @"application/x-lua-bytecode": MimeType = MimeType{ .category = .@"application", .value = "application/x-lua-bytecode" };
- pub const @"application/x-lzh-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-lzh-compressed" };
- pub const @"application/x-makeself": MimeType = MimeType{ .category = .@"application", .value = "application/x-makeself" };
- pub const @"application/x-mie": MimeType = MimeType{ .category = .@"application", .value = "application/x-mie" };
- pub const @"application/x-mobipocket-ebook": MimeType = MimeType{ .category = .@"application", .value = "application/x-mobipocket-ebook" };
- pub const @"application/x-mpegurl": MimeType = MimeType{ .category = .@"application", .value = "application/x-mpegurl" };
- pub const @"application/x-ms-application": MimeType = MimeType{ .category = .@"application", .value = "application/x-ms-application" };
- pub const @"application/x-ms-shortcut": MimeType = MimeType{ .category = .@"application", .value = "application/x-ms-shortcut" };
- pub const @"application/x-ms-wmd": MimeType = MimeType{ .category = .@"application", .value = "application/x-ms-wmd" };
- pub const @"application/x-ms-wmz": MimeType = MimeType{ .category = .@"application", .value = "application/x-ms-wmz" };
- pub const @"application/x-ms-xbap": MimeType = MimeType{ .category = .@"application", .value = "application/x-ms-xbap" };
- pub const @"application/x-msaccess": MimeType = MimeType{ .category = .@"application", .value = "application/x-msaccess" };
- pub const @"application/x-msbinder": MimeType = MimeType{ .category = .@"application", .value = "application/x-msbinder" };
- pub const @"application/x-mscardfile": MimeType = MimeType{ .category = .@"application", .value = "application/x-mscardfile" };
- pub const @"application/x-msclip": MimeType = MimeType{ .category = .@"application", .value = "application/x-msclip" };
- pub const @"application/x-msdos-program": MimeType = MimeType{ .category = .@"application", .value = "application/x-msdos-program" };
- pub const @"application/x-msdownload": MimeType = MimeType{ .category = .@"application", .value = "application/x-msdownload" };
- pub const @"application/x-msmediaview": MimeType = MimeType{ .category = .@"application", .value = "application/x-msmediaview" };
- pub const @"application/x-msmetafile": MimeType = MimeType{ .category = .@"application", .value = "application/x-msmetafile" };
- pub const @"application/x-msmoney": MimeType = MimeType{ .category = .@"application", .value = "application/x-msmoney" };
- pub const @"application/x-mspublisher": MimeType = MimeType{ .category = .@"application", .value = "application/x-mspublisher" };
- pub const @"application/x-msschedule": MimeType = MimeType{ .category = .@"application", .value = "application/x-msschedule" };
- pub const @"application/x-msterminal": MimeType = MimeType{ .category = .@"application", .value = "application/x-msterminal" };
- pub const @"application/x-mswrite": MimeType = MimeType{ .category = .@"application", .value = "application/x-mswrite" };
- pub const @"application/x-netcdf": MimeType = MimeType{ .category = .@"application", .value = "application/x-netcdf" };
- pub const @"application/x-ns-proxy-autoconfig": MimeType = MimeType{ .category = .@"application", .value = "application/x-ns-proxy-autoconfig" };
- pub const @"application/x-nzb": MimeType = MimeType{ .category = .@"application", .value = "application/x-nzb" };
- pub const @"application/x-perl": MimeType = MimeType{ .category = .@"application", .value = "application/x-perl" };
- pub const @"application/x-pilot": MimeType = MimeType{ .category = .@"application", .value = "application/x-pilot" };
- pub const @"application/x-pkcs12": MimeType = MimeType{ .category = .@"application", .value = "application/x-pkcs12" };
- pub const @"application/x-pkcs7-certificates": MimeType = MimeType{ .category = .@"application", .value = "application/x-pkcs7-certificates" };
- pub const @"application/x-pkcs7-certreqresp": MimeType = MimeType{ .category = .@"application", .value = "application/x-pkcs7-certreqresp" };
- pub const @"application/x-pki-message": MimeType = MimeType{ .category = .@"application", .value = "application/x-pki-message" };
- pub const @"application/x-rar-compressed": MimeType = MimeType{ .category = .@"application", .value = "application/x-rar-compressed" };
- pub const @"application/x-redhat-package-manager": MimeType = MimeType{ .category = .@"application", .value = "application/x-redhat-package-manager" };
- pub const @"application/x-research-info-systems": MimeType = MimeType{ .category = .@"application", .value = "application/x-research-info-systems" };
- pub const @"application/x-sea": MimeType = MimeType{ .category = .@"application", .value = "application/x-sea" };
- pub const @"application/x-sh": MimeType = MimeType{ .category = .@"application", .value = "application/x-sh" };
- pub const @"application/x-shar": MimeType = MimeType{ .category = .@"application", .value = "application/x-shar" };
- pub const @"application/x-shockwave-flash": MimeType = MimeType{ .category = .@"application", .value = "application/x-shockwave-flash" };
- pub const @"application/x-silverlight-app": MimeType = MimeType{ .category = .@"application", .value = "application/x-silverlight-app" };
- pub const @"application/x-sql": MimeType = MimeType{ .category = .@"application", .value = "application/x-sql" };
- pub const @"application/x-stuffit": MimeType = MimeType{ .category = .@"application", .value = "application/x-stuffit" };
- pub const @"application/x-stuffitx": MimeType = MimeType{ .category = .@"application", .value = "application/x-stuffitx" };
- pub const @"application/x-subrip": MimeType = MimeType{ .category = .@"application", .value = "application/x-subrip" };
- pub const @"application/x-sv4cpio": MimeType = MimeType{ .category = .@"application", .value = "application/x-sv4cpio" };
- pub const @"application/x-sv4crc": MimeType = MimeType{ .category = .@"application", .value = "application/x-sv4crc" };
- pub const @"application/x-t3vm-image": MimeType = MimeType{ .category = .@"application", .value = "application/x-t3vm-image" };
- pub const @"application/x-tads": MimeType = MimeType{ .category = .@"application", .value = "application/x-tads" };
- pub const @"application/x-tar": MimeType = MimeType{ .category = .@"application", .value = "application/x-tar" };
- pub const @"application/x-tcl": MimeType = MimeType{ .category = .@"application", .value = "application/x-tcl" };
- pub const @"application/x-tex": MimeType = MimeType{ .category = .@"application", .value = "application/x-tex" };
- pub const @"application/x-tex-tfm": MimeType = MimeType{ .category = .@"application", .value = "application/x-tex-tfm" };
- pub const @"application/x-texinfo": MimeType = MimeType{ .category = .@"application", .value = "application/x-texinfo" };
- pub const @"application/x-tgif": MimeType = MimeType{ .category = .@"application", .value = "application/x-tgif" };
- pub const @"application/x-ustar": MimeType = MimeType{ .category = .@"application", .value = "application/x-ustar" };
- pub const @"application/x-virtualbox-hdd": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-hdd" };
- pub const @"application/x-virtualbox-ova": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-ova" };
- pub const @"application/x-virtualbox-ovf": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-ovf" };
- pub const @"application/x-virtualbox-vbox": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-vbox" };
- pub const @"application/x-virtualbox-vbox-extpack": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-vbox-extpack" };
- pub const @"application/x-virtualbox-vdi": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-vdi" };
- pub const @"application/x-virtualbox-vhd": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-vhd" };
- pub const @"application/x-virtualbox-vmdk": MimeType = MimeType{ .category = .@"application", .value = "application/x-virtualbox-vmdk" };
- pub const @"application/x-wais-source": MimeType = MimeType{ .category = .@"application", .value = "application/x-wais-source" };
- pub const @"application/x-web-app-manifest+json": MimeType = MimeType{ .category = .@"application", .value = "application/x-web-app-manifest+json" };
- pub const @"application/x-www-form-urlencoded": MimeType = MimeType{ .category = .@"application", .value = "application/x-www-form-urlencoded" };
- pub const @"application/x-x509-ca-cert": MimeType = MimeType{ .category = .@"application", .value = "application/x-x509-ca-cert" };
- pub const @"application/x-x509-ca-ra-cert": MimeType = MimeType{ .category = .@"application", .value = "application/x-x509-ca-ra-cert" };
- pub const @"application/x-x509-next-ca-cert": MimeType = MimeType{ .category = .@"application", .value = "application/x-x509-next-ca-cert" };
- pub const @"application/x-xfig": MimeType = MimeType{ .category = .@"application", .value = "application/x-xfig" };
- pub const @"application/x-xliff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/x-xliff+xml" };
- pub const @"application/x-xpinstall": MimeType = MimeType{ .category = .@"application", .value = "application/x-xpinstall" };
- pub const @"application/x-xz": MimeType = MimeType{ .category = .@"application", .value = "application/x-xz" };
- pub const @"application/x-zmachine": MimeType = MimeType{ .category = .@"application", .value = "application/x-zmachine" };
- pub const @"application/x400-bp": MimeType = MimeType{ .category = .@"application", .value = "application/x400-bp" };
- pub const @"application/xacml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xacml+xml" };
- pub const @"application/xaml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xaml+xml" };
- pub const @"application/xcap-att+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-att+xml" };
- pub const @"application/xcap-caps+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-caps+xml" };
- pub const @"application/xcap-diff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-diff+xml" };
- pub const @"application/xcap-el+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-el+xml" };
- pub const @"application/xcap-error+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-error+xml" };
- pub const @"application/xcap-ns+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcap-ns+xml" };
- pub const @"application/xcon-conference-info+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcon-conference-info+xml" };
- pub const @"application/xcon-conference-info-diff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xcon-conference-info-diff+xml" };
- pub const @"application/xenc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xenc+xml" };
- pub const @"application/xhtml+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xhtml+xml" };
- pub const @"application/xhtml-voice+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xhtml-voice+xml" };
- pub const @"application/xliff+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xliff+xml" };
- pub const @"application/xml": MimeType = MimeType{ .category = .@"application", .value = "application/xml" };
- pub const @"application/xml-dtd": MimeType = MimeType{ .category = .@"application", .value = "application/xml-dtd" };
- pub const @"application/xml-external-parsed-entity": MimeType = MimeType{ .category = .@"application", .value = "application/xml-external-parsed-entity" };
- pub const @"application/xml-patch+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xml-patch+xml" };
- pub const @"application/xmpp+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xmpp+xml" };
- pub const @"application/xop+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xop+xml" };
- pub const @"application/xproc+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xproc+xml" };
- pub const @"application/xslt+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xslt+xml" };
- pub const @"application/xspf+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xspf+xml" };
- pub const @"application/xv+xml": MimeType = MimeType{ .category = .@"application", .value = "application/xv+xml" };
- pub const @"application/yang": MimeType = MimeType{ .category = .@"application", .value = "application/yang" };
- pub const @"application/yang-data+json": MimeType = MimeType{ .category = .@"application", .value = "application/yang-data+json" };
- pub const @"application/yang-data+xml": MimeType = MimeType{ .category = .@"application", .value = "application/yang-data+xml" };
- pub const @"application/yang-patch+json": MimeType = MimeType{ .category = .@"application", .value = "application/yang-patch+json" };
- pub const @"application/yang-patch+xml": MimeType = MimeType{ .category = .@"application", .value = "application/yang-patch+xml" };
- pub const @"application/yin+xml": MimeType = MimeType{ .category = .@"application", .value = "application/yin+xml" };
- pub const @"application/zip": MimeType = MimeType{ .category = .@"application", .value = "application/zip" };
- pub const @"application/zlib": MimeType = MimeType{ .category = .@"application", .value = "application/zlib" };
- pub const @"application/zstd": MimeType = MimeType{ .category = .@"application", .value = "application/zstd" };
- pub const @"audio/1d-interleaved-parityfec": MimeType = MimeType{ .category = .@"audio", .value = "audio/1d-interleaved-parityfec" };
- pub const @"audio/32kadpcm": MimeType = MimeType{ .category = .@"audio", .value = "audio/32kadpcm" };
- pub const @"audio/3gpp": MimeType = MimeType{ .category = .@"audio", .value = "audio/3gpp" };
- pub const @"audio/3gpp2": MimeType = MimeType{ .category = .@"audio", .value = "audio/3gpp2" };
- pub const @"audio/aac": MimeType = MimeType{ .category = .@"audio", .value = "audio/aac" };
- pub const @"audio/ac3": MimeType = MimeType{ .category = .@"audio", .value = "audio/ac3" };
- pub const @"audio/adpcm": MimeType = MimeType{ .category = .@"audio", .value = "audio/adpcm" };
- pub const @"audio/amr": MimeType = MimeType{ .category = .@"audio", .value = "audio/amr" };
- pub const @"audio/amr-wb": MimeType = MimeType{ .category = .@"audio", .value = "audio/amr-wb" };
- pub const @"audio/amr-wb+": MimeType = MimeType{ .category = .@"audio", .value = "audio/amr-wb+" };
- pub const @"audio/aptx": MimeType = MimeType{ .category = .@"audio", .value = "audio/aptx" };
- pub const @"audio/asc": MimeType = MimeType{ .category = .@"audio", .value = "audio/asc" };
- pub const @"audio/atrac-advanced-lossless": MimeType = MimeType{ .category = .@"audio", .value = "audio/atrac-advanced-lossless" };
- pub const @"audio/atrac-x": MimeType = MimeType{ .category = .@"audio", .value = "audio/atrac-x" };
- pub const @"audio/atrac3": MimeType = MimeType{ .category = .@"audio", .value = "audio/atrac3" };
- pub const @"audio/basic": MimeType = MimeType{ .category = .@"audio", .value = "audio/basic" };
- pub const @"audio/bv16": MimeType = MimeType{ .category = .@"audio", .value = "audio/bv16" };
- pub const @"audio/bv32": MimeType = MimeType{ .category = .@"audio", .value = "audio/bv32" };
- pub const @"audio/clearmode": MimeType = MimeType{ .category = .@"audio", .value = "audio/clearmode" };
- pub const @"audio/cn": MimeType = MimeType{ .category = .@"audio", .value = "audio/cn" };
- pub const @"audio/dat12": MimeType = MimeType{ .category = .@"audio", .value = "audio/dat12" };
- pub const @"audio/dls": MimeType = MimeType{ .category = .@"audio", .value = "audio/dls" };
- pub const @"audio/dsr-es201108": MimeType = MimeType{ .category = .@"audio", .value = "audio/dsr-es201108" };
- pub const @"audio/dsr-es202050": MimeType = MimeType{ .category = .@"audio", .value = "audio/dsr-es202050" };
- pub const @"audio/dsr-es202211": MimeType = MimeType{ .category = .@"audio", .value = "audio/dsr-es202211" };
- pub const @"audio/dsr-es202212": MimeType = MimeType{ .category = .@"audio", .value = "audio/dsr-es202212" };
- pub const @"audio/dv": MimeType = MimeType{ .category = .@"audio", .value = "audio/dv" };
- pub const @"audio/dvi4": MimeType = MimeType{ .category = .@"audio", .value = "audio/dvi4" };
- pub const @"audio/eac3": MimeType = MimeType{ .category = .@"audio", .value = "audio/eac3" };
- pub const @"audio/encaprtp": MimeType = MimeType{ .category = .@"audio", .value = "audio/encaprtp" };
- pub const @"audio/evrc": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrc" };
- pub const @"audio/evrc-qcp": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrc-qcp" };
- pub const @"audio/evrc0": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrc0" };
- pub const @"audio/evrc1": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrc1" };
- pub const @"audio/evrcb": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcb" };
- pub const @"audio/evrcb0": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcb0" };
- pub const @"audio/evrcb1": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcb1" };
- pub const @"audio/evrcnw": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcnw" };
- pub const @"audio/evrcnw0": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcnw0" };
- pub const @"audio/evrcnw1": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcnw1" };
- pub const @"audio/evrcwb": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcwb" };
- pub const @"audio/evrcwb0": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcwb0" };
- pub const @"audio/evrcwb1": MimeType = MimeType{ .category = .@"audio", .value = "audio/evrcwb1" };
- pub const @"audio/evs": MimeType = MimeType{ .category = .@"audio", .value = "audio/evs" };
- pub const @"audio/flexfec": MimeType = MimeType{ .category = .@"audio", .value = "audio/flexfec" };
- pub const @"audio/fwdred": MimeType = MimeType{ .category = .@"audio", .value = "audio/fwdred" };
- pub const @"audio/g711-0": MimeType = MimeType{ .category = .@"audio", .value = "audio/g711-0" };
- pub const @"audio/g719": MimeType = MimeType{ .category = .@"audio", .value = "audio/g719" };
- pub const @"audio/g722": MimeType = MimeType{ .category = .@"audio", .value = "audio/g722" };
- pub const @"audio/g7221": MimeType = MimeType{ .category = .@"audio", .value = "audio/g7221" };
- pub const @"audio/g723": MimeType = MimeType{ .category = .@"audio", .value = "audio/g723" };
- pub const @"audio/g726-16": MimeType = MimeType{ .category = .@"audio", .value = "audio/g726-16" };
- pub const @"audio/g726-24": MimeType = MimeType{ .category = .@"audio", .value = "audio/g726-24" };
- pub const @"audio/g726-32": MimeType = MimeType{ .category = .@"audio", .value = "audio/g726-32" };
- pub const @"audio/g726-40": MimeType = MimeType{ .category = .@"audio", .value = "audio/g726-40" };
- pub const @"audio/g728": MimeType = MimeType{ .category = .@"audio", .value = "audio/g728" };
- pub const @"audio/g729": MimeType = MimeType{ .category = .@"audio", .value = "audio/g729" };
- pub const @"audio/g7291": MimeType = MimeType{ .category = .@"audio", .value = "audio/g7291" };
- pub const @"audio/g729d": MimeType = MimeType{ .category = .@"audio", .value = "audio/g729d" };
- pub const @"audio/g729e": MimeType = MimeType{ .category = .@"audio", .value = "audio/g729e" };
- pub const @"audio/gsm": MimeType = MimeType{ .category = .@"audio", .value = "audio/gsm" };
- pub const @"audio/gsm-efr": MimeType = MimeType{ .category = .@"audio", .value = "audio/gsm-efr" };
- pub const @"audio/gsm-hr-08": MimeType = MimeType{ .category = .@"audio", .value = "audio/gsm-hr-08" };
- pub const @"audio/ilbc": MimeType = MimeType{ .category = .@"audio", .value = "audio/ilbc" };
- pub const @"audio/ip-mr_v2.5": MimeType = MimeType{ .category = .@"audio", .value = "audio/ip-mr_v2.5" };
- pub const @"audio/isac": MimeType = MimeType{ .category = .@"audio", .value = "audio/isac" };
- pub const @"audio/l16": MimeType = MimeType{ .category = .@"audio", .value = "audio/l16" };
- pub const @"audio/l20": MimeType = MimeType{ .category = .@"audio", .value = "audio/l20" };
- pub const @"audio/l24": MimeType = MimeType{ .category = .@"audio", .value = "audio/l24" };
- pub const @"audio/l8": MimeType = MimeType{ .category = .@"audio", .value = "audio/l8" };
- pub const @"audio/lpc": MimeType = MimeType{ .category = .@"audio", .value = "audio/lpc" };
- pub const @"audio/melp": MimeType = MimeType{ .category = .@"audio", .value = "audio/melp" };
- pub const @"audio/melp1200": MimeType = MimeType{ .category = .@"audio", .value = "audio/melp1200" };
- pub const @"audio/melp2400": MimeType = MimeType{ .category = .@"audio", .value = "audio/melp2400" };
- pub const @"audio/melp600": MimeType = MimeType{ .category = .@"audio", .value = "audio/melp600" };
- pub const @"audio/mhas": MimeType = MimeType{ .category = .@"audio", .value = "audio/mhas" };
- pub const @"audio/midi": MimeType = MimeType{ .category = .@"audio", .value = "audio/midi" };
- pub const @"audio/mobile-xmf": MimeType = MimeType{ .category = .@"audio", .value = "audio/mobile-xmf" };
- pub const @"audio/mp3": MimeType = MimeType{ .category = .@"audio", .value = "audio/mp3" };
- pub const @"audio/mp4": MimeType = MimeType{ .category = .@"audio", .value = "audio/mp4" };
- pub const @"audio/mp4a-latm": MimeType = MimeType{ .category = .@"audio", .value = "audio/mp4a-latm" };
- pub const @"audio/mpa": MimeType = MimeType{ .category = .@"audio", .value = "audio/mpa" };
- pub const @"audio/mpa-robust": MimeType = MimeType{ .category = .@"audio", .value = "audio/mpa-robust" };
- pub const @"audio/mpeg": MimeType = MimeType{ .category = .@"audio", .value = "audio/mpeg" };
- pub const @"audio/mpeg4-generic": MimeType = MimeType{ .category = .@"audio", .value = "audio/mpeg4-generic" };
- pub const @"audio/musepack": MimeType = MimeType{ .category = .@"audio", .value = "audio/musepack" };
- pub const @"audio/ogg": MimeType = MimeType{ .category = .@"audio", .value = "audio/ogg" };
- pub const @"audio/opus": MimeType = MimeType{ .category = .@"audio", .value = "audio/opus" };
- pub const @"audio/parityfec": MimeType = MimeType{ .category = .@"audio", .value = "audio/parityfec" };
- pub const @"audio/pcma": MimeType = MimeType{ .category = .@"audio", .value = "audio/pcma" };
- pub const @"audio/pcma-wb": MimeType = MimeType{ .category = .@"audio", .value = "audio/pcma-wb" };
- pub const @"audio/pcmu": MimeType = MimeType{ .category = .@"audio", .value = "audio/pcmu" };
- pub const @"audio/pcmu-wb": MimeType = MimeType{ .category = .@"audio", .value = "audio/pcmu-wb" };
- pub const @"audio/prs.sid": MimeType = MimeType{ .category = .@"audio", .value = "audio/prs.sid" };
- pub const @"audio/qcelp": MimeType = MimeType{ .category = .@"audio", .value = "audio/qcelp" };
- pub const @"audio/raptorfec": MimeType = MimeType{ .category = .@"audio", .value = "audio/raptorfec" };
- pub const @"audio/red": MimeType = MimeType{ .category = .@"audio", .value = "audio/red" };
- pub const @"audio/rtp-enc-aescm128": MimeType = MimeType{ .category = .@"audio", .value = "audio/rtp-enc-aescm128" };
- pub const @"audio/rtp-midi": MimeType = MimeType{ .category = .@"audio", .value = "audio/rtp-midi" };
- pub const @"audio/rtploopback": MimeType = MimeType{ .category = .@"audio", .value = "audio/rtploopback" };
- pub const @"audio/rtx": MimeType = MimeType{ .category = .@"audio", .value = "audio/rtx" };
- pub const @"audio/s3m": MimeType = MimeType{ .category = .@"audio", .value = "audio/s3m" };
- pub const @"audio/scip": MimeType = MimeType{ .category = .@"audio", .value = "audio/scip" };
- pub const @"audio/silk": MimeType = MimeType{ .category = .@"audio", .value = "audio/silk" };
- pub const @"audio/smv": MimeType = MimeType{ .category = .@"audio", .value = "audio/smv" };
- pub const @"audio/smv-qcp": MimeType = MimeType{ .category = .@"audio", .value = "audio/smv-qcp" };
- pub const @"audio/smv0": MimeType = MimeType{ .category = .@"audio", .value = "audio/smv0" };
- pub const @"audio/sofa": MimeType = MimeType{ .category = .@"audio", .value = "audio/sofa" };
- pub const @"audio/sp-midi": MimeType = MimeType{ .category = .@"audio", .value = "audio/sp-midi" };
- pub const @"audio/speex": MimeType = MimeType{ .category = .@"audio", .value = "audio/speex" };
- pub const @"audio/t140c": MimeType = MimeType{ .category = .@"audio", .value = "audio/t140c" };
- pub const @"audio/t38": MimeType = MimeType{ .category = .@"audio", .value = "audio/t38" };
- pub const @"audio/telephone-event": MimeType = MimeType{ .category = .@"audio", .value = "audio/telephone-event" };
- pub const @"audio/tetra_acelp": MimeType = MimeType{ .category = .@"audio", .value = "audio/tetra_acelp" };
- pub const @"audio/tetra_acelp_bb": MimeType = MimeType{ .category = .@"audio", .value = "audio/tetra_acelp_bb" };
- pub const @"audio/tone": MimeType = MimeType{ .category = .@"audio", .value = "audio/tone" };
- pub const @"audio/tsvcis": MimeType = MimeType{ .category = .@"audio", .value = "audio/tsvcis" };
- pub const @"audio/uemclip": MimeType = MimeType{ .category = .@"audio", .value = "audio/uemclip" };
- pub const @"audio/ulpfec": MimeType = MimeType{ .category = .@"audio", .value = "audio/ulpfec" };
- pub const @"audio/usac": MimeType = MimeType{ .category = .@"audio", .value = "audio/usac" };
- pub const @"audio/vdvi": MimeType = MimeType{ .category = .@"audio", .value = "audio/vdvi" };
- pub const @"audio/vmr-wb": MimeType = MimeType{ .category = .@"audio", .value = "audio/vmr-wb" };
- pub const @"audio/vnd.3gpp.iufp": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.3gpp.iufp" };
- pub const @"audio/vnd.4sb": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.4sb" };
- pub const @"audio/vnd.audiokoz": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.audiokoz" };
- pub const @"audio/vnd.celp": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.celp" };
- pub const @"audio/vnd.cisco.nse": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.cisco.nse" };
- pub const @"audio/vnd.cmles.radio-events": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.cmles.radio-events" };
- pub const @"audio/vnd.cns.anp1": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.cns.anp1" };
- pub const @"audio/vnd.cns.inf1": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.cns.inf1" };
- pub const @"audio/vnd.dece.audio": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dece.audio" };
- pub const @"audio/vnd.digital-winds": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.digital-winds" };
- pub const @"audio/vnd.dlna.adts": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dlna.adts" };
- pub const @"audio/vnd.dolby.heaac.1": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.heaac.1" };
- pub const @"audio/vnd.dolby.heaac.2": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.heaac.2" };
- pub const @"audio/vnd.dolby.mlp": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.mlp" };
- pub const @"audio/vnd.dolby.mps": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.mps" };
- pub const @"audio/vnd.dolby.pl2": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.pl2" };
- pub const @"audio/vnd.dolby.pl2x": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.pl2x" };
- pub const @"audio/vnd.dolby.pl2z": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.pl2z" };
- pub const @"audio/vnd.dolby.pulse.1": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dolby.pulse.1" };
- pub const @"audio/vnd.dra": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dra" };
- pub const @"audio/vnd.dts": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dts" };
- pub const @"audio/vnd.dts.hd": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dts.hd" };
- pub const @"audio/vnd.dts.uhd": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dts.uhd" };
- pub const @"audio/vnd.dvb.file": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.dvb.file" };
- pub const @"audio/vnd.everad.plj": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.everad.plj" };
- pub const @"audio/vnd.hns.audio": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.hns.audio" };
- pub const @"audio/vnd.lucent.voice": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.lucent.voice" };
- pub const @"audio/vnd.ms-playready.media.pya": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.ms-playready.media.pya" };
- pub const @"audio/vnd.nokia.mobile-xmf": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.nokia.mobile-xmf" };
- pub const @"audio/vnd.nortel.vbk": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.nortel.vbk" };
- pub const @"audio/vnd.nuera.ecelp4800": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.nuera.ecelp4800" };
- pub const @"audio/vnd.nuera.ecelp7470": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.nuera.ecelp7470" };
- pub const @"audio/vnd.nuera.ecelp9600": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.nuera.ecelp9600" };
- pub const @"audio/vnd.octel.sbc": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.octel.sbc" };
- pub const @"audio/vnd.presonus.multitrack": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.presonus.multitrack" };
- pub const @"audio/vnd.qcelp": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.qcelp" };
- pub const @"audio/vnd.rhetorex.32kadpcm": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.rhetorex.32kadpcm" };
- pub const @"audio/vnd.rip": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.rip" };
- pub const @"audio/vnd.rn-realaudio": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.rn-realaudio" };
- pub const @"audio/vnd.sealedmedia.softseal.mpeg": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.sealedmedia.softseal.mpeg" };
- pub const @"audio/vnd.vmx.cvsd": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.vmx.cvsd" };
- pub const @"audio/vnd.wave": MimeType = MimeType{ .category = .@"audio", .value = "audio/vnd.wave" };
- pub const @"audio/vorbis": MimeType = MimeType{ .category = .@"audio", .value = "audio/vorbis" };
- pub const @"audio/vorbis-config": MimeType = MimeType{ .category = .@"audio", .value = "audio/vorbis-config" };
- pub const @"audio/wav": MimeType = MimeType{ .category = .@"audio", .value = "audio/wav" };
- pub const @"audio/wave": MimeType = MimeType{ .category = .@"audio", .value = "audio/wave" };
- pub const @"audio/webm": MimeType = MimeType{ .category = .@"audio", .value = "audio/webm" };
- pub const @"audio/x-aac": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-aac" };
- pub const @"audio/x-aiff": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-aiff" };
- pub const @"audio/x-caf": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-caf" };
- pub const @"audio/x-flac": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-flac" };
- pub const @"audio/x-m4a": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-m4a" };
- pub const @"audio/x-matroska": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-matroska" };
- pub const @"audio/x-mpegurl": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-mpegurl" };
- pub const @"audio/x-ms-wax": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-ms-wax" };
- pub const @"audio/x-ms-wma": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-ms-wma" };
- pub const @"audio/x-pn-realaudio": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-pn-realaudio" };
- pub const @"audio/x-pn-realaudio-plugin": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-pn-realaudio-plugin" };
- pub const @"audio/x-realaudio": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-realaudio" };
- pub const @"audio/x-tta": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-tta" };
- pub const @"audio/x-wav": MimeType = MimeType{ .category = .@"audio", .value = "audio/x-wav" };
- pub const @"audio/xm": MimeType = MimeType{ .category = .@"audio", .value = "audio/xm" };
- pub const @"chemical/x-cdx": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-cdx" };
- pub const @"chemical/x-cif": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-cif" };
- pub const @"chemical/x-cmdf": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-cmdf" };
- pub const @"chemical/x-cml": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-cml" };
- pub const @"chemical/x-csml": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-csml" };
- pub const @"chemical/x-pdb": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-pdb" };
- pub const @"chemical/x-xyz": MimeType = MimeType{ .category = .@"chemical", .value = "chemical/x-xyz" };
- pub const @"font/collection": MimeType = MimeType{ .category = .@"font", .value = "font/collection" };
- pub const @"font/otf": MimeType = MimeType{ .category = .@"font", .value = "font/otf" };
- pub const @"font/sfnt": MimeType = MimeType{ .category = .@"font", .value = "font/sfnt" };
- pub const @"font/ttf": MimeType = MimeType{ .category = .@"font", .value = "font/ttf" };
- pub const @"font/woff": MimeType = MimeType{ .category = .@"font", .value = "font/woff" };
- pub const @"font/woff2": MimeType = MimeType{ .category = .@"font", .value = "font/woff2" };
- pub const @"image/aces": MimeType = MimeType{ .category = .@"image", .value = "image/aces" };
- pub const @"image/apng": MimeType = MimeType{ .category = .@"image", .value = "image/apng" };
- pub const @"image/avci": MimeType = MimeType{ .category = .@"image", .value = "image/avci" };
- pub const @"image/avcs": MimeType = MimeType{ .category = .@"image", .value = "image/avcs" };
- pub const @"image/avif": MimeType = MimeType{ .category = .@"image", .value = "image/avif" };
- pub const @"image/bmp": MimeType = MimeType{ .category = .@"image", .value = "image/bmp" };
- pub const @"image/cgm": MimeType = MimeType{ .category = .@"image", .value = "image/cgm" };
- pub const @"image/dicom-rle": MimeType = MimeType{ .category = .@"image", .value = "image/dicom-rle" };
- pub const @"image/emf": MimeType = MimeType{ .category = .@"image", .value = "image/emf" };
- pub const @"image/fits": MimeType = MimeType{ .category = .@"image", .value = "image/fits" };
- pub const @"image/g3fax": MimeType = MimeType{ .category = .@"image", .value = "image/g3fax" };
- pub const @"image/gif": MimeType = MimeType{ .category = .@"image", .value = "image/gif" };
- pub const @"image/heic": MimeType = MimeType{ .category = .@"image", .value = "image/heic" };
- pub const @"image/heic-sequence": MimeType = MimeType{ .category = .@"image", .value = "image/heic-sequence" };
- pub const @"image/heif": MimeType = MimeType{ .category = .@"image", .value = "image/heif" };
- pub const @"image/heif-sequence": MimeType = MimeType{ .category = .@"image", .value = "image/heif-sequence" };
- pub const @"image/hej2k": MimeType = MimeType{ .category = .@"image", .value = "image/hej2k" };
- pub const @"image/hsj2": MimeType = MimeType{ .category = .@"image", .value = "image/hsj2" };
- pub const @"image/ief": MimeType = MimeType{ .category = .@"image", .value = "image/ief" };
- pub const @"image/jls": MimeType = MimeType{ .category = .@"image", .value = "image/jls" };
- pub const @"image/jp2": MimeType = MimeType{ .category = .@"image", .value = "image/jp2" };
- pub const @"image/jpeg": MimeType = MimeType{ .category = .@"image", .value = "image/jpeg" };
- pub const @"image/jph": MimeType = MimeType{ .category = .@"image", .value = "image/jph" };
- pub const @"image/jphc": MimeType = MimeType{ .category = .@"image", .value = "image/jphc" };
- pub const @"image/jpm": MimeType = MimeType{ .category = .@"image", .value = "image/jpm" };
- pub const @"image/jpx": MimeType = MimeType{ .category = .@"image", .value = "image/jpx" };
- pub const @"image/jxr": MimeType = MimeType{ .category = .@"image", .value = "image/jxr" };
- pub const @"image/jxra": MimeType = MimeType{ .category = .@"image", .value = "image/jxra" };
- pub const @"image/jxrs": MimeType = MimeType{ .category = .@"image", .value = "image/jxrs" };
- pub const @"image/jxs": MimeType = MimeType{ .category = .@"image", .value = "image/jxs" };
- pub const @"image/jxsc": MimeType = MimeType{ .category = .@"image", .value = "image/jxsc" };
- pub const @"image/jxsi": MimeType = MimeType{ .category = .@"image", .value = "image/jxsi" };
- pub const @"image/jxss": MimeType = MimeType{ .category = .@"image", .value = "image/jxss" };
- pub const @"image/ktx": MimeType = MimeType{ .category = .@"image", .value = "image/ktx" };
- pub const @"image/ktx2": MimeType = MimeType{ .category = .@"image", .value = "image/ktx2" };
- pub const @"image/naplps": MimeType = MimeType{ .category = .@"image", .value = "image/naplps" };
- pub const @"image/pjpeg": MimeType = MimeType{ .category = .@"image", .value = "image/pjpeg" };
- pub const @"image/png": MimeType = MimeType{ .category = .@"image", .value = "image/png" };
- pub const @"image/prs.btif": MimeType = MimeType{ .category = .@"image", .value = "image/prs.btif" };
- pub const @"image/prs.pti": MimeType = MimeType{ .category = .@"image", .value = "image/prs.pti" };
- pub const @"image/pwg-raster": MimeType = MimeType{ .category = .@"image", .value = "image/pwg-raster" };
- pub const @"image/sgi": MimeType = MimeType{ .category = .@"image", .value = "image/sgi" };
- pub const @"image/svg+xml": MimeType = MimeType{ .category = .@"image", .value = "image/svg+xml" };
- pub const @"image/t38": MimeType = MimeType{ .category = .@"image", .value = "image/t38" };
- pub const @"image/tiff": MimeType = MimeType{ .category = .@"image", .value = "image/tiff" };
- pub const @"image/tiff-fx": MimeType = MimeType{ .category = .@"image", .value = "image/tiff-fx" };
- pub const @"image/vnd.adobe.photoshop": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.adobe.photoshop" };
- pub const @"image/vnd.airzip.accelerator.azv": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.airzip.accelerator.azv" };
- pub const @"image/vnd.cns.inf2": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.cns.inf2" };
- pub const @"image/vnd.dece.graphic": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.dece.graphic" };
- pub const @"image/vnd.djvu": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.djvu" };
- pub const @"image/vnd.dvb.subtitle": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.dvb.subtitle" };
- pub const @"image/vnd.dwg": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.dwg" };
- pub const @"image/vnd.dxf": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.dxf" };
- pub const @"image/vnd.fastbidsheet": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.fastbidsheet" };
- pub const @"image/vnd.fpx": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.fpx" };
- pub const @"image/vnd.fst": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.fst" };
- pub const @"image/vnd.fujixerox.edmics-mmr": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.fujixerox.edmics-mmr" };
- pub const @"image/vnd.fujixerox.edmics-rlc": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.fujixerox.edmics-rlc" };
- pub const @"image/vnd.globalgraphics.pgb": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.globalgraphics.pgb" };
+ pub const @"application/json-patch+json": MimeType = MimeType{ .category = .application, .value = "application/json-patch+json" };
+ pub const @"application/json-seq": MimeType = MimeType{ .category = .application, .value = "application/json-seq" };
+ pub const @"application/json5": MimeType = MimeType{ .category = .application, .value = "application/json5" };
+ pub const @"application/jsonml+json": MimeType = MimeType{ .category = .application, .value = "application/jsonml+json" };
+ pub const @"application/jwk+json": MimeType = MimeType{ .category = .application, .value = "application/jwk+json" };
+ pub const @"application/jwk-set+json": MimeType = MimeType{ .category = .application, .value = "application/jwk-set+json" };
+ pub const @"application/jwt": MimeType = MimeType{ .category = .application, .value = "application/jwt" };
+ pub const @"application/kpml-request+xml": MimeType = MimeType{ .category = .application, .value = "application/kpml-request+xml" };
+ pub const @"application/kpml-response+xml": MimeType = MimeType{ .category = .application, .value = "application/kpml-response+xml" };
+ pub const @"application/ld+json": MimeType = MimeType{ .category = .application, .value = "application/ld+json" };
+ pub const @"application/lgr+xml": MimeType = MimeType{ .category = .application, .value = "application/lgr+xml" };
+ pub const @"application/link-format": MimeType = MimeType{ .category = .application, .value = "application/link-format" };
+ pub const @"application/load-control+xml": MimeType = MimeType{ .category = .application, .value = "application/load-control+xml" };
+ pub const @"application/lost+xml": MimeType = MimeType{ .category = .application, .value = "application/lost+xml" };
+ pub const @"application/lostsync+xml": MimeType = MimeType{ .category = .application, .value = "application/lostsync+xml" };
+ pub const @"application/lpf+zip": MimeType = MimeType{ .category = .application, .value = "application/lpf+zip" };
+ pub const @"application/lxf": MimeType = MimeType{ .category = .application, .value = "application/lxf" };
+ pub const @"application/mac-binhex40": MimeType = MimeType{ .category = .application, .value = "application/mac-binhex40" };
+ pub const @"application/mac-compactpro": MimeType = MimeType{ .category = .application, .value = "application/mac-compactpro" };
+ pub const @"application/macwriteii": MimeType = MimeType{ .category = .application, .value = "application/macwriteii" };
+ pub const @"application/mads+xml": MimeType = MimeType{ .category = .application, .value = "application/mads+xml" };
+ pub const @"application/manifest+json": MimeType = MimeType{ .category = .application, .value = "application/manifest+json" };
+ pub const @"application/marc": MimeType = MimeType{ .category = .application, .value = "application/marc" };
+ pub const @"application/marcxml+xml": MimeType = MimeType{ .category = .application, .value = "application/marcxml+xml" };
+ pub const @"application/mathematica": MimeType = MimeType{ .category = .application, .value = "application/mathematica" };
+ pub const @"application/mathml+xml": MimeType = MimeType{ .category = .application, .value = "application/mathml+xml" };
+ pub const @"application/mathml-content+xml": MimeType = MimeType{ .category = .application, .value = "application/mathml-content+xml" };
+ pub const @"application/mathml-presentation+xml": MimeType = MimeType{ .category = .application, .value = "application/mathml-presentation+xml" };
+ pub const @"application/mbms-associated-procedure-description+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-associated-procedure-description+xml" };
+ pub const @"application/mbms-deregister+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-deregister+xml" };
+ pub const @"application/mbms-envelope+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-envelope+xml" };
+ pub const @"application/mbms-msk+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-msk+xml" };
+ pub const @"application/mbms-msk-response+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-msk-response+xml" };
+ pub const @"application/mbms-protection-description+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-protection-description+xml" };
+ pub const @"application/mbms-reception-report+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-reception-report+xml" };
+ pub const @"application/mbms-register+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-register+xml" };
+ pub const @"application/mbms-register-response+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-register-response+xml" };
+ pub const @"application/mbms-schedule+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-schedule+xml" };
+ pub const @"application/mbms-user-service-description+xml": MimeType = MimeType{ .category = .application, .value = "application/mbms-user-service-description+xml" };
+ pub const @"application/mbox": MimeType = MimeType{ .category = .application, .value = "application/mbox" };
+ pub const @"application/media-policy-dataset+xml": MimeType = MimeType{ .category = .application, .value = "application/media-policy-dataset+xml" };
+ pub const @"application/media_control+xml": MimeType = MimeType{ .category = .application, .value = "application/media_control+xml" };
+ pub const @"application/mediaservercontrol+xml": MimeType = MimeType{ .category = .application, .value = "application/mediaservercontrol+xml" };
+ pub const @"application/merge-patch+json": MimeType = MimeType{ .category = .application, .value = "application/merge-patch+json" };
+ pub const @"application/metalink+xml": MimeType = MimeType{ .category = .application, .value = "application/metalink+xml" };
+ pub const @"application/metalink4+xml": MimeType = MimeType{ .category = .application, .value = "application/metalink4+xml" };
+ pub const @"application/mets+xml": MimeType = MimeType{ .category = .application, .value = "application/mets+xml" };
+ pub const @"application/mf4": MimeType = MimeType{ .category = .application, .value = "application/mf4" };
+ pub const @"application/mikey": MimeType = MimeType{ .category = .application, .value = "application/mikey" };
+ pub const @"application/mipc": MimeType = MimeType{ .category = .application, .value = "application/mipc" };
+ pub const @"application/missing-blocks+cbor-seq": MimeType = MimeType{ .category = .application, .value = "application/missing-blocks+cbor-seq" };
+ pub const @"application/mmt-aei+xml": MimeType = MimeType{ .category = .application, .value = "application/mmt-aei+xml" };
+ pub const @"application/mmt-usd+xml": MimeType = MimeType{ .category = .application, .value = "application/mmt-usd+xml" };
+ pub const @"application/mods+xml": MimeType = MimeType{ .category = .application, .value = "application/mods+xml" };
+ pub const @"application/moss-keys": MimeType = MimeType{ .category = .application, .value = "application/moss-keys" };
+ pub const @"application/moss-signature": MimeType = MimeType{ .category = .application, .value = "application/moss-signature" };
+ pub const @"application/mosskey-data": MimeType = MimeType{ .category = .application, .value = "application/mosskey-data" };
+ pub const @"application/mosskey-request": MimeType = MimeType{ .category = .application, .value = "application/mosskey-request" };
+ pub const @"application/mp21": MimeType = MimeType{ .category = .application, .value = "application/mp21" };
+ pub const @"application/mp4": MimeType = MimeType{ .category = .application, .value = "application/mp4" };
+ pub const @"application/mpeg4-generic": MimeType = MimeType{ .category = .application, .value = "application/mpeg4-generic" };
+ pub const @"application/mpeg4-iod": MimeType = MimeType{ .category = .application, .value = "application/mpeg4-iod" };
+ pub const @"application/mpeg4-iod-xmt": MimeType = MimeType{ .category = .application, .value = "application/mpeg4-iod-xmt" };
+ pub const @"application/mrb-consumer+xml": MimeType = MimeType{ .category = .application, .value = "application/mrb-consumer+xml" };
+ pub const @"application/mrb-publish+xml": MimeType = MimeType{ .category = .application, .value = "application/mrb-publish+xml" };
+ pub const @"application/msc-ivr+xml": MimeType = MimeType{ .category = .application, .value = "application/msc-ivr+xml" };
+ pub const @"application/msc-mixer+xml": MimeType = MimeType{ .category = .application, .value = "application/msc-mixer+xml" };
+ pub const @"application/msword": MimeType = MimeType{ .category = .application, .value = "application/msword" };
+ pub const @"application/mud+json": MimeType = MimeType{ .category = .application, .value = "application/mud+json" };
+ pub const @"application/multipart-core": MimeType = MimeType{ .category = .application, .value = "application/multipart-core" };
+ pub const @"application/mxf": MimeType = MimeType{ .category = .application, .value = "application/mxf" };
+ pub const @"application/n-quads": MimeType = MimeType{ .category = .application, .value = "application/n-quads" };
+ pub const @"application/n-triples": MimeType = MimeType{ .category = .application, .value = "application/n-triples" };
+ pub const @"application/nasdata": MimeType = MimeType{ .category = .application, .value = "application/nasdata" };
+ pub const @"application/news-checkgroups": MimeType = MimeType{ .category = .application, .value = "application/news-checkgroups" };
+ pub const @"application/news-groupinfo": MimeType = MimeType{ .category = .application, .value = "application/news-groupinfo" };
+ pub const @"application/news-transmission": MimeType = MimeType{ .category = .application, .value = "application/news-transmission" };
+ pub const @"application/nlsml+xml": MimeType = MimeType{ .category = .application, .value = "application/nlsml+xml" };
+ pub const @"application/nss": MimeType = MimeType{ .category = .application, .value = "application/nss" };
+ pub const @"application/oauth-authz-req+jwt": MimeType = MimeType{ .category = .application, .value = "application/oauth-authz-req+jwt" };
+ pub const @"application/oblivious-dns-message": MimeType = MimeType{ .category = .application, .value = "application/oblivious-dns-message" };
+ pub const @"application/ocsp-request": MimeType = MimeType{ .category = .application, .value = "application/ocsp-request" };
+ pub const @"application/ocsp-response": MimeType = MimeType{ .category = .application, .value = "application/ocsp-response" };
+ pub const @"application/octet-stream": MimeType = MimeType{ .category = .application, .value = "application/octet-stream" };
+ pub const @"application/oda": MimeType = MimeType{ .category = .application, .value = "application/oda" };
+ pub const @"application/odm+xml": MimeType = MimeType{ .category = .application, .value = "application/odm+xml" };
+ pub const @"application/odx": MimeType = MimeType{ .category = .application, .value = "application/odx" };
+ pub const @"application/oebps-package+xml": MimeType = MimeType{ .category = .application, .value = "application/oebps-package+xml" };
+ pub const @"application/ogg": MimeType = MimeType{ .category = .application, .value = "application/ogg" };
+ pub const @"application/omdoc+xml": MimeType = MimeType{ .category = .application, .value = "application/omdoc+xml" };
+ pub const @"application/onenote": MimeType = MimeType{ .category = .application, .value = "application/onenote" };
+ pub const @"application/opc-nodeset+xml": MimeType = MimeType{ .category = .application, .value = "application/opc-nodeset+xml" };
+ pub const @"application/oscore": MimeType = MimeType{ .category = .application, .value = "application/oscore" };
+ pub const @"application/oxps": MimeType = MimeType{ .category = .application, .value = "application/oxps" };
+ pub const @"application/p21": MimeType = MimeType{ .category = .application, .value = "application/p21" };
+ pub const @"application/p21+zip": MimeType = MimeType{ .category = .application, .value = "application/p21+zip" };
+ pub const @"application/p2p-overlay+xml": MimeType = MimeType{ .category = .application, .value = "application/p2p-overlay+xml" };
+ pub const @"application/parityfec": MimeType = MimeType{ .category = .application, .value = "application/parityfec" };
+ pub const @"application/passport": MimeType = MimeType{ .category = .application, .value = "application/passport" };
+ pub const @"application/patch-ops-error+xml": MimeType = MimeType{ .category = .application, .value = "application/patch-ops-error+xml" };
+ pub const @"application/pdf": MimeType = MimeType{ .category = .application, .value = "application/pdf" };
+ pub const @"application/pdx": MimeType = MimeType{ .category = .application, .value = "application/pdx" };
+ pub const @"application/pem-certificate-chain": MimeType = MimeType{ .category = .application, .value = "application/pem-certificate-chain" };
+ pub const @"application/pgp-encrypted": MimeType = MimeType{ .category = .application, .value = "application/pgp-encrypted" };
+ pub const @"application/pgp-keys": MimeType = MimeType{ .category = .application, .value = "application/pgp-keys" };
+ pub const @"application/pgp-signature": MimeType = MimeType{ .category = .application, .value = "application/pgp-signature" };
+ pub const @"application/pics-rules": MimeType = MimeType{ .category = .application, .value = "application/pics-rules" };
+ pub const @"application/pidf+xml": MimeType = MimeType{ .category = .application, .value = "application/pidf+xml" };
+ pub const @"application/pidf-diff+xml": MimeType = MimeType{ .category = .application, .value = "application/pidf-diff+xml" };
+ pub const @"application/pkcs10": MimeType = MimeType{ .category = .application, .value = "application/pkcs10" };
+ pub const @"application/pkcs12": MimeType = MimeType{ .category = .application, .value = "application/pkcs12" };
+ pub const @"application/pkcs7-mime": MimeType = MimeType{ .category = .application, .value = "application/pkcs7-mime" };
+ pub const @"application/pkcs7-signature": MimeType = MimeType{ .category = .application, .value = "application/pkcs7-signature" };
+ pub const @"application/pkcs8": MimeType = MimeType{ .category = .application, .value = "application/pkcs8" };
+ pub const @"application/pkcs8-encrypted": MimeType = MimeType{ .category = .application, .value = "application/pkcs8-encrypted" };
+ pub const @"application/pkix-attr-cert": MimeType = MimeType{ .category = .application, .value = "application/pkix-attr-cert" };
+ pub const @"application/pkix-cert": MimeType = MimeType{ .category = .application, .value = "application/pkix-cert" };
+ pub const @"application/pkix-crl": MimeType = MimeType{ .category = .application, .value = "application/pkix-crl" };
+ pub const @"application/pkix-pkipath": MimeType = MimeType{ .category = .application, .value = "application/pkix-pkipath" };
+ pub const @"application/pkixcmp": MimeType = MimeType{ .category = .application, .value = "application/pkixcmp" };
+ pub const @"application/pls+xml": MimeType = MimeType{ .category = .application, .value = "application/pls+xml" };
+ pub const @"application/poc-settings+xml": MimeType = MimeType{ .category = .application, .value = "application/poc-settings+xml" };
+ pub const @"application/postscript": MimeType = MimeType{ .category = .application, .value = "application/postscript" };
+ pub const @"application/ppsp-tracker+json": MimeType = MimeType{ .category = .application, .value = "application/ppsp-tracker+json" };
+ pub const @"application/problem+json": MimeType = MimeType{ .category = .application, .value = "application/problem+json" };
+ pub const @"application/problem+xml": MimeType = MimeType{ .category = .application, .value = "application/problem+xml" };
+ pub const @"application/provenance+xml": MimeType = MimeType{ .category = .application, .value = "application/provenance+xml" };
+ pub const @"application/prs.alvestrand.titrax-sheet": MimeType = MimeType{ .category = .application, .value = "application/prs.alvestrand.titrax-sheet" };
+ pub const @"application/prs.cww": MimeType = MimeType{ .category = .application, .value = "application/prs.cww" };
+ pub const @"application/prs.cyn": MimeType = MimeType{ .category = .application, .value = "application/prs.cyn" };
+ pub const @"application/prs.hpub+zip": MimeType = MimeType{ .category = .application, .value = "application/prs.hpub+zip" };
+ pub const @"application/prs.nprend": MimeType = MimeType{ .category = .application, .value = "application/prs.nprend" };
+ pub const @"application/prs.plucker": MimeType = MimeType{ .category = .application, .value = "application/prs.plucker" };
+ pub const @"application/prs.rdf-xml-crypt": MimeType = MimeType{ .category = .application, .value = "application/prs.rdf-xml-crypt" };
+ pub const @"application/prs.xsf+xml": MimeType = MimeType{ .category = .application, .value = "application/prs.xsf+xml" };
+ pub const @"application/pskc+xml": MimeType = MimeType{ .category = .application, .value = "application/pskc+xml" };
+ pub const @"application/pvd+json": MimeType = MimeType{ .category = .application, .value = "application/pvd+json" };
+ pub const @"application/qsig": MimeType = MimeType{ .category = .application, .value = "application/qsig" };
+ pub const @"application/raml+yaml": MimeType = MimeType{ .category = .application, .value = "application/raml+yaml" };
+ pub const @"application/raptorfec": MimeType = MimeType{ .category = .application, .value = "application/raptorfec" };
+ pub const @"application/rdap+json": MimeType = MimeType{ .category = .application, .value = "application/rdap+json" };
+ pub const @"application/rdf+xml": MimeType = MimeType{ .category = .application, .value = "application/rdf+xml" };
+ pub const @"application/reginfo+xml": MimeType = MimeType{ .category = .application, .value = "application/reginfo+xml" };
+ pub const @"application/relax-ng-compact-syntax": MimeType = MimeType{ .category = .application, .value = "application/relax-ng-compact-syntax" };
+ pub const @"application/remote-printing": MimeType = MimeType{ .category = .application, .value = "application/remote-printing" };
+ pub const @"application/reputon+json": MimeType = MimeType{ .category = .application, .value = "application/reputon+json" };
+ pub const @"application/resource-lists+xml": MimeType = MimeType{ .category = .application, .value = "application/resource-lists+xml" };
+ pub const @"application/resource-lists-diff+xml": MimeType = MimeType{ .category = .application, .value = "application/resource-lists-diff+xml" };
+ pub const @"application/rfc+xml": MimeType = MimeType{ .category = .application, .value = "application/rfc+xml" };
+ pub const @"application/riscos": MimeType = MimeType{ .category = .application, .value = "application/riscos" };
+ pub const @"application/rlmi+xml": MimeType = MimeType{ .category = .application, .value = "application/rlmi+xml" };
+ pub const @"application/rls-services+xml": MimeType = MimeType{ .category = .application, .value = "application/rls-services+xml" };
+ pub const @"application/route-apd+xml": MimeType = MimeType{ .category = .application, .value = "application/route-apd+xml" };
+ pub const @"application/route-s-tsid+xml": MimeType = MimeType{ .category = .application, .value = "application/route-s-tsid+xml" };
+ pub const @"application/route-usd+xml": MimeType = MimeType{ .category = .application, .value = "application/route-usd+xml" };
+ pub const @"application/rpki-ghostbusters": MimeType = MimeType{ .category = .application, .value = "application/rpki-ghostbusters" };
+ pub const @"application/rpki-manifest": MimeType = MimeType{ .category = .application, .value = "application/rpki-manifest" };
+ pub const @"application/rpki-publication": MimeType = MimeType{ .category = .application, .value = "application/rpki-publication" };
+ pub const @"application/rpki-roa": MimeType = MimeType{ .category = .application, .value = "application/rpki-roa" };
+ pub const @"application/rpki-updown": MimeType = MimeType{ .category = .application, .value = "application/rpki-updown" };
+ pub const @"application/rsd+xml": MimeType = MimeType{ .category = .application, .value = "application/rsd+xml" };
+ pub const @"application/rss+xml": MimeType = MimeType{ .category = .application, .value = "application/rss+xml" };
+ pub const @"application/rtf": MimeType = MimeType{ .category = .application, .value = "application/rtf" };
+ pub const @"application/rtploopback": MimeType = MimeType{ .category = .application, .value = "application/rtploopback" };
+ pub const @"application/rtx": MimeType = MimeType{ .category = .application, .value = "application/rtx" };
+ pub const @"application/samlassertion+xml": MimeType = MimeType{ .category = .application, .value = "application/samlassertion+xml" };
+ pub const @"application/samlmetadata+xml": MimeType = MimeType{ .category = .application, .value = "application/samlmetadata+xml" };
+ pub const @"application/sarif+json": MimeType = MimeType{ .category = .application, .value = "application/sarif+json" };
+ pub const @"application/sarif-external-properties+json": MimeType = MimeType{ .category = .application, .value = "application/sarif-external-properties+json" };
+ pub const @"application/sbe": MimeType = MimeType{ .category = .application, .value = "application/sbe" };
+ pub const @"application/sbml+xml": MimeType = MimeType{ .category = .application, .value = "application/sbml+xml" };
+ pub const @"application/scaip+xml": MimeType = MimeType{ .category = .application, .value = "application/scaip+xml" };
+ pub const @"application/scim+json": MimeType = MimeType{ .category = .application, .value = "application/scim+json" };
+ pub const @"application/scvp-cv-request": MimeType = MimeType{ .category = .application, .value = "application/scvp-cv-request" };
+ pub const @"application/scvp-cv-response": MimeType = MimeType{ .category = .application, .value = "application/scvp-cv-response" };
+ pub const @"application/scvp-vp-request": MimeType = MimeType{ .category = .application, .value = "application/scvp-vp-request" };
+ pub const @"application/scvp-vp-response": MimeType = MimeType{ .category = .application, .value = "application/scvp-vp-response" };
+ pub const @"application/sdp": MimeType = MimeType{ .category = .application, .value = "application/sdp" };
+ pub const @"application/secevent+jwt": MimeType = MimeType{ .category = .application, .value = "application/secevent+jwt" };
+ pub const @"application/senml+cbor": MimeType = MimeType{ .category = .application, .value = "application/senml+cbor" };
+ pub const @"application/senml+json": MimeType = MimeType{ .category = .application, .value = "application/senml+json" };
+ pub const @"application/senml+xml": MimeType = MimeType{ .category = .application, .value = "application/senml+xml" };
+ pub const @"application/senml-etch+cbor": MimeType = MimeType{ .category = .application, .value = "application/senml-etch+cbor" };
+ pub const @"application/senml-etch+json": MimeType = MimeType{ .category = .application, .value = "application/senml-etch+json" };
+ pub const @"application/senml-exi": MimeType = MimeType{ .category = .application, .value = "application/senml-exi" };
+ pub const @"application/sensml+cbor": MimeType = MimeType{ .category = .application, .value = "application/sensml+cbor" };
+ pub const @"application/sensml+json": MimeType = MimeType{ .category = .application, .value = "application/sensml+json" };
+ pub const @"application/sensml+xml": MimeType = MimeType{ .category = .application, .value = "application/sensml+xml" };
+ pub const @"application/sensml-exi": MimeType = MimeType{ .category = .application, .value = "application/sensml-exi" };
+ pub const @"application/sep+xml": MimeType = MimeType{ .category = .application, .value = "application/sep+xml" };
+ pub const @"application/sep-exi": MimeType = MimeType{ .category = .application, .value = "application/sep-exi" };
+ pub const @"application/session-info": MimeType = MimeType{ .category = .application, .value = "application/session-info" };
+ pub const @"application/set-payment": MimeType = MimeType{ .category = .application, .value = "application/set-payment" };
+ pub const @"application/set-payment-initiation": MimeType = MimeType{ .category = .application, .value = "application/set-payment-initiation" };
+ pub const @"application/set-registration": MimeType = MimeType{ .category = .application, .value = "application/set-registration" };
+ pub const @"application/set-registration-initiation": MimeType = MimeType{ .category = .application, .value = "application/set-registration-initiation" };
+ pub const @"application/sgml": MimeType = MimeType{ .category = .application, .value = "application/sgml" };
+ pub const @"application/sgml-open-catalog": MimeType = MimeType{ .category = .application, .value = "application/sgml-open-catalog" };
+ pub const @"application/shf+xml": MimeType = MimeType{ .category = .application, .value = "application/shf+xml" };
+ pub const @"application/sieve": MimeType = MimeType{ .category = .application, .value = "application/sieve" };
+ pub const @"application/simple-filter+xml": MimeType = MimeType{ .category = .application, .value = "application/simple-filter+xml" };
+ pub const @"application/simple-message-summary": MimeType = MimeType{ .category = .application, .value = "application/simple-message-summary" };
+ pub const @"application/simplesymbolcontainer": MimeType = MimeType{ .category = .application, .value = "application/simplesymbolcontainer" };
+ pub const @"application/sipc": MimeType = MimeType{ .category = .application, .value = "application/sipc" };
+ pub const @"application/slate": MimeType = MimeType{ .category = .application, .value = "application/slate" };
+ pub const @"application/smil": MimeType = MimeType{ .category = .application, .value = "application/smil" };
+ pub const @"application/smil+xml": MimeType = MimeType{ .category = .application, .value = "application/smil+xml" };
+ pub const @"application/smpte336m": MimeType = MimeType{ .category = .application, .value = "application/smpte336m" };
+ pub const @"application/soap+fastinfoset": MimeType = MimeType{ .category = .application, .value = "application/soap+fastinfoset" };
+ pub const @"application/soap+xml": MimeType = MimeType{ .category = .application, .value = "application/soap+xml" };
+ pub const @"application/sparql-query": MimeType = MimeType{ .category = .application, .value = "application/sparql-query" };
+ pub const @"application/sparql-results+xml": MimeType = MimeType{ .category = .application, .value = "application/sparql-results+xml" };
+ pub const @"application/spdx+json": MimeType = MimeType{ .category = .application, .value = "application/spdx+json" };
+ pub const @"application/spirits-event+xml": MimeType = MimeType{ .category = .application, .value = "application/spirits-event+xml" };
+ pub const @"application/sql": MimeType = MimeType{ .category = .application, .value = "application/sql" };
+ pub const @"application/srgs": MimeType = MimeType{ .category = .application, .value = "application/srgs" };
+ pub const @"application/srgs+xml": MimeType = MimeType{ .category = .application, .value = "application/srgs+xml" };
+ pub const @"application/sru+xml": MimeType = MimeType{ .category = .application, .value = "application/sru+xml" };
+ pub const @"application/ssdl+xml": MimeType = MimeType{ .category = .application, .value = "application/ssdl+xml" };
+ pub const @"application/ssml+xml": MimeType = MimeType{ .category = .application, .value = "application/ssml+xml" };
+ pub const @"application/stix+json": MimeType = MimeType{ .category = .application, .value = "application/stix+json" };
+ pub const @"application/swid+xml": MimeType = MimeType{ .category = .application, .value = "application/swid+xml" };
+ pub const @"application/tamp-apex-update": MimeType = MimeType{ .category = .application, .value = "application/tamp-apex-update" };
+ pub const @"application/tamp-apex-update-confirm": MimeType = MimeType{ .category = .application, .value = "application/tamp-apex-update-confirm" };
+ pub const @"application/tamp-community-update": MimeType = MimeType{ .category = .application, .value = "application/tamp-community-update" };
+ pub const @"application/tamp-community-update-confirm": MimeType = MimeType{ .category = .application, .value = "application/tamp-community-update-confirm" };
+ pub const @"application/tamp-error": MimeType = MimeType{ .category = .application, .value = "application/tamp-error" };
+ pub const @"application/tamp-sequence-adjust": MimeType = MimeType{ .category = .application, .value = "application/tamp-sequence-adjust" };
+ pub const @"application/tamp-sequence-adjust-confirm": MimeType = MimeType{ .category = .application, .value = "application/tamp-sequence-adjust-confirm" };
+ pub const @"application/tamp-status-query": MimeType = MimeType{ .category = .application, .value = "application/tamp-status-query" };
+ pub const @"application/tamp-status-response": MimeType = MimeType{ .category = .application, .value = "application/tamp-status-response" };
+ pub const @"application/tamp-update": MimeType = MimeType{ .category = .application, .value = "application/tamp-update" };
+ pub const @"application/tamp-update-confirm": MimeType = MimeType{ .category = .application, .value = "application/tamp-update-confirm" };
+ pub const @"application/tar": MimeType = MimeType{ .category = .application, .value = "application/tar" };
+ pub const @"application/taxii+json": MimeType = MimeType{ .category = .application, .value = "application/taxii+json" };
+ pub const @"application/td+json": MimeType = MimeType{ .category = .application, .value = "application/td+json" };
+ pub const @"application/tei+xml": MimeType = MimeType{ .category = .application, .value = "application/tei+xml" };
+ pub const @"application/tetra_isi": MimeType = MimeType{ .category = .application, .value = "application/tetra_isi" };
+ pub const @"application/thraud+xml": MimeType = MimeType{ .category = .application, .value = "application/thraud+xml" };
+ pub const @"application/timestamp-query": MimeType = MimeType{ .category = .application, .value = "application/timestamp-query" };
+ pub const @"application/timestamp-reply": MimeType = MimeType{ .category = .application, .value = "application/timestamp-reply" };
+ pub const @"application/timestamped-data": MimeType = MimeType{ .category = .application, .value = "application/timestamped-data" };
+ pub const @"application/tlsrpt+gzip": MimeType = MimeType{ .category = .application, .value = "application/tlsrpt+gzip" };
+ pub const @"application/tlsrpt+json": MimeType = MimeType{ .category = .application, .value = "application/tlsrpt+json" };
+ pub const @"application/tnauthlist": MimeType = MimeType{ .category = .application, .value = "application/tnauthlist" };
+ pub const @"application/token-introspection+jwt": MimeType = MimeType{ .category = .application, .value = "application/token-introspection+jwt" };
+ pub const @"application/toml": MimeType = MimeType{ .category = .application, .value = "application/toml" };
+ pub const @"application/trickle-ice-sdpfrag": MimeType = MimeType{ .category = .application, .value = "application/trickle-ice-sdpfrag" };
+ pub const @"application/trig": MimeType = MimeType{ .category = .application, .value = "application/trig" };
+ pub const @"application/ttml+xml": MimeType = MimeType{ .category = .application, .value = "application/ttml+xml" };
+ pub const @"application/tve-trigger": MimeType = MimeType{ .category = .application, .value = "application/tve-trigger" };
+ pub const @"application/tzif": MimeType = MimeType{ .category = .application, .value = "application/tzif" };
+ pub const @"application/tzif-leap": MimeType = MimeType{ .category = .application, .value = "application/tzif-leap" };
+ pub const @"application/ubjson": MimeType = MimeType{ .category = .application, .value = "application/ubjson" };
+ pub const @"application/ulpfec": MimeType = MimeType{ .category = .application, .value = "application/ulpfec" };
+ pub const @"application/urc-grpsheet+xml": MimeType = MimeType{ .category = .application, .value = "application/urc-grpsheet+xml" };
+ pub const @"application/urc-ressheet+xml": MimeType = MimeType{ .category = .application, .value = "application/urc-ressheet+xml" };
+ pub const @"application/urc-targetdesc+xml": MimeType = MimeType{ .category = .application, .value = "application/urc-targetdesc+xml" };
+ pub const @"application/urc-uisocketdesc+xml": MimeType = MimeType{ .category = .application, .value = "application/urc-uisocketdesc+xml" };
+ pub const @"application/vcard+json": MimeType = MimeType{ .category = .application, .value = "application/vcard+json" };
+ pub const @"application/vcard+xml": MimeType = MimeType{ .category = .application, .value = "application/vcard+xml" };
+ pub const @"application/vemmi": MimeType = MimeType{ .category = .application, .value = "application/vemmi" };
+ pub const @"application/vividence.scriptfile": MimeType = MimeType{ .category = .application, .value = "application/vividence.scriptfile" };
+ pub const @"application/vnd.1000minds.decision-model+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.1000minds.decision-model+xml" };
+ pub const @"application/vnd.3gpp-prose+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp-prose+xml" };
+ pub const @"application/vnd.3gpp-prose-pc3ch+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp-prose-pc3ch+xml" };
+ pub const @"application/vnd.3gpp-v2x-local-service-information": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp-v2x-local-service-information" };
+ pub const @"application/vnd.3gpp.5gnas": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.5gnas" };
+ pub const @"application/vnd.3gpp.access-transfer-events+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.access-transfer-events+xml" };
+ pub const @"application/vnd.3gpp.bsf+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.bsf+xml" };
+ pub const @"application/vnd.3gpp.gmop+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.gmop+xml" };
+ pub const @"application/vnd.3gpp.gtpc": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.gtpc" };
+ pub const @"application/vnd.3gpp.interworking-data": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.interworking-data" };
+ pub const @"application/vnd.3gpp.lpp": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.lpp" };
+ pub const @"application/vnd.3gpp.mc-signalling-ear": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mc-signalling-ear" };
+ pub const @"application/vnd.3gpp.mcdata-affiliation-command+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-affiliation-command+xml" };
+ pub const @"application/vnd.3gpp.mcdata-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-info+xml" };
+ pub const @"application/vnd.3gpp.mcdata-payload": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-payload" };
+ pub const @"application/vnd.3gpp.mcdata-service-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-service-config+xml" };
+ pub const @"application/vnd.3gpp.mcdata-signalling": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-signalling" };
+ pub const @"application/vnd.3gpp.mcdata-ue-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-ue-config+xml" };
+ pub const @"application/vnd.3gpp.mcdata-user-profile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcdata-user-profile+xml" };
+ pub const @"application/vnd.3gpp.mcptt-affiliation-command+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-affiliation-command+xml" };
+ pub const @"application/vnd.3gpp.mcptt-floor-request+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-floor-request+xml" };
+ pub const @"application/vnd.3gpp.mcptt-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-info+xml" };
+ pub const @"application/vnd.3gpp.mcptt-location-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-location-info+xml" };
+ pub const @"application/vnd.3gpp.mcptt-mbms-usage-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-mbms-usage-info+xml" };
+ pub const @"application/vnd.3gpp.mcptt-service-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-service-config+xml" };
+ pub const @"application/vnd.3gpp.mcptt-signed+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-signed+xml" };
+ pub const @"application/vnd.3gpp.mcptt-ue-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-ue-config+xml" };
+ pub const @"application/vnd.3gpp.mcptt-ue-init-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-ue-init-config+xml" };
+ pub const @"application/vnd.3gpp.mcptt-user-profile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcptt-user-profile+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-affiliation-command+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-affiliation-command+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-affiliation-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-affiliation-info+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-info+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-location-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-location-info+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-mbms-usage-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-mbms-usage-info+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-service-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-service-config+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-transmission-request+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-transmission-request+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-ue-config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-ue-config+xml" };
+ pub const @"application/vnd.3gpp.mcvideo-user-profile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mcvideo-user-profile+xml" };
+ pub const @"application/vnd.3gpp.mid-call+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.mid-call+xml" };
+ pub const @"application/vnd.3gpp.ngap": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.ngap" };
+ pub const @"application/vnd.3gpp.pfcp": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.pfcp" };
+ pub const @"application/vnd.3gpp.pic-bw-large": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.pic-bw-large" };
+ pub const @"application/vnd.3gpp.pic-bw-small": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.pic-bw-small" };
+ pub const @"application/vnd.3gpp.pic-bw-var": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.pic-bw-var" };
+ pub const @"application/vnd.3gpp.s1ap": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.s1ap" };
+ pub const @"application/vnd.3gpp.sms": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.sms" };
+ pub const @"application/vnd.3gpp.sms+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.sms+xml" };
+ pub const @"application/vnd.3gpp.srvcc-ext+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.srvcc-ext+xml" };
+ pub const @"application/vnd.3gpp.srvcc-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.srvcc-info+xml" };
+ pub const @"application/vnd.3gpp.state-and-event-info+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.state-and-event-info+xml" };
+ pub const @"application/vnd.3gpp.ussd+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp.ussd+xml" };
+ pub const @"application/vnd.3gpp2.bcmcsinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp2.bcmcsinfo+xml" };
+ pub const @"application/vnd.3gpp2.sms": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp2.sms" };
+ pub const @"application/vnd.3gpp2.tcap": MimeType = MimeType{ .category = .application, .value = "application/vnd.3gpp2.tcap" };
+ pub const @"application/vnd.3lightssoftware.imagescal": MimeType = MimeType{ .category = .application, .value = "application/vnd.3lightssoftware.imagescal" };
+ pub const @"application/vnd.3m.post-it-notes": MimeType = MimeType{ .category = .application, .value = "application/vnd.3m.post-it-notes" };
+ pub const @"application/vnd.accpac.simply.aso": MimeType = MimeType{ .category = .application, .value = "application/vnd.accpac.simply.aso" };
+ pub const @"application/vnd.accpac.simply.imp": MimeType = MimeType{ .category = .application, .value = "application/vnd.accpac.simply.imp" };
+ pub const @"application/vnd.acucobol": MimeType = MimeType{ .category = .application, .value = "application/vnd.acucobol" };
+ pub const @"application/vnd.acucorp": MimeType = MimeType{ .category = .application, .value = "application/vnd.acucorp" };
+ pub const @"application/vnd.adobe.air-application-installer-package+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.air-application-installer-package+zip" };
+ pub const @"application/vnd.adobe.flash.movie": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.flash.movie" };
+ pub const @"application/vnd.adobe.formscentral.fcdt": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.formscentral.fcdt" };
+ pub const @"application/vnd.adobe.fxp": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.fxp" };
+ pub const @"application/vnd.adobe.partial-upload": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.partial-upload" };
+ pub const @"application/vnd.adobe.xdp+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.xdp+xml" };
+ pub const @"application/vnd.adobe.xfdf": MimeType = MimeType{ .category = .application, .value = "application/vnd.adobe.xfdf" };
+ pub const @"application/vnd.aether.imp": MimeType = MimeType{ .category = .application, .value = "application/vnd.aether.imp" };
+ pub const @"application/vnd.afpc.afplinedata": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.afplinedata" };
+ pub const @"application/vnd.afpc.afplinedata-pagedef": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.afplinedata-pagedef" };
+ pub const @"application/vnd.afpc.cmoca-cmresource": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.cmoca-cmresource" };
+ pub const @"application/vnd.afpc.foca-charset": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.foca-charset" };
+ pub const @"application/vnd.afpc.foca-codedfont": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.foca-codedfont" };
+ pub const @"application/vnd.afpc.foca-codepage": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.foca-codepage" };
+ pub const @"application/vnd.afpc.modca": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca" };
+ pub const @"application/vnd.afpc.modca-cmtable": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-cmtable" };
+ pub const @"application/vnd.afpc.modca-formdef": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-formdef" };
+ pub const @"application/vnd.afpc.modca-mediummap": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-mediummap" };
+ pub const @"application/vnd.afpc.modca-objectcontainer": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-objectcontainer" };
+ pub const @"application/vnd.afpc.modca-overlay": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-overlay" };
+ pub const @"application/vnd.afpc.modca-pagesegment": MimeType = MimeType{ .category = .application, .value = "application/vnd.afpc.modca-pagesegment" };
+ pub const @"application/vnd.age": MimeType = MimeType{ .category = .application, .value = "application/vnd.age" };
+ pub const @"application/vnd.ah-barcode": MimeType = MimeType{ .category = .application, .value = "application/vnd.ah-barcode" };
+ pub const @"application/vnd.ahead.space": MimeType = MimeType{ .category = .application, .value = "application/vnd.ahead.space" };
+ pub const @"application/vnd.airzip.filesecure.azf": MimeType = MimeType{ .category = .application, .value = "application/vnd.airzip.filesecure.azf" };
+ pub const @"application/vnd.airzip.filesecure.azs": MimeType = MimeType{ .category = .application, .value = "application/vnd.airzip.filesecure.azs" };
+ pub const @"application/vnd.amadeus+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.amadeus+json" };
+ pub const @"application/vnd.amazon.ebook": MimeType = MimeType{ .category = .application, .value = "application/vnd.amazon.ebook" };
+ pub const @"application/vnd.amazon.mobi8-ebook": MimeType = MimeType{ .category = .application, .value = "application/vnd.amazon.mobi8-ebook" };
+ pub const @"application/vnd.americandynamics.acc": MimeType = MimeType{ .category = .application, .value = "application/vnd.americandynamics.acc" };
+ pub const @"application/vnd.amiga.ami": MimeType = MimeType{ .category = .application, .value = "application/vnd.amiga.ami" };
+ pub const @"application/vnd.amundsen.maze+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.amundsen.maze+xml" };
+ pub const @"application/vnd.android.ota": MimeType = MimeType{ .category = .application, .value = "application/vnd.android.ota" };
+ pub const @"application/vnd.android.package-archive": MimeType = MimeType{ .category = .application, .value = "application/vnd.android.package-archive" };
+ pub const @"application/vnd.anki": MimeType = MimeType{ .category = .application, .value = "application/vnd.anki" };
+ pub const @"application/vnd.anser-web-certificate-issue-initiation": MimeType = MimeType{ .category = .application, .value = "application/vnd.anser-web-certificate-issue-initiation" };
+ pub const @"application/vnd.anser-web-funds-transfer-initiation": MimeType = MimeType{ .category = .application, .value = "application/vnd.anser-web-funds-transfer-initiation" };
+ pub const @"application/vnd.antix.game-component": MimeType = MimeType{ .category = .application, .value = "application/vnd.antix.game-component" };
+ pub const @"application/vnd.apache.arrow.file": MimeType = MimeType{ .category = .application, .value = "application/vnd.apache.arrow.file" };
+ pub const @"application/vnd.apache.arrow.stream": MimeType = MimeType{ .category = .application, .value = "application/vnd.apache.arrow.stream" };
+ pub const @"application/vnd.apache.thrift.binary": MimeType = MimeType{ .category = .application, .value = "application/vnd.apache.thrift.binary" };
+ pub const @"application/vnd.apache.thrift.compact": MimeType = MimeType{ .category = .application, .value = "application/vnd.apache.thrift.compact" };
+ pub const @"application/vnd.apache.thrift.json": MimeType = MimeType{ .category = .application, .value = "application/vnd.apache.thrift.json" };
+ pub const @"application/vnd.api+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.api+json" };
+ pub const @"application/vnd.aplextor.warrp+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.aplextor.warrp+json" };
+ pub const @"application/vnd.apothekende.reservation+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.apothekende.reservation+json" };
+ pub const @"application/vnd.apple.installer+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.installer+xml" };
+ pub const @"application/vnd.apple.keynote": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.keynote" };
+ pub const @"application/vnd.apple.mpegurl": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.mpegurl" };
+ pub const @"application/vnd.apple.numbers": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.numbers" };
+ pub const @"application/vnd.apple.pages": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.pages" };
+ pub const @"application/vnd.apple.pkpass": MimeType = MimeType{ .category = .application, .value = "application/vnd.apple.pkpass" };
+ pub const @"application/vnd.arastra.swi": MimeType = MimeType{ .category = .application, .value = "application/vnd.arastra.swi" };
+ pub const @"application/vnd.aristanetworks.swi": MimeType = MimeType{ .category = .application, .value = "application/vnd.aristanetworks.swi" };
+ pub const @"application/vnd.artisan+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.artisan+json" };
+ pub const @"application/vnd.artsquare": MimeType = MimeType{ .category = .application, .value = "application/vnd.artsquare" };
+ pub const @"application/vnd.astraea-software.iota": MimeType = MimeType{ .category = .application, .value = "application/vnd.astraea-software.iota" };
+ pub const @"application/vnd.audiograph": MimeType = MimeType{ .category = .application, .value = "application/vnd.audiograph" };
+ pub const @"application/vnd.autopackage": MimeType = MimeType{ .category = .application, .value = "application/vnd.autopackage" };
+ pub const @"application/vnd.avalon+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.avalon+json" };
+ pub const @"application/vnd.avistar+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.avistar+xml" };
+ pub const @"application/vnd.balsamiq.bmml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.balsamiq.bmml+xml" };
+ pub const @"application/vnd.balsamiq.bmpr": MimeType = MimeType{ .category = .application, .value = "application/vnd.balsamiq.bmpr" };
+ pub const @"application/vnd.banana-accounting": MimeType = MimeType{ .category = .application, .value = "application/vnd.banana-accounting" };
+ pub const @"application/vnd.bbf.usp.error": MimeType = MimeType{ .category = .application, .value = "application/vnd.bbf.usp.error" };
+ pub const @"application/vnd.bbf.usp.msg": MimeType = MimeType{ .category = .application, .value = "application/vnd.bbf.usp.msg" };
+ pub const @"application/vnd.bbf.usp.msg+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.bbf.usp.msg+json" };
+ pub const @"application/vnd.bekitzur-stech+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.bekitzur-stech+json" };
+ pub const @"application/vnd.bint.med-content": MimeType = MimeType{ .category = .application, .value = "application/vnd.bint.med-content" };
+ pub const @"application/vnd.biopax.rdf+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.biopax.rdf+xml" };
+ pub const @"application/vnd.blink-idb-value-wrapper": MimeType = MimeType{ .category = .application, .value = "application/vnd.blink-idb-value-wrapper" };
+ pub const @"application/vnd.blueice.multipass": MimeType = MimeType{ .category = .application, .value = "application/vnd.blueice.multipass" };
+ pub const @"application/vnd.bluetooth.ep.oob": MimeType = MimeType{ .category = .application, .value = "application/vnd.bluetooth.ep.oob" };
+ pub const @"application/vnd.bluetooth.le.oob": MimeType = MimeType{ .category = .application, .value = "application/vnd.bluetooth.le.oob" };
+ pub const @"application/vnd.bmi": MimeType = MimeType{ .category = .application, .value = "application/vnd.bmi" };
+ pub const @"application/vnd.bpf": MimeType = MimeType{ .category = .application, .value = "application/vnd.bpf" };
+ pub const @"application/vnd.bpf3": MimeType = MimeType{ .category = .application, .value = "application/vnd.bpf3" };
+ pub const @"application/vnd.businessobjects": MimeType = MimeType{ .category = .application, .value = "application/vnd.businessobjects" };
+ pub const @"application/vnd.byu.uapi+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.byu.uapi+json" };
+ pub const @"application/vnd.cab-jscript": MimeType = MimeType{ .category = .application, .value = "application/vnd.cab-jscript" };
+ pub const @"application/vnd.canon-cpdl": MimeType = MimeType{ .category = .application, .value = "application/vnd.canon-cpdl" };
+ pub const @"application/vnd.canon-lips": MimeType = MimeType{ .category = .application, .value = "application/vnd.canon-lips" };
+ pub const @"application/vnd.capasystems-pg+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.capasystems-pg+json" };
+ pub const @"application/vnd.cendio.thinlinc.clientconf": MimeType = MimeType{ .category = .application, .value = "application/vnd.cendio.thinlinc.clientconf" };
+ pub const @"application/vnd.century-systems.tcp_stream": MimeType = MimeType{ .category = .application, .value = "application/vnd.century-systems.tcp_stream" };
+ pub const @"application/vnd.chemdraw+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.chemdraw+xml" };
+ pub const @"application/vnd.chess-pgn": MimeType = MimeType{ .category = .application, .value = "application/vnd.chess-pgn" };
+ pub const @"application/vnd.chipnuts.karaoke-mmd": MimeType = MimeType{ .category = .application, .value = "application/vnd.chipnuts.karaoke-mmd" };
+ pub const @"application/vnd.ciedi": MimeType = MimeType{ .category = .application, .value = "application/vnd.ciedi" };
+ pub const @"application/vnd.cinderella": MimeType = MimeType{ .category = .application, .value = "application/vnd.cinderella" };
+ pub const @"application/vnd.cirpack.isdn-ext": MimeType = MimeType{ .category = .application, .value = "application/vnd.cirpack.isdn-ext" };
+ pub const @"application/vnd.citationstyles.style+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.citationstyles.style+xml" };
+ pub const @"application/vnd.claymore": MimeType = MimeType{ .category = .application, .value = "application/vnd.claymore" };
+ pub const @"application/vnd.cloanto.rp9": MimeType = MimeType{ .category = .application, .value = "application/vnd.cloanto.rp9" };
+ pub const @"application/vnd.clonk.c4group": MimeType = MimeType{ .category = .application, .value = "application/vnd.clonk.c4group" };
+ pub const @"application/vnd.cluetrust.cartomobile-config": MimeType = MimeType{ .category = .application, .value = "application/vnd.cluetrust.cartomobile-config" };
+ pub const @"application/vnd.cluetrust.cartomobile-config-pkg": MimeType = MimeType{ .category = .application, .value = "application/vnd.cluetrust.cartomobile-config-pkg" };
+ pub const @"application/vnd.coffeescript": MimeType = MimeType{ .category = .application, .value = "application/vnd.coffeescript" };
+ pub const @"application/vnd.collabio.xodocuments.document": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.document" };
+ pub const @"application/vnd.collabio.xodocuments.document-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.document-template" };
+ pub const @"application/vnd.collabio.xodocuments.presentation": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.presentation" };
+ pub const @"application/vnd.collabio.xodocuments.presentation-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.presentation-template" };
+ pub const @"application/vnd.collabio.xodocuments.spreadsheet": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.spreadsheet" };
+ pub const @"application/vnd.collabio.xodocuments.spreadsheet-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.collabio.xodocuments.spreadsheet-template" };
+ pub const @"application/vnd.collection+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.collection+json" };
+ pub const @"application/vnd.collection.doc+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.collection.doc+json" };
+ pub const @"application/vnd.collection.next+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.collection.next+json" };
+ pub const @"application/vnd.comicbook+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.comicbook+zip" };
+ pub const @"application/vnd.comicbook-rar": MimeType = MimeType{ .category = .application, .value = "application/vnd.comicbook-rar" };
+ pub const @"application/vnd.commerce-battelle": MimeType = MimeType{ .category = .application, .value = "application/vnd.commerce-battelle" };
+ pub const @"application/vnd.commonspace": MimeType = MimeType{ .category = .application, .value = "application/vnd.commonspace" };
+ pub const @"application/vnd.contact.cmsg": MimeType = MimeType{ .category = .application, .value = "application/vnd.contact.cmsg" };
+ pub const @"application/vnd.coreos.ignition+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.coreos.ignition+json" };
+ pub const @"application/vnd.cosmocaller": MimeType = MimeType{ .category = .application, .value = "application/vnd.cosmocaller" };
+ pub const @"application/vnd.crick.clicker": MimeType = MimeType{ .category = .application, .value = "application/vnd.crick.clicker" };
+ pub const @"application/vnd.crick.clicker.keyboard": MimeType = MimeType{ .category = .application, .value = "application/vnd.crick.clicker.keyboard" };
+ pub const @"application/vnd.crick.clicker.palette": MimeType = MimeType{ .category = .application, .value = "application/vnd.crick.clicker.palette" };
+ pub const @"application/vnd.crick.clicker.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.crick.clicker.template" };
+ pub const @"application/vnd.crick.clicker.wordbank": MimeType = MimeType{ .category = .application, .value = "application/vnd.crick.clicker.wordbank" };
+ pub const @"application/vnd.criticaltools.wbs+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.criticaltools.wbs+xml" };
+ pub const @"application/vnd.cryptii.pipe+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.cryptii.pipe+json" };
+ pub const @"application/vnd.crypto-shade-file": MimeType = MimeType{ .category = .application, .value = "application/vnd.crypto-shade-file" };
+ pub const @"application/vnd.cryptomator.encrypted": MimeType = MimeType{ .category = .application, .value = "application/vnd.cryptomator.encrypted" };
+ pub const @"application/vnd.cryptomator.vault": MimeType = MimeType{ .category = .application, .value = "application/vnd.cryptomator.vault" };
+ pub const @"application/vnd.ctc-posml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ctc-posml" };
+ pub const @"application/vnd.ctct.ws+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ctct.ws+xml" };
+ pub const @"application/vnd.cups-pdf": MimeType = MimeType{ .category = .application, .value = "application/vnd.cups-pdf" };
+ pub const @"application/vnd.cups-postscript": MimeType = MimeType{ .category = .application, .value = "application/vnd.cups-postscript" };
+ pub const @"application/vnd.cups-ppd": MimeType = MimeType{ .category = .application, .value = "application/vnd.cups-ppd" };
+ pub const @"application/vnd.cups-raster": MimeType = MimeType{ .category = .application, .value = "application/vnd.cups-raster" };
+ pub const @"application/vnd.cups-raw": MimeType = MimeType{ .category = .application, .value = "application/vnd.cups-raw" };
+ pub const @"application/vnd.curl": MimeType = MimeType{ .category = .application, .value = "application/vnd.curl" };
+ pub const @"application/vnd.curl.car": MimeType = MimeType{ .category = .application, .value = "application/vnd.curl.car" };
+ pub const @"application/vnd.curl.pcurl": MimeType = MimeType{ .category = .application, .value = "application/vnd.curl.pcurl" };
+ pub const @"application/vnd.cyan.dean.root+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.cyan.dean.root+xml" };
+ pub const @"application/vnd.cybank": MimeType = MimeType{ .category = .application, .value = "application/vnd.cybank" };
+ pub const @"application/vnd.cyclonedx+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.cyclonedx+json" };
+ pub const @"application/vnd.cyclonedx+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.cyclonedx+xml" };
+ pub const @"application/vnd.d2l.coursepackage1p0+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.d2l.coursepackage1p0+zip" };
+ pub const @"application/vnd.d3m-dataset": MimeType = MimeType{ .category = .application, .value = "application/vnd.d3m-dataset" };
+ pub const @"application/vnd.d3m-problem": MimeType = MimeType{ .category = .application, .value = "application/vnd.d3m-problem" };
+ pub const @"application/vnd.dart": MimeType = MimeType{ .category = .application, .value = "application/vnd.dart" };
+ pub const @"application/vnd.data-vision.rdz": MimeType = MimeType{ .category = .application, .value = "application/vnd.data-vision.rdz" };
+ pub const @"application/vnd.datapackage+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.datapackage+json" };
+ pub const @"application/vnd.dataresource+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.dataresource+json" };
+ pub const @"application/vnd.dbf": MimeType = MimeType{ .category = .application, .value = "application/vnd.dbf" };
+ pub const @"application/vnd.debian.binary-package": MimeType = MimeType{ .category = .application, .value = "application/vnd.debian.binary-package" };
+ pub const @"application/vnd.dece.data": MimeType = MimeType{ .category = .application, .value = "application/vnd.dece.data" };
+ pub const @"application/vnd.dece.ttml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dece.ttml+xml" };
+ pub const @"application/vnd.dece.unspecified": MimeType = MimeType{ .category = .application, .value = "application/vnd.dece.unspecified" };
+ pub const @"application/vnd.dece.zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.dece.zip" };
+ pub const @"application/vnd.denovo.fcselayout-link": MimeType = MimeType{ .category = .application, .value = "application/vnd.denovo.fcselayout-link" };
+ pub const @"application/vnd.desmume.movie": MimeType = MimeType{ .category = .application, .value = "application/vnd.desmume.movie" };
+ pub const @"application/vnd.dir-bi.plate-dl-nosuffix": MimeType = MimeType{ .category = .application, .value = "application/vnd.dir-bi.plate-dl-nosuffix" };
+ pub const @"application/vnd.dm.delegation+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dm.delegation+xml" };
+ pub const @"application/vnd.dna": MimeType = MimeType{ .category = .application, .value = "application/vnd.dna" };
+ pub const @"application/vnd.document+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.document+json" };
+ pub const @"application/vnd.dolby.mlp": MimeType = MimeType{ .category = .application, .value = "application/vnd.dolby.mlp" };
+ pub const @"application/vnd.dolby.mobile.1": MimeType = MimeType{ .category = .application, .value = "application/vnd.dolby.mobile.1" };
+ pub const @"application/vnd.dolby.mobile.2": MimeType = MimeType{ .category = .application, .value = "application/vnd.dolby.mobile.2" };
+ pub const @"application/vnd.doremir.scorecloud-binary-document": MimeType = MimeType{ .category = .application, .value = "application/vnd.doremir.scorecloud-binary-document" };
+ pub const @"application/vnd.dpgraph": MimeType = MimeType{ .category = .application, .value = "application/vnd.dpgraph" };
+ pub const @"application/vnd.dreamfactory": MimeType = MimeType{ .category = .application, .value = "application/vnd.dreamfactory" };
+ pub const @"application/vnd.drive+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.drive+json" };
+ pub const @"application/vnd.ds-keypoint": MimeType = MimeType{ .category = .application, .value = "application/vnd.ds-keypoint" };
+ pub const @"application/vnd.dtg.local": MimeType = MimeType{ .category = .application, .value = "application/vnd.dtg.local" };
+ pub const @"application/vnd.dtg.local.flash": MimeType = MimeType{ .category = .application, .value = "application/vnd.dtg.local.flash" };
+ pub const @"application/vnd.dtg.local.html": MimeType = MimeType{ .category = .application, .value = "application/vnd.dtg.local.html" };
+ pub const @"application/vnd.dvb.ait": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ait" };
+ pub const @"application/vnd.dvb.dvbisl+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.dvbisl+xml" };
+ pub const @"application/vnd.dvb.dvbj": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.dvbj" };
+ pub const @"application/vnd.dvb.esgcontainer": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.esgcontainer" };
+ pub const @"application/vnd.dvb.ipdcdftnotifaccess": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ipdcdftnotifaccess" };
+ pub const @"application/vnd.dvb.ipdcesgaccess": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ipdcesgaccess" };
+ pub const @"application/vnd.dvb.ipdcesgaccess2": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ipdcesgaccess2" };
+ pub const @"application/vnd.dvb.ipdcesgpdd": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ipdcesgpdd" };
+ pub const @"application/vnd.dvb.ipdcroaming": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.ipdcroaming" };
+ pub const @"application/vnd.dvb.iptv.alfec-base": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.iptv.alfec-base" };
+ pub const @"application/vnd.dvb.iptv.alfec-enhancement": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.iptv.alfec-enhancement" };
+ pub const @"application/vnd.dvb.notif-aggregate-root+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-aggregate-root+xml" };
+ pub const @"application/vnd.dvb.notif-container+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-container+xml" };
+ pub const @"application/vnd.dvb.notif-generic+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-generic+xml" };
+ pub const @"application/vnd.dvb.notif-ia-msglist+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-ia-msglist+xml" };
+ pub const @"application/vnd.dvb.notif-ia-registration-request+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-ia-registration-request+xml" };
+ pub const @"application/vnd.dvb.notif-ia-registration-response+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-ia-registration-response+xml" };
+ pub const @"application/vnd.dvb.notif-init+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.notif-init+xml" };
+ pub const @"application/vnd.dvb.pfr": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.pfr" };
+ pub const @"application/vnd.dvb.service": MimeType = MimeType{ .category = .application, .value = "application/vnd.dvb.service" };
+ pub const @"application/vnd.dxr": MimeType = MimeType{ .category = .application, .value = "application/vnd.dxr" };
+ pub const @"application/vnd.dynageo": MimeType = MimeType{ .category = .application, .value = "application/vnd.dynageo" };
+ pub const @"application/vnd.dzr": MimeType = MimeType{ .category = .application, .value = "application/vnd.dzr" };
+ pub const @"application/vnd.easykaraoke.cdgdownload": MimeType = MimeType{ .category = .application, .value = "application/vnd.easykaraoke.cdgdownload" };
+ pub const @"application/vnd.ecdis-update": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecdis-update" };
+ pub const @"application/vnd.ecip.rlp": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecip.rlp" };
+ pub const @"application/vnd.eclipse.ditto+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.eclipse.ditto+json" };
+ pub const @"application/vnd.ecowin.chart": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.chart" };
+ pub const @"application/vnd.ecowin.filerequest": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.filerequest" };
+ pub const @"application/vnd.ecowin.fileupdate": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.fileupdate" };
+ pub const @"application/vnd.ecowin.series": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.series" };
+ pub const @"application/vnd.ecowin.seriesrequest": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.seriesrequest" };
+ pub const @"application/vnd.ecowin.seriesupdate": MimeType = MimeType{ .category = .application, .value = "application/vnd.ecowin.seriesupdate" };
+ pub const @"application/vnd.efi.img": MimeType = MimeType{ .category = .application, .value = "application/vnd.efi.img" };
+ pub const @"application/vnd.efi.iso": MimeType = MimeType{ .category = .application, .value = "application/vnd.efi.iso" };
+ pub const @"application/vnd.emclient.accessrequest+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.emclient.accessrequest+xml" };
+ pub const @"application/vnd.enliven": MimeType = MimeType{ .category = .application, .value = "application/vnd.enliven" };
+ pub const @"application/vnd.enphase.envoy": MimeType = MimeType{ .category = .application, .value = "application/vnd.enphase.envoy" };
+ pub const @"application/vnd.eprints.data+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.eprints.data+xml" };
+ pub const @"application/vnd.epson.esf": MimeType = MimeType{ .category = .application, .value = "application/vnd.epson.esf" };
+ pub const @"application/vnd.epson.msf": MimeType = MimeType{ .category = .application, .value = "application/vnd.epson.msf" };
+ pub const @"application/vnd.epson.quickanime": MimeType = MimeType{ .category = .application, .value = "application/vnd.epson.quickanime" };
+ pub const @"application/vnd.epson.salt": MimeType = MimeType{ .category = .application, .value = "application/vnd.epson.salt" };
+ pub const @"application/vnd.epson.ssf": MimeType = MimeType{ .category = .application, .value = "application/vnd.epson.ssf" };
+ pub const @"application/vnd.ericsson.quickcall": MimeType = MimeType{ .category = .application, .value = "application/vnd.ericsson.quickcall" };
+ pub const @"application/vnd.espass-espass+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.espass-espass+zip" };
+ pub const @"application/vnd.eszigno3+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.eszigno3+xml" };
+ pub const @"application/vnd.etsi.aoc+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.aoc+xml" };
+ pub const @"application/vnd.etsi.asic-e+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.asic-e+zip" };
+ pub const @"application/vnd.etsi.asic-s+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.asic-s+zip" };
+ pub const @"application/vnd.etsi.cug+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.cug+xml" };
+ pub const @"application/vnd.etsi.iptvcommand+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvcommand+xml" };
+ pub const @"application/vnd.etsi.iptvdiscovery+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvdiscovery+xml" };
+ pub const @"application/vnd.etsi.iptvprofile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvprofile+xml" };
+ pub const @"application/vnd.etsi.iptvsad-bc+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvsad-bc+xml" };
+ pub const @"application/vnd.etsi.iptvsad-cod+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvsad-cod+xml" };
+ pub const @"application/vnd.etsi.iptvsad-npvr+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvsad-npvr+xml" };
+ pub const @"application/vnd.etsi.iptvservice+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvservice+xml" };
+ pub const @"application/vnd.etsi.iptvsync+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvsync+xml" };
+ pub const @"application/vnd.etsi.iptvueprofile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.iptvueprofile+xml" };
+ pub const @"application/vnd.etsi.mcid+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.mcid+xml" };
+ pub const @"application/vnd.etsi.mheg5": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.mheg5" };
+ pub const @"application/vnd.etsi.overload-control-policy-dataset+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.overload-control-policy-dataset+xml" };
+ pub const @"application/vnd.etsi.pstn+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.pstn+xml" };
+ pub const @"application/vnd.etsi.sci+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.sci+xml" };
+ pub const @"application/vnd.etsi.simservs+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.simservs+xml" };
+ pub const @"application/vnd.etsi.timestamp-token": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.timestamp-token" };
+ pub const @"application/vnd.etsi.tsl+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.tsl+xml" };
+ pub const @"application/vnd.etsi.tsl.der": MimeType = MimeType{ .category = .application, .value = "application/vnd.etsi.tsl.der" };
+ pub const @"application/vnd.eu.kasparian.car+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.eu.kasparian.car+json" };
+ pub const @"application/vnd.eudora.data": MimeType = MimeType{ .category = .application, .value = "application/vnd.eudora.data" };
+ pub const @"application/vnd.evolv.ecig.profile": MimeType = MimeType{ .category = .application, .value = "application/vnd.evolv.ecig.profile" };
+ pub const @"application/vnd.evolv.ecig.settings": MimeType = MimeType{ .category = .application, .value = "application/vnd.evolv.ecig.settings" };
+ pub const @"application/vnd.evolv.ecig.theme": MimeType = MimeType{ .category = .application, .value = "application/vnd.evolv.ecig.theme" };
+ pub const @"application/vnd.exstream-empower+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.exstream-empower+zip" };
+ pub const @"application/vnd.exstream-package": MimeType = MimeType{ .category = .application, .value = "application/vnd.exstream-package" };
+ pub const @"application/vnd.ezpix-album": MimeType = MimeType{ .category = .application, .value = "application/vnd.ezpix-album" };
+ pub const @"application/vnd.ezpix-package": MimeType = MimeType{ .category = .application, .value = "application/vnd.ezpix-package" };
+ pub const @"application/vnd.f-secure.mobile": MimeType = MimeType{ .category = .application, .value = "application/vnd.f-secure.mobile" };
+ pub const @"application/vnd.familysearch.gedcom+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.familysearch.gedcom+zip" };
+ pub const @"application/vnd.fastcopy-disk-image": MimeType = MimeType{ .category = .application, .value = "application/vnd.fastcopy-disk-image" };
+ pub const @"application/vnd.fdf": MimeType = MimeType{ .category = .application, .value = "application/vnd.fdf" };
+ pub const @"application/vnd.fdsn.mseed": MimeType = MimeType{ .category = .application, .value = "application/vnd.fdsn.mseed" };
+ pub const @"application/vnd.fdsn.seed": MimeType = MimeType{ .category = .application, .value = "application/vnd.fdsn.seed" };
+ pub const @"application/vnd.ffsns": MimeType = MimeType{ .category = .application, .value = "application/vnd.ffsns" };
+ pub const @"application/vnd.ficlab.flb+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.ficlab.flb+zip" };
+ pub const @"application/vnd.filmit.zfc": MimeType = MimeType{ .category = .application, .value = "application/vnd.filmit.zfc" };
+ pub const @"application/vnd.fints": MimeType = MimeType{ .category = .application, .value = "application/vnd.fints" };
+ pub const @"application/vnd.firemonkeys.cloudcell": MimeType = MimeType{ .category = .application, .value = "application/vnd.firemonkeys.cloudcell" };
+ pub const @"application/vnd.flographit": MimeType = MimeType{ .category = .application, .value = "application/vnd.flographit" };
+ pub const @"application/vnd.fluxtime.clip": MimeType = MimeType{ .category = .application, .value = "application/vnd.fluxtime.clip" };
+ pub const @"application/vnd.font-fontforge-sfd": MimeType = MimeType{ .category = .application, .value = "application/vnd.font-fontforge-sfd" };
+ pub const @"application/vnd.framemaker": MimeType = MimeType{ .category = .application, .value = "application/vnd.framemaker" };
+ pub const @"application/vnd.frogans.fnc": MimeType = MimeType{ .category = .application, .value = "application/vnd.frogans.fnc" };
+ pub const @"application/vnd.frogans.ltf": MimeType = MimeType{ .category = .application, .value = "application/vnd.frogans.ltf" };
+ pub const @"application/vnd.fsc.weblaunch": MimeType = MimeType{ .category = .application, .value = "application/vnd.fsc.weblaunch" };
+ pub const @"application/vnd.fujifilm.fb.docuworks": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujifilm.fb.docuworks" };
+ pub const @"application/vnd.fujifilm.fb.docuworks.binder": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujifilm.fb.docuworks.binder" };
+ pub const @"application/vnd.fujifilm.fb.docuworks.container": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujifilm.fb.docuworks.container" };
+ pub const @"application/vnd.fujifilm.fb.jfi+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujifilm.fb.jfi+xml" };
+ pub const @"application/vnd.fujitsu.oasys": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujitsu.oasys" };
+ pub const @"application/vnd.fujitsu.oasys2": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujitsu.oasys2" };
+ pub const @"application/vnd.fujitsu.oasys3": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujitsu.oasys3" };
+ pub const @"application/vnd.fujitsu.oasysgp": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujitsu.oasysgp" };
+ pub const @"application/vnd.fujitsu.oasysprs": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujitsu.oasysprs" };
+ pub const @"application/vnd.fujixerox.art-ex": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.art-ex" };
+ pub const @"application/vnd.fujixerox.art4": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.art4" };
+ pub const @"application/vnd.fujixerox.ddd": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.ddd" };
+ pub const @"application/vnd.fujixerox.docuworks": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.docuworks" };
+ pub const @"application/vnd.fujixerox.docuworks.binder": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.docuworks.binder" };
+ pub const @"application/vnd.fujixerox.docuworks.container": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.docuworks.container" };
+ pub const @"application/vnd.fujixerox.hbpl": MimeType = MimeType{ .category = .application, .value = "application/vnd.fujixerox.hbpl" };
+ pub const @"application/vnd.fut-misnet": MimeType = MimeType{ .category = .application, .value = "application/vnd.fut-misnet" };
+ pub const @"application/vnd.futoin+cbor": MimeType = MimeType{ .category = .application, .value = "application/vnd.futoin+cbor" };
+ pub const @"application/vnd.futoin+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.futoin+json" };
+ pub const @"application/vnd.fuzzysheet": MimeType = MimeType{ .category = .application, .value = "application/vnd.fuzzysheet" };
+ pub const @"application/vnd.genomatix.tuxedo": MimeType = MimeType{ .category = .application, .value = "application/vnd.genomatix.tuxedo" };
+ pub const @"application/vnd.gentics.grd+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.gentics.grd+json" };
+ pub const @"application/vnd.geo+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.geo+json" };
+ pub const @"application/vnd.geocube+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.geocube+xml" };
+ pub const @"application/vnd.geogebra.file": MimeType = MimeType{ .category = .application, .value = "application/vnd.geogebra.file" };
+ pub const @"application/vnd.geogebra.slides": MimeType = MimeType{ .category = .application, .value = "application/vnd.geogebra.slides" };
+ pub const @"application/vnd.geogebra.tool": MimeType = MimeType{ .category = .application, .value = "application/vnd.geogebra.tool" };
+ pub const @"application/vnd.geometry-explorer": MimeType = MimeType{ .category = .application, .value = "application/vnd.geometry-explorer" };
+ pub const @"application/vnd.geonext": MimeType = MimeType{ .category = .application, .value = "application/vnd.geonext" };
+ pub const @"application/vnd.geoplan": MimeType = MimeType{ .category = .application, .value = "application/vnd.geoplan" };
+ pub const @"application/vnd.geospace": MimeType = MimeType{ .category = .application, .value = "application/vnd.geospace" };
+ pub const @"application/vnd.gerber": MimeType = MimeType{ .category = .application, .value = "application/vnd.gerber" };
+ pub const @"application/vnd.globalplatform.card-content-mgt": MimeType = MimeType{ .category = .application, .value = "application/vnd.globalplatform.card-content-mgt" };
+ pub const @"application/vnd.globalplatform.card-content-mgt-response": MimeType = MimeType{ .category = .application, .value = "application/vnd.globalplatform.card-content-mgt-response" };
+ pub const @"application/vnd.gmx": MimeType = MimeType{ .category = .application, .value = "application/vnd.gmx" };
+ pub const @"application/vnd.gnu.taler.exchange+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.gnu.taler.exchange+json" };
+ pub const @"application/vnd.gnu.taler.merchant+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.gnu.taler.merchant+json" };
+ pub const @"application/vnd.google-apps.document": MimeType = MimeType{ .category = .application, .value = "application/vnd.google-apps.document" };
+ pub const @"application/vnd.google-apps.presentation": MimeType = MimeType{ .category = .application, .value = "application/vnd.google-apps.presentation" };
+ pub const @"application/vnd.google-apps.spreadsheet": MimeType = MimeType{ .category = .application, .value = "application/vnd.google-apps.spreadsheet" };
+ pub const @"application/vnd.google-earth.kml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.google-earth.kml+xml" };
+ pub const @"application/vnd.google-earth.kmz": MimeType = MimeType{ .category = .application, .value = "application/vnd.google-earth.kmz" };
+ pub const @"application/vnd.gov.sk.e-form+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.gov.sk.e-form+xml" };
+ pub const @"application/vnd.gov.sk.e-form+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.gov.sk.e-form+zip" };
+ pub const @"application/vnd.gov.sk.xmldatacontainer+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.gov.sk.xmldatacontainer+xml" };
+ pub const @"application/vnd.grafeq": MimeType = MimeType{ .category = .application, .value = "application/vnd.grafeq" };
+ pub const @"application/vnd.gridmp": MimeType = MimeType{ .category = .application, .value = "application/vnd.gridmp" };
+ pub const @"application/vnd.groove-account": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-account" };
+ pub const @"application/vnd.groove-help": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-help" };
+ pub const @"application/vnd.groove-identity-message": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-identity-message" };
+ pub const @"application/vnd.groove-injector": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-injector" };
+ pub const @"application/vnd.groove-tool-message": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-tool-message" };
+ pub const @"application/vnd.groove-tool-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-tool-template" };
+ pub const @"application/vnd.groove-vcard": MimeType = MimeType{ .category = .application, .value = "application/vnd.groove-vcard" };
+ pub const @"application/vnd.hal+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.hal+json" };
+ pub const @"application/vnd.hal+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.hal+xml" };
+ pub const @"application/vnd.handheld-entertainment+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.handheld-entertainment+xml" };
+ pub const @"application/vnd.hbci": MimeType = MimeType{ .category = .application, .value = "application/vnd.hbci" };
+ pub const @"application/vnd.hc+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.hc+json" };
+ pub const @"application/vnd.hcl-bireports": MimeType = MimeType{ .category = .application, .value = "application/vnd.hcl-bireports" };
+ pub const @"application/vnd.hdt": MimeType = MimeType{ .category = .application, .value = "application/vnd.hdt" };
+ pub const @"application/vnd.heroku+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.heroku+json" };
+ pub const @"application/vnd.hhe.lesson-player": MimeType = MimeType{ .category = .application, .value = "application/vnd.hhe.lesson-player" };
+ pub const @"application/vnd.hl7cda+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.hl7cda+xml" };
+ pub const @"application/vnd.hl7v2+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.hl7v2+xml" };
+ pub const @"application/vnd.hp-hpgl": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-hpgl" };
+ pub const @"application/vnd.hp-hpid": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-hpid" };
+ pub const @"application/vnd.hp-hps": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-hps" };
+ pub const @"application/vnd.hp-jlyt": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-jlyt" };
+ pub const @"application/vnd.hp-pcl": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-pcl" };
+ pub const @"application/vnd.hp-pclxl": MimeType = MimeType{ .category = .application, .value = "application/vnd.hp-pclxl" };
+ pub const @"application/vnd.httphone": MimeType = MimeType{ .category = .application, .value = "application/vnd.httphone" };
+ pub const @"application/vnd.hydrostatix.sof-data": MimeType = MimeType{ .category = .application, .value = "application/vnd.hydrostatix.sof-data" };
+ pub const @"application/vnd.hyper+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.hyper+json" };
+ pub const @"application/vnd.hyper-item+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.hyper-item+json" };
+ pub const @"application/vnd.hyperdrive+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.hyperdrive+json" };
+ pub const @"application/vnd.hzn-3d-crossword": MimeType = MimeType{ .category = .application, .value = "application/vnd.hzn-3d-crossword" };
+ pub const @"application/vnd.ibm.afplinedata": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.afplinedata" };
+ pub const @"application/vnd.ibm.electronic-media": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.electronic-media" };
+ pub const @"application/vnd.ibm.minipay": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.minipay" };
+ pub const @"application/vnd.ibm.modcap": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.modcap" };
+ pub const @"application/vnd.ibm.rights-management": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.rights-management" };
+ pub const @"application/vnd.ibm.secure-container": MimeType = MimeType{ .category = .application, .value = "application/vnd.ibm.secure-container" };
+ pub const @"application/vnd.iccprofile": MimeType = MimeType{ .category = .application, .value = "application/vnd.iccprofile" };
+ pub const @"application/vnd.ieee.1905": MimeType = MimeType{ .category = .application, .value = "application/vnd.ieee.1905" };
+ pub const @"application/vnd.igloader": MimeType = MimeType{ .category = .application, .value = "application/vnd.igloader" };
+ pub const @"application/vnd.imagemeter.folder+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.imagemeter.folder+zip" };
+ pub const @"application/vnd.imagemeter.image+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.imagemeter.image+zip" };
+ pub const @"application/vnd.immervision-ivp": MimeType = MimeType{ .category = .application, .value = "application/vnd.immervision-ivp" };
+ pub const @"application/vnd.immervision-ivu": MimeType = MimeType{ .category = .application, .value = "application/vnd.immervision-ivu" };
+ pub const @"application/vnd.ims.imsccv1p1": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.imsccv1p1" };
+ pub const @"application/vnd.ims.imsccv1p2": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.imsccv1p2" };
+ pub const @"application/vnd.ims.imsccv1p3": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.imsccv1p3" };
+ pub const @"application/vnd.ims.lis.v2.result+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lis.v2.result+json" };
+ pub const @"application/vnd.ims.lti.v2.toolconsumerprofile+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lti.v2.toolconsumerprofile+json" };
+ pub const @"application/vnd.ims.lti.v2.toolproxy+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lti.v2.toolproxy+json" };
+ pub const @"application/vnd.ims.lti.v2.toolproxy.id+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lti.v2.toolproxy.id+json" };
+ pub const @"application/vnd.ims.lti.v2.toolsettings+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lti.v2.toolsettings+json" };
+ pub const @"application/vnd.ims.lti.v2.toolsettings.simple+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.ims.lti.v2.toolsettings.simple+json" };
+ pub const @"application/vnd.informedcontrol.rms+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.informedcontrol.rms+xml" };
+ pub const @"application/vnd.informix-visionary": MimeType = MimeType{ .category = .application, .value = "application/vnd.informix-visionary" };
+ pub const @"application/vnd.infotech.project": MimeType = MimeType{ .category = .application, .value = "application/vnd.infotech.project" };
+ pub const @"application/vnd.infotech.project+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.infotech.project+xml" };
+ pub const @"application/vnd.innopath.wamp.notification": MimeType = MimeType{ .category = .application, .value = "application/vnd.innopath.wamp.notification" };
+ pub const @"application/vnd.insors.igm": MimeType = MimeType{ .category = .application, .value = "application/vnd.insors.igm" };
+ pub const @"application/vnd.intercon.formnet": MimeType = MimeType{ .category = .application, .value = "application/vnd.intercon.formnet" };
+ pub const @"application/vnd.intergeo": MimeType = MimeType{ .category = .application, .value = "application/vnd.intergeo" };
+ pub const @"application/vnd.intertrust.digibox": MimeType = MimeType{ .category = .application, .value = "application/vnd.intertrust.digibox" };
+ pub const @"application/vnd.intertrust.nncp": MimeType = MimeType{ .category = .application, .value = "application/vnd.intertrust.nncp" };
+ pub const @"application/vnd.intu.qbo": MimeType = MimeType{ .category = .application, .value = "application/vnd.intu.qbo" };
+ pub const @"application/vnd.intu.qfx": MimeType = MimeType{ .category = .application, .value = "application/vnd.intu.qfx" };
+ pub const @"application/vnd.iptc.g2.catalogitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.catalogitem+xml" };
+ pub const @"application/vnd.iptc.g2.conceptitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.conceptitem+xml" };
+ pub const @"application/vnd.iptc.g2.knowledgeitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.knowledgeitem+xml" };
+ pub const @"application/vnd.iptc.g2.newsitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.newsitem+xml" };
+ pub const @"application/vnd.iptc.g2.newsmessage+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.newsmessage+xml" };
+ pub const @"application/vnd.iptc.g2.packageitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.packageitem+xml" };
+ pub const @"application/vnd.iptc.g2.planningitem+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.iptc.g2.planningitem+xml" };
+ pub const @"application/vnd.ipunplugged.rcprofile": MimeType = MimeType{ .category = .application, .value = "application/vnd.ipunplugged.rcprofile" };
+ pub const @"application/vnd.irepository.package+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.irepository.package+xml" };
+ pub const @"application/vnd.is-xpr": MimeType = MimeType{ .category = .application, .value = "application/vnd.is-xpr" };
+ pub const @"application/vnd.isac.fcs": MimeType = MimeType{ .category = .application, .value = "application/vnd.isac.fcs" };
+ pub const @"application/vnd.iso11783-10+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.iso11783-10+zip" };
+ pub const @"application/vnd.jam": MimeType = MimeType{ .category = .application, .value = "application/vnd.jam" };
+ pub const @"application/vnd.japannet-directory-service": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-directory-service" };
+ pub const @"application/vnd.japannet-jpnstore-wakeup": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-jpnstore-wakeup" };
+ pub const @"application/vnd.japannet-payment-wakeup": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-payment-wakeup" };
+ pub const @"application/vnd.japannet-registration": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-registration" };
+ pub const @"application/vnd.japannet-registration-wakeup": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-registration-wakeup" };
+ pub const @"application/vnd.japannet-setstore-wakeup": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-setstore-wakeup" };
+ pub const @"application/vnd.japannet-verification": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-verification" };
+ pub const @"application/vnd.japannet-verification-wakeup": MimeType = MimeType{ .category = .application, .value = "application/vnd.japannet-verification-wakeup" };
+ pub const @"application/vnd.jcp.javame.midlet-rms": MimeType = MimeType{ .category = .application, .value = "application/vnd.jcp.javame.midlet-rms" };
+ pub const @"application/vnd.jisp": MimeType = MimeType{ .category = .application, .value = "application/vnd.jisp" };
+ pub const @"application/vnd.joost.joda-archive": MimeType = MimeType{ .category = .application, .value = "application/vnd.joost.joda-archive" };
+ pub const @"application/vnd.jsk.isdn-ngn": MimeType = MimeType{ .category = .application, .value = "application/vnd.jsk.isdn-ngn" };
+ pub const @"application/vnd.kahootz": MimeType = MimeType{ .category = .application, .value = "application/vnd.kahootz" };
+ pub const @"application/vnd.kde.karbon": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.karbon" };
+ pub const @"application/vnd.kde.kchart": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kchart" };
+ pub const @"application/vnd.kde.kformula": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kformula" };
+ pub const @"application/vnd.kde.kivio": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kivio" };
+ pub const @"application/vnd.kde.kontour": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kontour" };
+ pub const @"application/vnd.kde.kpresenter": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kpresenter" };
+ pub const @"application/vnd.kde.kspread": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kspread" };
+ pub const @"application/vnd.kde.kword": MimeType = MimeType{ .category = .application, .value = "application/vnd.kde.kword" };
+ pub const @"application/vnd.kenameaapp": MimeType = MimeType{ .category = .application, .value = "application/vnd.kenameaapp" };
+ pub const @"application/vnd.kidspiration": MimeType = MimeType{ .category = .application, .value = "application/vnd.kidspiration" };
+ pub const @"application/vnd.kinar": MimeType = MimeType{ .category = .application, .value = "application/vnd.kinar" };
+ pub const @"application/vnd.koan": MimeType = MimeType{ .category = .application, .value = "application/vnd.koan" };
+ pub const @"application/vnd.kodak-descriptor": MimeType = MimeType{ .category = .application, .value = "application/vnd.kodak-descriptor" };
+ pub const @"application/vnd.las": MimeType = MimeType{ .category = .application, .value = "application/vnd.las" };
+ pub const @"application/vnd.las.las+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.las.las+json" };
+ pub const @"application/vnd.las.las+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.las.las+xml" };
+ pub const @"application/vnd.laszip": MimeType = MimeType{ .category = .application, .value = "application/vnd.laszip" };
+ pub const @"application/vnd.leap+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.leap+json" };
+ pub const @"application/vnd.liberty-request+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.liberty-request+xml" };
+ pub const @"application/vnd.llamagraphics.life-balance.desktop": MimeType = MimeType{ .category = .application, .value = "application/vnd.llamagraphics.life-balance.desktop" };
+ pub const @"application/vnd.llamagraphics.life-balance.exchange+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.llamagraphics.life-balance.exchange+xml" };
+ pub const @"application/vnd.logipipe.circuit+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.logipipe.circuit+zip" };
+ pub const @"application/vnd.loom": MimeType = MimeType{ .category = .application, .value = "application/vnd.loom" };
+ pub const @"application/vnd.lotus-1-2-3": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-1-2-3" };
+ pub const @"application/vnd.lotus-approach": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-approach" };
+ pub const @"application/vnd.lotus-freelance": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-freelance" };
+ pub const @"application/vnd.lotus-notes": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-notes" };
+ pub const @"application/vnd.lotus-organizer": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-organizer" };
+ pub const @"application/vnd.lotus-screencam": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-screencam" };
+ pub const @"application/vnd.lotus-wordpro": MimeType = MimeType{ .category = .application, .value = "application/vnd.lotus-wordpro" };
+ pub const @"application/vnd.macports.portpkg": MimeType = MimeType{ .category = .application, .value = "application/vnd.macports.portpkg" };
+ pub const @"application/vnd.mapbox-vector-tile": MimeType = MimeType{ .category = .application, .value = "application/vnd.mapbox-vector-tile" };
+ pub const @"application/vnd.marlin.drm.actiontoken+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.marlin.drm.actiontoken+xml" };
+ pub const @"application/vnd.marlin.drm.conftoken+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.marlin.drm.conftoken+xml" };
+ pub const @"application/vnd.marlin.drm.license+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.marlin.drm.license+xml" };
+ pub const @"application/vnd.marlin.drm.mdcf": MimeType = MimeType{ .category = .application, .value = "application/vnd.marlin.drm.mdcf" };
+ pub const @"application/vnd.mason+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.mason+json" };
+ pub const @"application/vnd.maxar.archive.3tz+zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.maxar.archive.3tz+zip" };
+ pub const @"application/vnd.maxmind.maxmind-db": MimeType = MimeType{ .category = .application, .value = "application/vnd.maxmind.maxmind-db" };
+ pub const @"application/vnd.mcd": MimeType = MimeType{ .category = .application, .value = "application/vnd.mcd" };
+ pub const @"application/vnd.medcalcdata": MimeType = MimeType{ .category = .application, .value = "application/vnd.medcalcdata" };
+ pub const @"application/vnd.mediastation.cdkey": MimeType = MimeType{ .category = .application, .value = "application/vnd.mediastation.cdkey" };
+ pub const @"application/vnd.meridian-slingshot": MimeType = MimeType{ .category = .application, .value = "application/vnd.meridian-slingshot" };
+ pub const @"application/vnd.mfer": MimeType = MimeType{ .category = .application, .value = "application/vnd.mfer" };
+ pub const @"application/vnd.mfmp": MimeType = MimeType{ .category = .application, .value = "application/vnd.mfmp" };
+ pub const @"application/vnd.micro+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.micro+json" };
+ pub const @"application/vnd.micrografx.flo": MimeType = MimeType{ .category = .application, .value = "application/vnd.micrografx.flo" };
+ pub const @"application/vnd.micrografx.igx": MimeType = MimeType{ .category = .application, .value = "application/vnd.micrografx.igx" };
+ pub const @"application/vnd.microsoft.portable-executable": MimeType = MimeType{ .category = .application, .value = "application/vnd.microsoft.portable-executable" };
+ pub const @"application/vnd.microsoft.windows.thumbnail-cache": MimeType = MimeType{ .category = .application, .value = "application/vnd.microsoft.windows.thumbnail-cache" };
+ pub const @"application/vnd.miele+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.miele+json" };
+ pub const @"application/vnd.mif": MimeType = MimeType{ .category = .application, .value = "application/vnd.mif" };
+ pub const @"application/vnd.minisoft-hp3000-save": MimeType = MimeType{ .category = .application, .value = "application/vnd.minisoft-hp3000-save" };
+ pub const @"application/vnd.mitsubishi.misty-guard.trustweb": MimeType = MimeType{ .category = .application, .value = "application/vnd.mitsubishi.misty-guard.trustweb" };
+ pub const @"application/vnd.mobius.daf": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.daf" };
+ pub const @"application/vnd.mobius.dis": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.dis" };
+ pub const @"application/vnd.mobius.mbk": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.mbk" };
+ pub const @"application/vnd.mobius.mqy": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.mqy" };
+ pub const @"application/vnd.mobius.msl": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.msl" };
+ pub const @"application/vnd.mobius.plc": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.plc" };
+ pub const @"application/vnd.mobius.txf": MimeType = MimeType{ .category = .application, .value = "application/vnd.mobius.txf" };
+ pub const @"application/vnd.mophun.application": MimeType = MimeType{ .category = .application, .value = "application/vnd.mophun.application" };
+ pub const @"application/vnd.mophun.certificate": MimeType = MimeType{ .category = .application, .value = "application/vnd.mophun.certificate" };
+ pub const @"application/vnd.motorola.flexsuite": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite" };
+ pub const @"application/vnd.motorola.flexsuite.adsi": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.adsi" };
+ pub const @"application/vnd.motorola.flexsuite.fis": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.fis" };
+ pub const @"application/vnd.motorola.flexsuite.gotap": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.gotap" };
+ pub const @"application/vnd.motorola.flexsuite.kmr": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.kmr" };
+ pub const @"application/vnd.motorola.flexsuite.ttc": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.ttc" };
+ pub const @"application/vnd.motorola.flexsuite.wem": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.flexsuite.wem" };
+ pub const @"application/vnd.motorola.iprm": MimeType = MimeType{ .category = .application, .value = "application/vnd.motorola.iprm" };
+ pub const @"application/vnd.mozilla.xul+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.mozilla.xul+xml" };
+ pub const @"application/vnd.ms-3mfdocument": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-3mfdocument" };
+ pub const @"application/vnd.ms-artgalry": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-artgalry" };
+ pub const @"application/vnd.ms-asf": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-asf" };
+ pub const @"application/vnd.ms-cab-compressed": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-cab-compressed" };
+ pub const @"application/vnd.ms-color.iccprofile": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-color.iccprofile" };
+ pub const @"application/vnd.ms-excel": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-excel" };
+ pub const @"application/vnd.ms-excel.addin.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-excel.addin.macroenabled.12" };
+ pub const @"application/vnd.ms-excel.sheet.binary.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-excel.sheet.binary.macroenabled.12" };
+ pub const @"application/vnd.ms-excel.sheet.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-excel.sheet.macroenabled.12" };
+ pub const @"application/vnd.ms-excel.template.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-excel.template.macroenabled.12" };
+ pub const @"application/vnd.ms-fontobject": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-fontobject" };
+ pub const @"application/vnd.ms-htmlhelp": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-htmlhelp" };
+ pub const @"application/vnd.ms-ims": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-ims" };
+ pub const @"application/vnd.ms-lrm": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-lrm" };
+ pub const @"application/vnd.ms-office.activex+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-office.activex+xml" };
+ pub const @"application/vnd.ms-officetheme": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-officetheme" };
+ pub const @"application/vnd.ms-opentype": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-opentype" };
+ pub const @"application/vnd.ms-outlook": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-outlook" };
+ pub const @"application/vnd.ms-package.obfuscated-opentype": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-package.obfuscated-opentype" };
+ pub const @"application/vnd.ms-pki.seccat": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-pki.seccat" };
+ pub const @"application/vnd.ms-pki.stl": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-pki.stl" };
+ pub const @"application/vnd.ms-playready.initiator+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-playready.initiator+xml" };
+ pub const @"application/vnd.ms-powerpoint": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint" };
+ pub const @"application/vnd.ms-powerpoint.addin.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint.addin.macroenabled.12" };
+ pub const @"application/vnd.ms-powerpoint.presentation.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint.presentation.macroenabled.12" };
+ pub const @"application/vnd.ms-powerpoint.slide.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint.slide.macroenabled.12" };
+ pub const @"application/vnd.ms-powerpoint.slideshow.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint.slideshow.macroenabled.12" };
+ pub const @"application/vnd.ms-powerpoint.template.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-powerpoint.template.macroenabled.12" };
+ pub const @"application/vnd.ms-printdevicecapabilities+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-printdevicecapabilities+xml" };
+ pub const @"application/vnd.ms-printing.printticket+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-printing.printticket+xml" };
+ pub const @"application/vnd.ms-printschematicket+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-printschematicket+xml" };
+ pub const @"application/vnd.ms-project": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-project" };
+ pub const @"application/vnd.ms-tnef": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-tnef" };
+ pub const @"application/vnd.ms-windows.devicepairing": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-windows.devicepairing" };
+ pub const @"application/vnd.ms-windows.nwprinting.oob": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-windows.nwprinting.oob" };
+ pub const @"application/vnd.ms-windows.printerpairing": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-windows.printerpairing" };
+ pub const @"application/vnd.ms-windows.wsd.oob": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-windows.wsd.oob" };
+ pub const @"application/vnd.ms-wmdrm.lic-chlg-req": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-wmdrm.lic-chlg-req" };
+ pub const @"application/vnd.ms-wmdrm.lic-resp": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-wmdrm.lic-resp" };
+ pub const @"application/vnd.ms-wmdrm.meter-chlg-req": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-wmdrm.meter-chlg-req" };
+ pub const @"application/vnd.ms-wmdrm.meter-resp": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-wmdrm.meter-resp" };
+ pub const @"application/vnd.ms-word.document.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-word.document.macroenabled.12" };
+ pub const @"application/vnd.ms-word.template.macroenabled.12": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-word.template.macroenabled.12" };
+ pub const @"application/vnd.ms-works": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-works" };
+ pub const @"application/vnd.ms-wpl": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-wpl" };
+ pub const @"application/vnd.ms-xpsdocument": MimeType = MimeType{ .category = .application, .value = "application/vnd.ms-xpsdocument" };
+ pub const @"application/vnd.msa-disk-image": MimeType = MimeType{ .category = .application, .value = "application/vnd.msa-disk-image" };
+ pub const @"application/vnd.mseq": MimeType = MimeType{ .category = .application, .value = "application/vnd.mseq" };
+ pub const @"application/vnd.msign": MimeType = MimeType{ .category = .application, .value = "application/vnd.msign" };
+ pub const @"application/vnd.multiad.creator": MimeType = MimeType{ .category = .application, .value = "application/vnd.multiad.creator" };
+ pub const @"application/vnd.multiad.creator.cif": MimeType = MimeType{ .category = .application, .value = "application/vnd.multiad.creator.cif" };
+ pub const @"application/vnd.music-niff": MimeType = MimeType{ .category = .application, .value = "application/vnd.music-niff" };
+ pub const @"application/vnd.musician": MimeType = MimeType{ .category = .application, .value = "application/vnd.musician" };
+ pub const @"application/vnd.muvee.style": MimeType = MimeType{ .category = .application, .value = "application/vnd.muvee.style" };
+ pub const @"application/vnd.mynfc": MimeType = MimeType{ .category = .application, .value = "application/vnd.mynfc" };
+ pub const @"application/vnd.nacamar.ybrid+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.nacamar.ybrid+json" };
+ pub const @"application/vnd.ncd.control": MimeType = MimeType{ .category = .application, .value = "application/vnd.ncd.control" };
+ pub const @"application/vnd.ncd.reference": MimeType = MimeType{ .category = .application, .value = "application/vnd.ncd.reference" };
+ pub const @"application/vnd.nearst.inv+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.nearst.inv+json" };
+ pub const @"application/vnd.nebumind.line": MimeType = MimeType{ .category = .application, .value = "application/vnd.nebumind.line" };
+ pub const @"application/vnd.nervana": MimeType = MimeType{ .category = .application, .value = "application/vnd.nervana" };
+ pub const @"application/vnd.netfpx": MimeType = MimeType{ .category = .application, .value = "application/vnd.netfpx" };
+ pub const @"application/vnd.neurolanguage.nlu": MimeType = MimeType{ .category = .application, .value = "application/vnd.neurolanguage.nlu" };
+ pub const @"application/vnd.nimn": MimeType = MimeType{ .category = .application, .value = "application/vnd.nimn" };
+ pub const @"application/vnd.nintendo.nitro.rom": MimeType = MimeType{ .category = .application, .value = "application/vnd.nintendo.nitro.rom" };
+ pub const @"application/vnd.nintendo.snes.rom": MimeType = MimeType{ .category = .application, .value = "application/vnd.nintendo.snes.rom" };
+ pub const @"application/vnd.nitf": MimeType = MimeType{ .category = .application, .value = "application/vnd.nitf" };
+ pub const @"application/vnd.noblenet-directory": MimeType = MimeType{ .category = .application, .value = "application/vnd.noblenet-directory" };
+ pub const @"application/vnd.noblenet-sealer": MimeType = MimeType{ .category = .application, .value = "application/vnd.noblenet-sealer" };
+ pub const @"application/vnd.noblenet-web": MimeType = MimeType{ .category = .application, .value = "application/vnd.noblenet-web" };
+ pub const @"application/vnd.nokia.catalogs": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.catalogs" };
+ pub const @"application/vnd.nokia.conml+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.conml+wbxml" };
+ pub const @"application/vnd.nokia.conml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.conml+xml" };
+ pub const @"application/vnd.nokia.iptv.config+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.iptv.config+xml" };
+ pub const @"application/vnd.nokia.isds-radio-presets": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.isds-radio-presets" };
+ pub const @"application/vnd.nokia.landmark+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.landmark+wbxml" };
+ pub const @"application/vnd.nokia.landmark+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.landmark+xml" };
+ pub const @"application/vnd.nokia.landmarkcollection+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.landmarkcollection+xml" };
+ pub const @"application/vnd.nokia.n-gage.ac+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.n-gage.ac+xml" };
+ pub const @"application/vnd.nokia.n-gage.data": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.n-gage.data" };
+ pub const @"application/vnd.nokia.n-gage.symbian.install": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.n-gage.symbian.install" };
+ pub const @"application/vnd.nokia.ncd": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.ncd" };
+ pub const @"application/vnd.nokia.pcd+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.pcd+wbxml" };
+ pub const @"application/vnd.nokia.pcd+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.pcd+xml" };
+ pub const @"application/vnd.nokia.radio-preset": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.radio-preset" };
+ pub const @"application/vnd.nokia.radio-presets": MimeType = MimeType{ .category = .application, .value = "application/vnd.nokia.radio-presets" };
+ pub const @"application/vnd.novadigm.edm": MimeType = MimeType{ .category = .application, .value = "application/vnd.novadigm.edm" };
+ pub const @"application/vnd.novadigm.edx": MimeType = MimeType{ .category = .application, .value = "application/vnd.novadigm.edx" };
+ pub const @"application/vnd.novadigm.ext": MimeType = MimeType{ .category = .application, .value = "application/vnd.novadigm.ext" };
+ pub const @"application/vnd.ntt-local.content-share": MimeType = MimeType{ .category = .application, .value = "application/vnd.ntt-local.content-share" };
+ pub const @"application/vnd.ntt-local.file-transfer": MimeType = MimeType{ .category = .application, .value = "application/vnd.ntt-local.file-transfer" };
+ pub const @"application/vnd.ntt-local.ogw_remote-access": MimeType = MimeType{ .category = .application, .value = "application/vnd.ntt-local.ogw_remote-access" };
+ pub const @"application/vnd.ntt-local.sip-ta_remote": MimeType = MimeType{ .category = .application, .value = "application/vnd.ntt-local.sip-ta_remote" };
+ pub const @"application/vnd.ntt-local.sip-ta_tcp_stream": MimeType = MimeType{ .category = .application, .value = "application/vnd.ntt-local.sip-ta_tcp_stream" };
+ pub const @"application/vnd.oasis.opendocument.chart": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.chart" };
+ pub const @"application/vnd.oasis.opendocument.chart-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.chart-template" };
+ pub const @"application/vnd.oasis.opendocument.database": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.database" };
+ pub const @"application/vnd.oasis.opendocument.formula": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.formula" };
+ pub const @"application/vnd.oasis.opendocument.formula-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.formula-template" };
+ pub const @"application/vnd.oasis.opendocument.graphics": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.graphics" };
+ pub const @"application/vnd.oasis.opendocument.graphics-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.graphics-template" };
+ pub const @"application/vnd.oasis.opendocument.image": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.image" };
+ pub const @"application/vnd.oasis.opendocument.image-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.image-template" };
+ pub const @"application/vnd.oasis.opendocument.presentation": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.presentation" };
+ pub const @"application/vnd.oasis.opendocument.presentation-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.presentation-template" };
+ pub const @"application/vnd.oasis.opendocument.spreadsheet": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.spreadsheet" };
+ pub const @"application/vnd.oasis.opendocument.spreadsheet-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.spreadsheet-template" };
+ pub const @"application/vnd.oasis.opendocument.text": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.text" };
+ pub const @"application/vnd.oasis.opendocument.text-master": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.text-master" };
+ pub const @"application/vnd.oasis.opendocument.text-template": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.text-template" };
+ pub const @"application/vnd.oasis.opendocument.text-web": MimeType = MimeType{ .category = .application, .value = "application/vnd.oasis.opendocument.text-web" };
+ pub const @"application/vnd.obn": MimeType = MimeType{ .category = .application, .value = "application/vnd.obn" };
+ pub const @"application/vnd.ocf+cbor": MimeType = MimeType{ .category = .application, .value = "application/vnd.ocf+cbor" };
+ pub const @"application/vnd.oci.image.manifest.v1+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.oci.image.manifest.v1+json" };
+ pub const @"application/vnd.oftn.l10n+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.oftn.l10n+json" };
+ pub const @"application/vnd.oipf.contentaccessdownload+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.contentaccessdownload+xml" };
+ pub const @"application/vnd.oipf.contentaccessstreaming+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.contentaccessstreaming+xml" };
+ pub const @"application/vnd.oipf.cspg-hexbinary": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.cspg-hexbinary" };
+ pub const @"application/vnd.oipf.dae.svg+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.dae.svg+xml" };
+ pub const @"application/vnd.oipf.dae.xhtml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.dae.xhtml+xml" };
+ pub const @"application/vnd.oipf.mippvcontrolmessage+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.mippvcontrolmessage+xml" };
+ pub const @"application/vnd.oipf.pae.gem": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.pae.gem" };
+ pub const @"application/vnd.oipf.spdiscovery+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.spdiscovery+xml" };
+ pub const @"application/vnd.oipf.spdlist+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.spdlist+xml" };
+ pub const @"application/vnd.oipf.ueprofile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.ueprofile+xml" };
+ pub const @"application/vnd.oipf.userprofile+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oipf.userprofile+xml" };
+ pub const @"application/vnd.olpc-sugar": MimeType = MimeType{ .category = .application, .value = "application/vnd.olpc-sugar" };
+ pub const @"application/vnd.oma-scws-config": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma-scws-config" };
+ pub const @"application/vnd.oma-scws-http-request": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma-scws-http-request" };
+ pub const @"application/vnd.oma-scws-http-response": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma-scws-http-response" };
+ pub const @"application/vnd.oma.bcast.associated-procedure-parameter+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.associated-procedure-parameter+xml" };
+ pub const @"application/vnd.oma.bcast.drm-trigger+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.drm-trigger+xml" };
+ pub const @"application/vnd.oma.bcast.imd+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.imd+xml" };
+ pub const @"application/vnd.oma.bcast.ltkm": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.ltkm" };
+ pub const @"application/vnd.oma.bcast.notification+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.notification+xml" };
+ pub const @"application/vnd.oma.bcast.provisioningtrigger": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.provisioningtrigger" };
+ pub const @"application/vnd.oma.bcast.sgboot": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.sgboot" };
+ pub const @"application/vnd.oma.bcast.sgdd+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.sgdd+xml" };
+ pub const @"application/vnd.oma.bcast.sgdu": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.sgdu" };
+ pub const @"application/vnd.oma.bcast.simple-symbol-container": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.simple-symbol-container" };
+ pub const @"application/vnd.oma.bcast.smartcard-trigger+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.smartcard-trigger+xml" };
+ pub const @"application/vnd.oma.bcast.sprov+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.sprov+xml" };
+ pub const @"application/vnd.oma.bcast.stkm": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.bcast.stkm" };
+ pub const @"application/vnd.oma.cab-address-book+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.cab-address-book+xml" };
+ pub const @"application/vnd.oma.cab-feature-handler+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.cab-feature-handler+xml" };
+ pub const @"application/vnd.oma.cab-pcc+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.cab-pcc+xml" };
+ pub const @"application/vnd.oma.cab-subs-invite+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.cab-subs-invite+xml" };
+ pub const @"application/vnd.oma.cab-user-prefs+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.cab-user-prefs+xml" };
+ pub const @"application/vnd.oma.dcd": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.dcd" };
+ pub const @"application/vnd.oma.dcdc": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.dcdc" };
+ pub const @"application/vnd.oma.dd2+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.dd2+xml" };
+ pub const @"application/vnd.oma.drm.risd+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.drm.risd+xml" };
+ pub const @"application/vnd.oma.group-usage-list+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.group-usage-list+xml" };
+ pub const @"application/vnd.oma.lwm2m+cbor": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.lwm2m+cbor" };
+ pub const @"application/vnd.oma.lwm2m+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.lwm2m+json" };
+ pub const @"application/vnd.oma.lwm2m+tlv": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.lwm2m+tlv" };
+ pub const @"application/vnd.oma.pal+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.pal+xml" };
+ pub const @"application/vnd.oma.poc.detailed-progress-report+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.poc.detailed-progress-report+xml" };
+ pub const @"application/vnd.oma.poc.final-report+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.poc.final-report+xml" };
+ pub const @"application/vnd.oma.poc.groups+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.poc.groups+xml" };
+ pub const @"application/vnd.oma.poc.invocation-descriptor+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.poc.invocation-descriptor+xml" };
+ pub const @"application/vnd.oma.poc.optimized-progress-report+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.poc.optimized-progress-report+xml" };
+ pub const @"application/vnd.oma.push": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.push" };
+ pub const @"application/vnd.oma.scidm.messages+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.scidm.messages+xml" };
+ pub const @"application/vnd.oma.xcap-directory+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.oma.xcap-directory+xml" };
+ pub const @"application/vnd.omads-email+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.omads-email+xml" };
+ pub const @"application/vnd.omads-file+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.omads-file+xml" };
+ pub const @"application/vnd.omads-folder+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.omads-folder+xml" };
+ pub const @"application/vnd.omaloc-supl-init": MimeType = MimeType{ .category = .application, .value = "application/vnd.omaloc-supl-init" };
+ pub const @"application/vnd.onepager": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepager" };
+ pub const @"application/vnd.onepagertamp": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepagertamp" };
+ pub const @"application/vnd.onepagertamx": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepagertamx" };
+ pub const @"application/vnd.onepagertat": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepagertat" };
+ pub const @"application/vnd.onepagertatp": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepagertatp" };
+ pub const @"application/vnd.onepagertatx": MimeType = MimeType{ .category = .application, .value = "application/vnd.onepagertatx" };
+ pub const @"application/vnd.openblox.game+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openblox.game+xml" };
+ pub const @"application/vnd.openblox.game-binary": MimeType = MimeType{ .category = .application, .value = "application/vnd.openblox.game-binary" };
+ pub const @"application/vnd.openeye.oeb": MimeType = MimeType{ .category = .application, .value = "application/vnd.openeye.oeb" };
+ pub const @"application/vnd.openofficeorg.extension": MimeType = MimeType{ .category = .application, .value = "application/vnd.openofficeorg.extension" };
+ pub const @"application/vnd.openstreetmap.data+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openstreetmap.data+xml" };
+ pub const @"application/vnd.opentimestamps.ots": MimeType = MimeType{ .category = .application, .value = "application/vnd.opentimestamps.ots" };
+ pub const @"application/vnd.openxmlformats-officedocument.custom-properties+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.custom-properties+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.customxmlproperties+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.customxmlproperties+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawing+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawing+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.chart+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.extended-properties+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.extended-properties+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.comments+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.comments+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.presentation": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.presentation" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slide": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slide" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slide+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideshow": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slideshow" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.tags+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.tags+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.template" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.template" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.theme+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.theme+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.themeoverride+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.themeoverride+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.vmldrawing": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.vmldrawing" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.template" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" };
+ pub const @"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml" };
+ pub const @"application/vnd.openxmlformats-package.core-properties+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-package.core-properties+xml" };
+ pub const @"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml" };
+ pub const @"application/vnd.openxmlformats-package.relationships+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.openxmlformats-package.relationships+xml" };
+ pub const @"application/vnd.oracle.resource+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.oracle.resource+json" };
+ pub const @"application/vnd.orange.indata": MimeType = MimeType{ .category = .application, .value = "application/vnd.orange.indata" };
+ pub const @"application/vnd.osa.netdeploy": MimeType = MimeType{ .category = .application, .value = "application/vnd.osa.netdeploy" };
+ pub const @"application/vnd.osgeo.mapguide.package": MimeType = MimeType{ .category = .application, .value = "application/vnd.osgeo.mapguide.package" };
+ pub const @"application/vnd.osgi.bundle": MimeType = MimeType{ .category = .application, .value = "application/vnd.osgi.bundle" };
+ pub const @"application/vnd.osgi.dp": MimeType = MimeType{ .category = .application, .value = "application/vnd.osgi.dp" };
+ pub const @"application/vnd.osgi.subsystem": MimeType = MimeType{ .category = .application, .value = "application/vnd.osgi.subsystem" };
+ pub const @"application/vnd.otps.ct-kip+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.otps.ct-kip+xml" };
+ pub const @"application/vnd.oxli.countgraph": MimeType = MimeType{ .category = .application, .value = "application/vnd.oxli.countgraph" };
+ pub const @"application/vnd.pagerduty+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.pagerduty+json" };
+ pub const @"application/vnd.palm": MimeType = MimeType{ .category = .application, .value = "application/vnd.palm" };
+ pub const @"application/vnd.panoply": MimeType = MimeType{ .category = .application, .value = "application/vnd.panoply" };
+ pub const @"application/vnd.paos.xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.paos.xml" };
+ pub const @"application/vnd.patentdive": MimeType = MimeType{ .category = .application, .value = "application/vnd.patentdive" };
+ pub const @"application/vnd.patientecommsdoc": MimeType = MimeType{ .category = .application, .value = "application/vnd.patientecommsdoc" };
+ pub const @"application/vnd.pawaafile": MimeType = MimeType{ .category = .application, .value = "application/vnd.pawaafile" };
+ pub const @"application/vnd.pcos": MimeType = MimeType{ .category = .application, .value = "application/vnd.pcos" };
+ pub const @"application/vnd.pg.format": MimeType = MimeType{ .category = .application, .value = "application/vnd.pg.format" };
+ pub const @"application/vnd.pg.osasli": MimeType = MimeType{ .category = .application, .value = "application/vnd.pg.osasli" };
+ pub const @"application/vnd.piaccess.application-licence": MimeType = MimeType{ .category = .application, .value = "application/vnd.piaccess.application-licence" };
+ pub const @"application/vnd.picsel": MimeType = MimeType{ .category = .application, .value = "application/vnd.picsel" };
+ pub const @"application/vnd.pmi.widget": MimeType = MimeType{ .category = .application, .value = "application/vnd.pmi.widget" };
+ pub const @"application/vnd.poc.group-advertisement+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.poc.group-advertisement+xml" };
+ pub const @"application/vnd.pocketlearn": MimeType = MimeType{ .category = .application, .value = "application/vnd.pocketlearn" };
+ pub const @"application/vnd.powerbuilder6": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder6" };
+ pub const @"application/vnd.powerbuilder6-s": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder6-s" };
+ pub const @"application/vnd.powerbuilder7": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder7" };
+ pub const @"application/vnd.powerbuilder7-s": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder7-s" };
+ pub const @"application/vnd.powerbuilder75": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder75" };
+ pub const @"application/vnd.powerbuilder75-s": MimeType = MimeType{ .category = .application, .value = "application/vnd.powerbuilder75-s" };
+ pub const @"application/vnd.preminet": MimeType = MimeType{ .category = .application, .value = "application/vnd.preminet" };
+ pub const @"application/vnd.previewsystems.box": MimeType = MimeType{ .category = .application, .value = "application/vnd.previewsystems.box" };
+ pub const @"application/vnd.proteus.magazine": MimeType = MimeType{ .category = .application, .value = "application/vnd.proteus.magazine" };
+ pub const @"application/vnd.psfs": MimeType = MimeType{ .category = .application, .value = "application/vnd.psfs" };
+ pub const @"application/vnd.publishare-delta-tree": MimeType = MimeType{ .category = .application, .value = "application/vnd.publishare-delta-tree" };
+ pub const @"application/vnd.pvi.ptid1": MimeType = MimeType{ .category = .application, .value = "application/vnd.pvi.ptid1" };
+ pub const @"application/vnd.pwg-multiplexed": MimeType = MimeType{ .category = .application, .value = "application/vnd.pwg-multiplexed" };
+ pub const @"application/vnd.pwg-xhtml-print+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.pwg-xhtml-print+xml" };
+ pub const @"application/vnd.qualcomm.brew-app-res": MimeType = MimeType{ .category = .application, .value = "application/vnd.qualcomm.brew-app-res" };
+ pub const @"application/vnd.quarantainenet": MimeType = MimeType{ .category = .application, .value = "application/vnd.quarantainenet" };
+ pub const @"application/vnd.quark.quarkxpress": MimeType = MimeType{ .category = .application, .value = "application/vnd.quark.quarkxpress" };
+ pub const @"application/vnd.quobject-quoxdocument": MimeType = MimeType{ .category = .application, .value = "application/vnd.quobject-quoxdocument" };
+ pub const @"application/vnd.radisys.moml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.moml+xml" };
+ pub const @"application/vnd.radisys.msml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml+xml" };
+ pub const @"application/vnd.radisys.msml-audit+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-audit+xml" };
+ pub const @"application/vnd.radisys.msml-audit-conf+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-audit-conf+xml" };
+ pub const @"application/vnd.radisys.msml-audit-conn+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-audit-conn+xml" };
+ pub const @"application/vnd.radisys.msml-audit-dialog+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-audit-dialog+xml" };
+ pub const @"application/vnd.radisys.msml-audit-stream+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-audit-stream+xml" };
+ pub const @"application/vnd.radisys.msml-conf+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-conf+xml" };
+ pub const @"application/vnd.radisys.msml-dialog+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-base+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-base+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-fax-detect+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-fax-detect+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-fax-sendrecv+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-fax-sendrecv+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-group+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-group+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-speech+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-speech+xml" };
+ pub const @"application/vnd.radisys.msml-dialog-transform+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.radisys.msml-dialog-transform+xml" };
+ pub const @"application/vnd.rainstor.data": MimeType = MimeType{ .category = .application, .value = "application/vnd.rainstor.data" };
+ pub const @"application/vnd.rapid": MimeType = MimeType{ .category = .application, .value = "application/vnd.rapid" };
+ pub const @"application/vnd.rar": MimeType = MimeType{ .category = .application, .value = "application/vnd.rar" };
+ pub const @"application/vnd.realvnc.bed": MimeType = MimeType{ .category = .application, .value = "application/vnd.realvnc.bed" };
+ pub const @"application/vnd.recordare.musicxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.recordare.musicxml" };
+ pub const @"application/vnd.recordare.musicxml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.recordare.musicxml+xml" };
+ pub const @"application/vnd.renlearn.rlprint": MimeType = MimeType{ .category = .application, .value = "application/vnd.renlearn.rlprint" };
+ pub const @"application/vnd.resilient.logic": MimeType = MimeType{ .category = .application, .value = "application/vnd.resilient.logic" };
+ pub const @"application/vnd.restful+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.restful+json" };
+ pub const @"application/vnd.rig.cryptonote": MimeType = MimeType{ .category = .application, .value = "application/vnd.rig.cryptonote" };
+ pub const @"application/vnd.rim.cod": MimeType = MimeType{ .category = .application, .value = "application/vnd.rim.cod" };
+ pub const @"application/vnd.rn-realmedia": MimeType = MimeType{ .category = .application, .value = "application/vnd.rn-realmedia" };
+ pub const @"application/vnd.rn-realmedia-vbr": MimeType = MimeType{ .category = .application, .value = "application/vnd.rn-realmedia-vbr" };
+ pub const @"application/vnd.route66.link66+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.route66.link66+xml" };
+ pub const @"application/vnd.rs-274x": MimeType = MimeType{ .category = .application, .value = "application/vnd.rs-274x" };
+ pub const @"application/vnd.ruckus.download": MimeType = MimeType{ .category = .application, .value = "application/vnd.ruckus.download" };
+ pub const @"application/vnd.s3sms": MimeType = MimeType{ .category = .application, .value = "application/vnd.s3sms" };
+ pub const @"application/vnd.sailingtracker.track": MimeType = MimeType{ .category = .application, .value = "application/vnd.sailingtracker.track" };
+ pub const @"application/vnd.sar": MimeType = MimeType{ .category = .application, .value = "application/vnd.sar" };
+ pub const @"application/vnd.sbm.cid": MimeType = MimeType{ .category = .application, .value = "application/vnd.sbm.cid" };
+ pub const @"application/vnd.sbm.mid2": MimeType = MimeType{ .category = .application, .value = "application/vnd.sbm.mid2" };
+ pub const @"application/vnd.scribus": MimeType = MimeType{ .category = .application, .value = "application/vnd.scribus" };
+ pub const @"application/vnd.sealed.3df": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.3df" };
+ pub const @"application/vnd.sealed.csf": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.csf" };
+ pub const @"application/vnd.sealed.doc": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.doc" };
+ pub const @"application/vnd.sealed.eml": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.eml" };
+ pub const @"application/vnd.sealed.mht": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.mht" };
+ pub const @"application/vnd.sealed.net": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.net" };
+ pub const @"application/vnd.sealed.ppt": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.ppt" };
+ pub const @"application/vnd.sealed.tiff": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.tiff" };
+ pub const @"application/vnd.sealed.xls": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealed.xls" };
+ pub const @"application/vnd.sealedmedia.softseal.html": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealedmedia.softseal.html" };
+ pub const @"application/vnd.sealedmedia.softseal.pdf": MimeType = MimeType{ .category = .application, .value = "application/vnd.sealedmedia.softseal.pdf" };
+ pub const @"application/vnd.seemail": MimeType = MimeType{ .category = .application, .value = "application/vnd.seemail" };
+ pub const @"application/vnd.seis+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.seis+json" };
+ pub const @"application/vnd.sema": MimeType = MimeType{ .category = .application, .value = "application/vnd.sema" };
+ pub const @"application/vnd.semd": MimeType = MimeType{ .category = .application, .value = "application/vnd.semd" };
+ pub const @"application/vnd.semf": MimeType = MimeType{ .category = .application, .value = "application/vnd.semf" };
+ pub const @"application/vnd.shade-save-file": MimeType = MimeType{ .category = .application, .value = "application/vnd.shade-save-file" };
+ pub const @"application/vnd.shana.informed.formdata": MimeType = MimeType{ .category = .application, .value = "application/vnd.shana.informed.formdata" };
+ pub const @"application/vnd.shana.informed.formtemplate": MimeType = MimeType{ .category = .application, .value = "application/vnd.shana.informed.formtemplate" };
+ pub const @"application/vnd.shana.informed.interchange": MimeType = MimeType{ .category = .application, .value = "application/vnd.shana.informed.interchange" };
+ pub const @"application/vnd.shana.informed.package": MimeType = MimeType{ .category = .application, .value = "application/vnd.shana.informed.package" };
+ pub const @"application/vnd.shootproof+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.shootproof+json" };
+ pub const @"application/vnd.shopkick+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.shopkick+json" };
+ pub const @"application/vnd.shp": MimeType = MimeType{ .category = .application, .value = "application/vnd.shp" };
+ pub const @"application/vnd.shx": MimeType = MimeType{ .category = .application, .value = "application/vnd.shx" };
+ pub const @"application/vnd.sigrok.session": MimeType = MimeType{ .category = .application, .value = "application/vnd.sigrok.session" };
+ pub const @"application/vnd.simtech-mindmapper": MimeType = MimeType{ .category = .application, .value = "application/vnd.simtech-mindmapper" };
+ pub const @"application/vnd.siren+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.siren+json" };
+ pub const @"application/vnd.smaf": MimeType = MimeType{ .category = .application, .value = "application/vnd.smaf" };
+ pub const @"application/vnd.smart.notebook": MimeType = MimeType{ .category = .application, .value = "application/vnd.smart.notebook" };
+ pub const @"application/vnd.smart.teacher": MimeType = MimeType{ .category = .application, .value = "application/vnd.smart.teacher" };
+ pub const @"application/vnd.snesdev-page-table": MimeType = MimeType{ .category = .application, .value = "application/vnd.snesdev-page-table" };
+ pub const @"application/vnd.software602.filler.form+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.software602.filler.form+xml" };
+ pub const @"application/vnd.software602.filler.form-xml-zip": MimeType = MimeType{ .category = .application, .value = "application/vnd.software602.filler.form-xml-zip" };
+ pub const @"application/vnd.solent.sdkm+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.solent.sdkm+xml" };
+ pub const @"application/vnd.spotfire.dxp": MimeType = MimeType{ .category = .application, .value = "application/vnd.spotfire.dxp" };
+ pub const @"application/vnd.spotfire.sfs": MimeType = MimeType{ .category = .application, .value = "application/vnd.spotfire.sfs" };
+ pub const @"application/vnd.sqlite3": MimeType = MimeType{ .category = .application, .value = "application/vnd.sqlite3" };
+ pub const @"application/vnd.sss-cod": MimeType = MimeType{ .category = .application, .value = "application/vnd.sss-cod" };
+ pub const @"application/vnd.sss-dtf": MimeType = MimeType{ .category = .application, .value = "application/vnd.sss-dtf" };
+ pub const @"application/vnd.sss-ntf": MimeType = MimeType{ .category = .application, .value = "application/vnd.sss-ntf" };
+ pub const @"application/vnd.stardivision.calc": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.calc" };
+ pub const @"application/vnd.stardivision.draw": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.draw" };
+ pub const @"application/vnd.stardivision.impress": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.impress" };
+ pub const @"application/vnd.stardivision.math": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.math" };
+ pub const @"application/vnd.stardivision.writer": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.writer" };
+ pub const @"application/vnd.stardivision.writer-global": MimeType = MimeType{ .category = .application, .value = "application/vnd.stardivision.writer-global" };
+ pub const @"application/vnd.stepmania.package": MimeType = MimeType{ .category = .application, .value = "application/vnd.stepmania.package" };
+ pub const @"application/vnd.stepmania.stepchart": MimeType = MimeType{ .category = .application, .value = "application/vnd.stepmania.stepchart" };
+ pub const @"application/vnd.street-stream": MimeType = MimeType{ .category = .application, .value = "application/vnd.street-stream" };
+ pub const @"application/vnd.sun.wadl+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.wadl+xml" };
+ pub const @"application/vnd.sun.xml.calc": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.calc" };
+ pub const @"application/vnd.sun.xml.calc.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.calc.template" };
+ pub const @"application/vnd.sun.xml.draw": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.draw" };
+ pub const @"application/vnd.sun.xml.draw.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.draw.template" };
+ pub const @"application/vnd.sun.xml.impress": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.impress" };
+ pub const @"application/vnd.sun.xml.impress.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.impress.template" };
+ pub const @"application/vnd.sun.xml.math": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.math" };
+ pub const @"application/vnd.sun.xml.writer": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.writer" };
+ pub const @"application/vnd.sun.xml.writer.global": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.writer.global" };
+ pub const @"application/vnd.sun.xml.writer.template": MimeType = MimeType{ .category = .application, .value = "application/vnd.sun.xml.writer.template" };
+ pub const @"application/vnd.sus-calendar": MimeType = MimeType{ .category = .application, .value = "application/vnd.sus-calendar" };
+ pub const @"application/vnd.svd": MimeType = MimeType{ .category = .application, .value = "application/vnd.svd" };
+ pub const @"application/vnd.swiftview-ics": MimeType = MimeType{ .category = .application, .value = "application/vnd.swiftview-ics" };
+ pub const @"application/vnd.sycle+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.sycle+xml" };
+ pub const @"application/vnd.syft+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.syft+json" };
+ pub const @"application/vnd.symbian.install": MimeType = MimeType{ .category = .application, .value = "application/vnd.symbian.install" };
+ pub const @"application/vnd.syncml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml+xml" };
+ pub const @"application/vnd.syncml.dm+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dm+wbxml" };
+ pub const @"application/vnd.syncml.dm+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dm+xml" };
+ pub const @"application/vnd.syncml.dm.notification": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dm.notification" };
+ pub const @"application/vnd.syncml.dmddf+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dmddf+wbxml" };
+ pub const @"application/vnd.syncml.dmddf+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dmddf+xml" };
+ pub const @"application/vnd.syncml.dmtnds+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dmtnds+wbxml" };
+ pub const @"application/vnd.syncml.dmtnds+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.dmtnds+xml" };
+ pub const @"application/vnd.syncml.ds.notification": MimeType = MimeType{ .category = .application, .value = "application/vnd.syncml.ds.notification" };
+ pub const @"application/vnd.tableschema+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.tableschema+json" };
+ pub const @"application/vnd.tao.intent-module-archive": MimeType = MimeType{ .category = .application, .value = "application/vnd.tao.intent-module-archive" };
+ pub const @"application/vnd.tcpdump.pcap": MimeType = MimeType{ .category = .application, .value = "application/vnd.tcpdump.pcap" };
+ pub const @"application/vnd.think-cell.ppttc+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.think-cell.ppttc+json" };
+ pub const @"application/vnd.tmd.mediaflex.api+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.tmd.mediaflex.api+xml" };
+ pub const @"application/vnd.tml": MimeType = MimeType{ .category = .application, .value = "application/vnd.tml" };
+ pub const @"application/vnd.tmobile-livetv": MimeType = MimeType{ .category = .application, .value = "application/vnd.tmobile-livetv" };
+ pub const @"application/vnd.tri.onesource": MimeType = MimeType{ .category = .application, .value = "application/vnd.tri.onesource" };
+ pub const @"application/vnd.trid.tpt": MimeType = MimeType{ .category = .application, .value = "application/vnd.trid.tpt" };
+ pub const @"application/vnd.triscape.mxs": MimeType = MimeType{ .category = .application, .value = "application/vnd.triscape.mxs" };
+ pub const @"application/vnd.trueapp": MimeType = MimeType{ .category = .application, .value = "application/vnd.trueapp" };
+ pub const @"application/vnd.truedoc": MimeType = MimeType{ .category = .application, .value = "application/vnd.truedoc" };
+ pub const @"application/vnd.ubisoft.webplayer": MimeType = MimeType{ .category = .application, .value = "application/vnd.ubisoft.webplayer" };
+ pub const @"application/vnd.ufdl": MimeType = MimeType{ .category = .application, .value = "application/vnd.ufdl" };
+ pub const @"application/vnd.uiq.theme": MimeType = MimeType{ .category = .application, .value = "application/vnd.uiq.theme" };
+ pub const @"application/vnd.umajin": MimeType = MimeType{ .category = .application, .value = "application/vnd.umajin" };
+ pub const @"application/vnd.unity": MimeType = MimeType{ .category = .application, .value = "application/vnd.unity" };
+ pub const @"application/vnd.uoml+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uoml+xml" };
+ pub const @"application/vnd.uplanet.alert": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.alert" };
+ pub const @"application/vnd.uplanet.alert-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.alert-wbxml" };
+ pub const @"application/vnd.uplanet.bearer-choice": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.bearer-choice" };
+ pub const @"application/vnd.uplanet.bearer-choice-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.bearer-choice-wbxml" };
+ pub const @"application/vnd.uplanet.cacheop": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.cacheop" };
+ pub const @"application/vnd.uplanet.cacheop-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.cacheop-wbxml" };
+ pub const @"application/vnd.uplanet.channel": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.channel" };
+ pub const @"application/vnd.uplanet.channel-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.channel-wbxml" };
+ pub const @"application/vnd.uplanet.list": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.list" };
+ pub const @"application/vnd.uplanet.list-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.list-wbxml" };
+ pub const @"application/vnd.uplanet.listcmd": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.listcmd" };
+ pub const @"application/vnd.uplanet.listcmd-wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.listcmd-wbxml" };
+ pub const @"application/vnd.uplanet.signal": MimeType = MimeType{ .category = .application, .value = "application/vnd.uplanet.signal" };
+ pub const @"application/vnd.uri-map": MimeType = MimeType{ .category = .application, .value = "application/vnd.uri-map" };
+ pub const @"application/vnd.valve.source.material": MimeType = MimeType{ .category = .application, .value = "application/vnd.valve.source.material" };
+ pub const @"application/vnd.vcx": MimeType = MimeType{ .category = .application, .value = "application/vnd.vcx" };
+ pub const @"application/vnd.vd-study": MimeType = MimeType{ .category = .application, .value = "application/vnd.vd-study" };
+ pub const @"application/vnd.vectorworks": MimeType = MimeType{ .category = .application, .value = "application/vnd.vectorworks" };
+ pub const @"application/vnd.vel+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.vel+json" };
+ pub const @"application/vnd.verimatrix.vcas": MimeType = MimeType{ .category = .application, .value = "application/vnd.verimatrix.vcas" };
+ pub const @"application/vnd.veritone.aion+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.veritone.aion+json" };
+ pub const @"application/vnd.veryant.thin": MimeType = MimeType{ .category = .application, .value = "application/vnd.veryant.thin" };
+ pub const @"application/vnd.ves.encrypted": MimeType = MimeType{ .category = .application, .value = "application/vnd.ves.encrypted" };
+ pub const @"application/vnd.vidsoft.vidconference": MimeType = MimeType{ .category = .application, .value = "application/vnd.vidsoft.vidconference" };
+ pub const @"application/vnd.visio": MimeType = MimeType{ .category = .application, .value = "application/vnd.visio" };
+ pub const @"application/vnd.visionary": MimeType = MimeType{ .category = .application, .value = "application/vnd.visionary" };
+ pub const @"application/vnd.vividence.scriptfile": MimeType = MimeType{ .category = .application, .value = "application/vnd.vividence.scriptfile" };
+ pub const @"application/vnd.vsf": MimeType = MimeType{ .category = .application, .value = "application/vnd.vsf" };
+ pub const @"application/vnd.wap.sic": MimeType = MimeType{ .category = .application, .value = "application/vnd.wap.sic" };
+ pub const @"application/vnd.wap.slc": MimeType = MimeType{ .category = .application, .value = "application/vnd.wap.slc" };
+ pub const @"application/vnd.wap.wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.wap.wbxml" };
+ pub const @"application/vnd.wap.wmlc": MimeType = MimeType{ .category = .application, .value = "application/vnd.wap.wmlc" };
+ pub const @"application/vnd.wap.wmlscriptc": MimeType = MimeType{ .category = .application, .value = "application/vnd.wap.wmlscriptc" };
+ pub const @"application/vnd.webturbo": MimeType = MimeType{ .category = .application, .value = "application/vnd.webturbo" };
+ pub const @"application/vnd.wfa.dpp": MimeType = MimeType{ .category = .application, .value = "application/vnd.wfa.dpp" };
+ pub const @"application/vnd.wfa.p2p": MimeType = MimeType{ .category = .application, .value = "application/vnd.wfa.p2p" };
+ pub const @"application/vnd.wfa.wsc": MimeType = MimeType{ .category = .application, .value = "application/vnd.wfa.wsc" };
+ pub const @"application/vnd.windows.devicepairing": MimeType = MimeType{ .category = .application, .value = "application/vnd.windows.devicepairing" };
+ pub const @"application/vnd.wmc": MimeType = MimeType{ .category = .application, .value = "application/vnd.wmc" };
+ pub const @"application/vnd.wmf.bootstrap": MimeType = MimeType{ .category = .application, .value = "application/vnd.wmf.bootstrap" };
+ pub const @"application/vnd.wolfram.mathematica": MimeType = MimeType{ .category = .application, .value = "application/vnd.wolfram.mathematica" };
+ pub const @"application/vnd.wolfram.mathematica.package": MimeType = MimeType{ .category = .application, .value = "application/vnd.wolfram.mathematica.package" };
+ pub const @"application/vnd.wolfram.player": MimeType = MimeType{ .category = .application, .value = "application/vnd.wolfram.player" };
+ pub const @"application/vnd.wordperfect": MimeType = MimeType{ .category = .application, .value = "application/vnd.wordperfect" };
+ pub const @"application/vnd.wqd": MimeType = MimeType{ .category = .application, .value = "application/vnd.wqd" };
+ pub const @"application/vnd.wrq-hp3000-labelled": MimeType = MimeType{ .category = .application, .value = "application/vnd.wrq-hp3000-labelled" };
+ pub const @"application/vnd.wt.stf": MimeType = MimeType{ .category = .application, .value = "application/vnd.wt.stf" };
+ pub const @"application/vnd.wv.csp+wbxml": MimeType = MimeType{ .category = .application, .value = "application/vnd.wv.csp+wbxml" };
+ pub const @"application/vnd.wv.csp+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.wv.csp+xml" };
+ pub const @"application/vnd.wv.ssp+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.wv.ssp+xml" };
+ pub const @"application/vnd.xacml+json": MimeType = MimeType{ .category = .application, .value = "application/vnd.xacml+json" };
+ pub const @"application/vnd.xara": MimeType = MimeType{ .category = .application, .value = "application/vnd.xara" };
+ pub const @"application/vnd.xfdl": MimeType = MimeType{ .category = .application, .value = "application/vnd.xfdl" };
+ pub const @"application/vnd.xfdl.webform": MimeType = MimeType{ .category = .application, .value = "application/vnd.xfdl.webform" };
+ pub const @"application/vnd.xmi+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmi+xml" };
+ pub const @"application/vnd.xmpie.cpkg": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmpie.cpkg" };
+ pub const @"application/vnd.xmpie.dpkg": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmpie.dpkg" };
+ pub const @"application/vnd.xmpie.plan": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmpie.plan" };
+ pub const @"application/vnd.xmpie.ppkg": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmpie.ppkg" };
+ pub const @"application/vnd.xmpie.xlim": MimeType = MimeType{ .category = .application, .value = "application/vnd.xmpie.xlim" };
+ pub const @"application/vnd.yamaha.hv-dic": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.hv-dic" };
+ pub const @"application/vnd.yamaha.hv-script": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.hv-script" };
+ pub const @"application/vnd.yamaha.hv-voice": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.hv-voice" };
+ pub const @"application/vnd.yamaha.openscoreformat": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.openscoreformat" };
+ pub const @"application/vnd.yamaha.openscoreformat.osfpvg+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.openscoreformat.osfpvg+xml" };
+ pub const @"application/vnd.yamaha.remote-setup": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.remote-setup" };
+ pub const @"application/vnd.yamaha.smaf-audio": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.smaf-audio" };
+ pub const @"application/vnd.yamaha.smaf-phrase": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.smaf-phrase" };
+ pub const @"application/vnd.yamaha.through-ngn": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.through-ngn" };
+ pub const @"application/vnd.yamaha.tunnel-udpencap": MimeType = MimeType{ .category = .application, .value = "application/vnd.yamaha.tunnel-udpencap" };
+ pub const @"application/vnd.yaoweme": MimeType = MimeType{ .category = .application, .value = "application/vnd.yaoweme" };
+ pub const @"application/vnd.yellowriver-custom-menu": MimeType = MimeType{ .category = .application, .value = "application/vnd.yellowriver-custom-menu" };
+ pub const @"application/vnd.youtube.yt": MimeType = MimeType{ .category = .application, .value = "application/vnd.youtube.yt" };
+ pub const @"application/vnd.zul": MimeType = MimeType{ .category = .application, .value = "application/vnd.zul" };
+ pub const @"application/vnd.zzazz.deck+xml": MimeType = MimeType{ .category = .application, .value = "application/vnd.zzazz.deck+xml" };
+ pub const @"application/voicexml+xml": MimeType = MimeType{ .category = .application, .value = "application/voicexml+xml" };
+ pub const @"application/voucher-cms+json": MimeType = MimeType{ .category = .application, .value = "application/voucher-cms+json" };
+ pub const @"application/vq-rtcpxr": MimeType = MimeType{ .category = .application, .value = "application/vq-rtcpxr" };
+ pub const @"application/watcherinfo+xml": MimeType = MimeType{ .category = .application, .value = "application/watcherinfo+xml" };
+ pub const @"application/webpush-options+json": MimeType = MimeType{ .category = .application, .value = "application/webpush-options+json" };
+ pub const @"application/whoispp-query": MimeType = MimeType{ .category = .application, .value = "application/whoispp-query" };
+ pub const @"application/whoispp-response": MimeType = MimeType{ .category = .application, .value = "application/whoispp-response" };
+ pub const @"application/widget": MimeType = MimeType{ .category = .application, .value = "application/widget" };
+ pub const @"application/winhlp": MimeType = MimeType{ .category = .application, .value = "application/winhlp" };
+ pub const @"application/wita": MimeType = MimeType{ .category = .application, .value = "application/wita" };
+ pub const @"application/wordperfect5.1": MimeType = MimeType{ .category = .application, .value = "application/wordperfect5.1" };
+ pub const @"application/wsdl+xml": MimeType = MimeType{ .category = .application, .value = "application/wsdl+xml" };
+ pub const @"application/wspolicy+xml": MimeType = MimeType{ .category = .application, .value = "application/wspolicy+xml" };
+ pub const @"application/x-7z-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-7z-compressed" };
+ pub const @"application/x-abiword": MimeType = MimeType{ .category = .application, .value = "application/x-abiword" };
+ pub const @"application/x-ace-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-ace-compressed" };
+ pub const @"application/x-amf": MimeType = MimeType{ .category = .application, .value = "application/x-amf" };
+ pub const @"application/x-apple-diskimage": MimeType = MimeType{ .category = .application, .value = "application/x-apple-diskimage" };
+ pub const @"application/x-arj": MimeType = MimeType{ .category = .application, .value = "application/x-arj" };
+ pub const @"application/x-authorware-bin": MimeType = MimeType{ .category = .application, .value = "application/x-authorware-bin" };
+ pub const @"application/x-authorware-map": MimeType = MimeType{ .category = .application, .value = "application/x-authorware-map" };
+ pub const @"application/x-authorware-seg": MimeType = MimeType{ .category = .application, .value = "application/x-authorware-seg" };
+ pub const @"application/x-bcpio": MimeType = MimeType{ .category = .application, .value = "application/x-bcpio" };
+ pub const @"application/x-bdoc": MimeType = MimeType{ .category = .application, .value = "application/x-bdoc" };
+ pub const @"application/x-bittorrent": MimeType = MimeType{ .category = .application, .value = "application/x-bittorrent" };
+ pub const @"application/x-blorb": MimeType = MimeType{ .category = .application, .value = "application/x-blorb" };
+ pub const @"application/x-bzip": MimeType = MimeType{ .category = .application, .value = "application/x-bzip" };
+ pub const @"application/x-bzip2": MimeType = MimeType{ .category = .application, .value = "application/x-bzip2" };
+ pub const @"application/x-cbr": MimeType = MimeType{ .category = .application, .value = "application/x-cbr" };
+ pub const @"application/x-cdlink": MimeType = MimeType{ .category = .application, .value = "application/x-cdlink" };
+ pub const @"application/x-cfs-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-cfs-compressed" };
+ pub const @"application/x-chat": MimeType = MimeType{ .category = .application, .value = "application/x-chat" };
+ pub const @"application/x-chess-pgn": MimeType = MimeType{ .category = .application, .value = "application/x-chess-pgn" };
+ pub const @"application/x-chrome-extension": MimeType = MimeType{ .category = .application, .value = "application/x-chrome-extension" };
+ pub const @"application/x-cocoa": MimeType = MimeType{ .category = .application, .value = "application/x-cocoa" };
+ pub const @"application/x-compress": MimeType = MimeType{ .category = .application, .value = "application/x-compress" };
+ pub const @"application/x-conference": MimeType = MimeType{ .category = .application, .value = "application/x-conference" };
+ pub const @"application/x-cpio": MimeType = MimeType{ .category = .application, .value = "application/x-cpio" };
+ pub const @"application/x-csh": MimeType = MimeType{ .category = .application, .value = "application/x-csh" };
+ pub const @"application/x-deb": MimeType = MimeType{ .category = .application, .value = "application/x-deb" };
+ pub const @"application/x-debian-package": MimeType = MimeType{ .category = .application, .value = "application/x-debian-package" };
+ pub const @"application/x-dgc-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-dgc-compressed" };
+ pub const @"application/x-director": MimeType = MimeType{ .category = .application, .value = "application/x-director" };
+ pub const @"application/x-doom": MimeType = MimeType{ .category = .application, .value = "application/x-doom" };
+ pub const @"application/x-dtbncx+xml": MimeType = MimeType{ .category = .application, .value = "application/x-dtbncx+xml" };
+ pub const @"application/x-dtbook+xml": MimeType = MimeType{ .category = .application, .value = "application/x-dtbook+xml" };
+ pub const @"application/x-dtbresource+xml": MimeType = MimeType{ .category = .application, .value = "application/x-dtbresource+xml" };
+ pub const @"application/x-dvi": MimeType = MimeType{ .category = .application, .value = "application/x-dvi" };
+ pub const @"application/x-envoy": MimeType = MimeType{ .category = .application, .value = "application/x-envoy" };
+ pub const @"application/x-eva": MimeType = MimeType{ .category = .application, .value = "application/x-eva" };
+ pub const @"application/x-font-bdf": MimeType = MimeType{ .category = .application, .value = "application/x-font-bdf" };
+ pub const @"application/x-font-dos": MimeType = MimeType{ .category = .application, .value = "application/x-font-dos" };
+ pub const @"application/x-font-framemaker": MimeType = MimeType{ .category = .application, .value = "application/x-font-framemaker" };
+ pub const @"application/x-font-ghostscript": MimeType = MimeType{ .category = .application, .value = "application/x-font-ghostscript" };
+ pub const @"application/x-font-libgrx": MimeType = MimeType{ .category = .application, .value = "application/x-font-libgrx" };
+ pub const @"application/x-font-linux-psf": MimeType = MimeType{ .category = .application, .value = "application/x-font-linux-psf" };
+ pub const @"application/x-font-pcf": MimeType = MimeType{ .category = .application, .value = "application/x-font-pcf" };
+ pub const @"application/x-font-snf": MimeType = MimeType{ .category = .application, .value = "application/x-font-snf" };
+ pub const @"application/x-font-speedo": MimeType = MimeType{ .category = .application, .value = "application/x-font-speedo" };
+ pub const @"application/x-font-sunos-news": MimeType = MimeType{ .category = .application, .value = "application/x-font-sunos-news" };
+ pub const @"application/x-font-type1": MimeType = MimeType{ .category = .application, .value = "application/x-font-type1" };
+ pub const @"application/x-font-vfont": MimeType = MimeType{ .category = .application, .value = "application/x-font-vfont" };
+ pub const @"application/x-freearc": MimeType = MimeType{ .category = .application, .value = "application/x-freearc" };
+ pub const @"application/x-futuresplash": MimeType = MimeType{ .category = .application, .value = "application/x-futuresplash" };
+ pub const @"application/x-gca-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-gca-compressed" };
+ pub const @"application/x-glulx": MimeType = MimeType{ .category = .application, .value = "application/x-glulx" };
+ pub const @"application/x-gnumeric": MimeType = MimeType{ .category = .application, .value = "application/x-gnumeric" };
+ pub const @"application/x-gramps-xml": MimeType = MimeType{ .category = .application, .value = "application/x-gramps-xml" };
+ pub const @"application/x-gtar": MimeType = MimeType{ .category = .application, .value = "application/x-gtar" };
+ pub const @"application/x-gzip": MimeType = MimeType{ .category = .application, .value = "application/x-gzip" };
+ pub const @"application/x-hdf": MimeType = MimeType{ .category = .application, .value = "application/x-hdf" };
+ pub const @"application/x-httpd-php": MimeType = MimeType{ .category = .application, .value = "application/x-httpd-php" };
+ pub const @"application/x-install-instructions": MimeType = MimeType{ .category = .application, .value = "application/x-install-instructions" };
+ pub const @"application/x-iso9660-image": MimeType = MimeType{ .category = .application, .value = "application/x-iso9660-image" };
+ pub const @"application/x-iwork-keynote-sffkey": MimeType = MimeType{ .category = .application, .value = "application/x-iwork-keynote-sffkey" };
+ pub const @"application/x-iwork-numbers-sffnumbers": MimeType = MimeType{ .category = .application, .value = "application/x-iwork-numbers-sffnumbers" };
+ pub const @"application/x-iwork-pages-sffpages": MimeType = MimeType{ .category = .application, .value = "application/x-iwork-pages-sffpages" };
+ pub const @"application/x-java-archive-diff": MimeType = MimeType{ .category = .application, .value = "application/x-java-archive-diff" };
+ pub const @"application/x-java-jnlp-file": MimeType = MimeType{ .category = .application, .value = "application/x-java-jnlp-file" };
+ pub const @"application/x-javascript": MimeType = MimeType{ .category = .application, .value = "application/x-javascript" };
+ pub const @"application/x-keepass2": MimeType = MimeType{ .category = .application, .value = "application/x-keepass2" };
+ pub const @"application/x-latex": MimeType = MimeType{ .category = .application, .value = "application/x-latex" };
+ pub const @"application/x-lua-bytecode": MimeType = MimeType{ .category = .application, .value = "application/x-lua-bytecode" };
+ pub const @"application/x-lzh-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-lzh-compressed" };
+ pub const @"application/x-makeself": MimeType = MimeType{ .category = .application, .value = "application/x-makeself" };
+ pub const @"application/x-mie": MimeType = MimeType{ .category = .application, .value = "application/x-mie" };
+ pub const @"application/x-mobipocket-ebook": MimeType = MimeType{ .category = .application, .value = "application/x-mobipocket-ebook" };
+ pub const @"application/x-mpegurl": MimeType = MimeType{ .category = .application, .value = "application/x-mpegurl" };
+ pub const @"application/x-ms-application": MimeType = MimeType{ .category = .application, .value = "application/x-ms-application" };
+ pub const @"application/x-ms-shortcut": MimeType = MimeType{ .category = .application, .value = "application/x-ms-shortcut" };
+ pub const @"application/x-ms-wmd": MimeType = MimeType{ .category = .application, .value = "application/x-ms-wmd" };
+ pub const @"application/x-ms-wmz": MimeType = MimeType{ .category = .application, .value = "application/x-ms-wmz" };
+ pub const @"application/x-ms-xbap": MimeType = MimeType{ .category = .application, .value = "application/x-ms-xbap" };
+ pub const @"application/x-msaccess": MimeType = MimeType{ .category = .application, .value = "application/x-msaccess" };
+ pub const @"application/x-msbinder": MimeType = MimeType{ .category = .application, .value = "application/x-msbinder" };
+ pub const @"application/x-mscardfile": MimeType = MimeType{ .category = .application, .value = "application/x-mscardfile" };
+ pub const @"application/x-msclip": MimeType = MimeType{ .category = .application, .value = "application/x-msclip" };
+ pub const @"application/x-msdos-program": MimeType = MimeType{ .category = .application, .value = "application/x-msdos-program" };
+ pub const @"application/x-msdownload": MimeType = MimeType{ .category = .application, .value = "application/x-msdownload" };
+ pub const @"application/x-msmediaview": MimeType = MimeType{ .category = .application, .value = "application/x-msmediaview" };
+ pub const @"application/x-msmetafile": MimeType = MimeType{ .category = .application, .value = "application/x-msmetafile" };
+ pub const @"application/x-msmoney": MimeType = MimeType{ .category = .application, .value = "application/x-msmoney" };
+ pub const @"application/x-mspublisher": MimeType = MimeType{ .category = .application, .value = "application/x-mspublisher" };
+ pub const @"application/x-msschedule": MimeType = MimeType{ .category = .application, .value = "application/x-msschedule" };
+ pub const @"application/x-msterminal": MimeType = MimeType{ .category = .application, .value = "application/x-msterminal" };
+ pub const @"application/x-mswrite": MimeType = MimeType{ .category = .application, .value = "application/x-mswrite" };
+ pub const @"application/x-netcdf": MimeType = MimeType{ .category = .application, .value = "application/x-netcdf" };
+ pub const @"application/x-ns-proxy-autoconfig": MimeType = MimeType{ .category = .application, .value = "application/x-ns-proxy-autoconfig" };
+ pub const @"application/x-nzb": MimeType = MimeType{ .category = .application, .value = "application/x-nzb" };
+ pub const @"application/x-perl": MimeType = MimeType{ .category = .application, .value = "application/x-perl" };
+ pub const @"application/x-pilot": MimeType = MimeType{ .category = .application, .value = "application/x-pilot" };
+ pub const @"application/x-pkcs12": MimeType = MimeType{ .category = .application, .value = "application/x-pkcs12" };
+ pub const @"application/x-pkcs7-certificates": MimeType = MimeType{ .category = .application, .value = "application/x-pkcs7-certificates" };
+ pub const @"application/x-pkcs7-certreqresp": MimeType = MimeType{ .category = .application, .value = "application/x-pkcs7-certreqresp" };
+ pub const @"application/x-pki-message": MimeType = MimeType{ .category = .application, .value = "application/x-pki-message" };
+ pub const @"application/x-rar-compressed": MimeType = MimeType{ .category = .application, .value = "application/x-rar-compressed" };
+ pub const @"application/x-redhat-package-manager": MimeType = MimeType{ .category = .application, .value = "application/x-redhat-package-manager" };
+ pub const @"application/x-research-info-systems": MimeType = MimeType{ .category = .application, .value = "application/x-research-info-systems" };
+ pub const @"application/x-sea": MimeType = MimeType{ .category = .application, .value = "application/x-sea" };
+ pub const @"application/x-sh": MimeType = MimeType{ .category = .application, .value = "application/x-sh" };
+ pub const @"application/x-shar": MimeType = MimeType{ .category = .application, .value = "application/x-shar" };
+ pub const @"application/x-shockwave-flash": MimeType = MimeType{ .category = .application, .value = "application/x-shockwave-flash" };
+ pub const @"application/x-silverlight-app": MimeType = MimeType{ .category = .application, .value = "application/x-silverlight-app" };
+ pub const @"application/x-sql": MimeType = MimeType{ .category = .application, .value = "application/x-sql" };
+ pub const @"application/x-stuffit": MimeType = MimeType{ .category = .application, .value = "application/x-stuffit" };
+ pub const @"application/x-stuffitx": MimeType = MimeType{ .category = .application, .value = "application/x-stuffitx" };
+ pub const @"application/x-subrip": MimeType = MimeType{ .category = .application, .value = "application/x-subrip" };
+ pub const @"application/x-sv4cpio": MimeType = MimeType{ .category = .application, .value = "application/x-sv4cpio" };
+ pub const @"application/x-sv4crc": MimeType = MimeType{ .category = .application, .value = "application/x-sv4crc" };
+ pub const @"application/x-t3vm-image": MimeType = MimeType{ .category = .application, .value = "application/x-t3vm-image" };
+ pub const @"application/x-tads": MimeType = MimeType{ .category = .application, .value = "application/x-tads" };
+ pub const @"application/x-tar": MimeType = MimeType{ .category = .application, .value = "application/x-tar" };
+ pub const @"application/x-tcl": MimeType = MimeType{ .category = .application, .value = "application/x-tcl" };
+ pub const @"application/x-tex": MimeType = MimeType{ .category = .application, .value = "application/x-tex" };
+ pub const @"application/x-tex-tfm": MimeType = MimeType{ .category = .application, .value = "application/x-tex-tfm" };
+ pub const @"application/x-texinfo": MimeType = MimeType{ .category = .application, .value = "application/x-texinfo" };
+ pub const @"application/x-tgif": MimeType = MimeType{ .category = .application, .value = "application/x-tgif" };
+ pub const @"application/x-ustar": MimeType = MimeType{ .category = .application, .value = "application/x-ustar" };
+ pub const @"application/x-virtualbox-hdd": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-hdd" };
+ pub const @"application/x-virtualbox-ova": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-ova" };
+ pub const @"application/x-virtualbox-ovf": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-ovf" };
+ pub const @"application/x-virtualbox-vbox": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-vbox" };
+ pub const @"application/x-virtualbox-vbox-extpack": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-vbox-extpack" };
+ pub const @"application/x-virtualbox-vdi": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-vdi" };
+ pub const @"application/x-virtualbox-vhd": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-vhd" };
+ pub const @"application/x-virtualbox-vmdk": MimeType = MimeType{ .category = .application, .value = "application/x-virtualbox-vmdk" };
+ pub const @"application/x-wais-source": MimeType = MimeType{ .category = .application, .value = "application/x-wais-source" };
+ pub const @"application/x-web-app-manifest+json": MimeType = MimeType{ .category = .application, .value = "application/x-web-app-manifest+json" };
+ pub const @"application/x-www-form-urlencoded": MimeType = MimeType{ .category = .application, .value = "application/x-www-form-urlencoded" };
+ pub const @"application/x-x509-ca-cert": MimeType = MimeType{ .category = .application, .value = "application/x-x509-ca-cert" };
+ pub const @"application/x-x509-ca-ra-cert": MimeType = MimeType{ .category = .application, .value = "application/x-x509-ca-ra-cert" };
+ pub const @"application/x-x509-next-ca-cert": MimeType = MimeType{ .category = .application, .value = "application/x-x509-next-ca-cert" };
+ pub const @"application/x-xfig": MimeType = MimeType{ .category = .application, .value = "application/x-xfig" };
+ pub const @"application/x-xliff+xml": MimeType = MimeType{ .category = .application, .value = "application/x-xliff+xml" };
+ pub const @"application/x-xpinstall": MimeType = MimeType{ .category = .application, .value = "application/x-xpinstall" };
+ pub const @"application/x-xz": MimeType = MimeType{ .category = .application, .value = "application/x-xz" };
+ pub const @"application/x-zmachine": MimeType = MimeType{ .category = .application, .value = "application/x-zmachine" };
+ pub const @"application/x400-bp": MimeType = MimeType{ .category = .application, .value = "application/x400-bp" };
+ pub const @"application/xacml+xml": MimeType = MimeType{ .category = .application, .value = "application/xacml+xml" };
+ pub const @"application/xaml+xml": MimeType = MimeType{ .category = .application, .value = "application/xaml+xml" };
+ pub const @"application/xcap-att+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-att+xml" };
+ pub const @"application/xcap-caps+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-caps+xml" };
+ pub const @"application/xcap-diff+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-diff+xml" };
+ pub const @"application/xcap-el+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-el+xml" };
+ pub const @"application/xcap-error+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-error+xml" };
+ pub const @"application/xcap-ns+xml": MimeType = MimeType{ .category = .application, .value = "application/xcap-ns+xml" };
+ pub const @"application/xcon-conference-info+xml": MimeType = MimeType{ .category = .application, .value = "application/xcon-conference-info+xml" };
+ pub const @"application/xcon-conference-info-diff+xml": MimeType = MimeType{ .category = .application, .value = "application/xcon-conference-info-diff+xml" };
+ pub const @"application/xenc+xml": MimeType = MimeType{ .category = .application, .value = "application/xenc+xml" };
+ pub const @"application/xhtml+xml": MimeType = MimeType{ .category = .application, .value = "application/xhtml+xml" };
+ pub const @"application/xhtml-voice+xml": MimeType = MimeType{ .category = .application, .value = "application/xhtml-voice+xml" };
+ pub const @"application/xliff+xml": MimeType = MimeType{ .category = .application, .value = "application/xliff+xml" };
+ pub const @"application/xml": MimeType = MimeType{ .category = .application, .value = "application/xml" };
+ pub const @"application/xml-dtd": MimeType = MimeType{ .category = .application, .value = "application/xml-dtd" };
+ pub const @"application/xml-external-parsed-entity": MimeType = MimeType{ .category = .application, .value = "application/xml-external-parsed-entity" };
+ pub const @"application/xml-patch+xml": MimeType = MimeType{ .category = .application, .value = "application/xml-patch+xml" };
+ pub const @"application/xmpp+xml": MimeType = MimeType{ .category = .application, .value = "application/xmpp+xml" };
+ pub const @"application/xop+xml": MimeType = MimeType{ .category = .application, .value = "application/xop+xml" };
+ pub const @"application/xproc+xml": MimeType = MimeType{ .category = .application, .value = "application/xproc+xml" };
+ pub const @"application/xslt+xml": MimeType = MimeType{ .category = .application, .value = "application/xslt+xml" };
+ pub const @"application/xspf+xml": MimeType = MimeType{ .category = .application, .value = "application/xspf+xml" };
+ pub const @"application/xv+xml": MimeType = MimeType{ .category = .application, .value = "application/xv+xml" };
+ pub const @"application/yang": MimeType = MimeType{ .category = .application, .value = "application/yang" };
+ pub const @"application/yang-data+json": MimeType = MimeType{ .category = .application, .value = "application/yang-data+json" };
+ pub const @"application/yang-data+xml": MimeType = MimeType{ .category = .application, .value = "application/yang-data+xml" };
+ pub const @"application/yang-patch+json": MimeType = MimeType{ .category = .application, .value = "application/yang-patch+json" };
+ pub const @"application/yang-patch+xml": MimeType = MimeType{ .category = .application, .value = "application/yang-patch+xml" };
+ pub const @"application/yin+xml": MimeType = MimeType{ .category = .application, .value = "application/yin+xml" };
+ pub const @"application/zip": MimeType = MimeType{ .category = .application, .value = "application/zip" };
+ pub const @"application/zlib": MimeType = MimeType{ .category = .application, .value = "application/zlib" };
+ pub const @"application/zstd": MimeType = MimeType{ .category = .application, .value = "application/zstd" };
+ pub const @"audio/1d-interleaved-parityfec": MimeType = MimeType{ .category = .audio, .value = "audio/1d-interleaved-parityfec" };
+ pub const @"audio/32kadpcm": MimeType = MimeType{ .category = .audio, .value = "audio/32kadpcm" };
+ pub const @"audio/3gpp": MimeType = MimeType{ .category = .audio, .value = "audio/3gpp" };
+ pub const @"audio/3gpp2": MimeType = MimeType{ .category = .audio, .value = "audio/3gpp2" };
+ pub const @"audio/aac": MimeType = MimeType{ .category = .audio, .value = "audio/aac" };
+ pub const @"audio/ac3": MimeType = MimeType{ .category = .audio, .value = "audio/ac3" };
+ pub const @"audio/adpcm": MimeType = MimeType{ .category = .audio, .value = "audio/adpcm" };
+ pub const @"audio/amr": MimeType = MimeType{ .category = .audio, .value = "audio/amr" };
+ pub const @"audio/amr-wb": MimeType = MimeType{ .category = .audio, .value = "audio/amr-wb" };
+ pub const @"audio/amr-wb+": MimeType = MimeType{ .category = .audio, .value = "audio/amr-wb+" };
+ pub const @"audio/aptx": MimeType = MimeType{ .category = .audio, .value = "audio/aptx" };
+ pub const @"audio/asc": MimeType = MimeType{ .category = .audio, .value = "audio/asc" };
+ pub const @"audio/atrac-advanced-lossless": MimeType = MimeType{ .category = .audio, .value = "audio/atrac-advanced-lossless" };
+ pub const @"audio/atrac-x": MimeType = MimeType{ .category = .audio, .value = "audio/atrac-x" };
+ pub const @"audio/atrac3": MimeType = MimeType{ .category = .audio, .value = "audio/atrac3" };
+ pub const @"audio/basic": MimeType = MimeType{ .category = .audio, .value = "audio/basic" };
+ pub const @"audio/bv16": MimeType = MimeType{ .category = .audio, .value = "audio/bv16" };
+ pub const @"audio/bv32": MimeType = MimeType{ .category = .audio, .value = "audio/bv32" };
+ pub const @"audio/clearmode": MimeType = MimeType{ .category = .audio, .value = "audio/clearmode" };
+ pub const @"audio/cn": MimeType = MimeType{ .category = .audio, .value = "audio/cn" };
+ pub const @"audio/dat12": MimeType = MimeType{ .category = .audio, .value = "audio/dat12" };
+ pub const @"audio/dls": MimeType = MimeType{ .category = .audio, .value = "audio/dls" };
+ pub const @"audio/dsr-es201108": MimeType = MimeType{ .category = .audio, .value = "audio/dsr-es201108" };
+ pub const @"audio/dsr-es202050": MimeType = MimeType{ .category = .audio, .value = "audio/dsr-es202050" };
+ pub const @"audio/dsr-es202211": MimeType = MimeType{ .category = .audio, .value = "audio/dsr-es202211" };
+ pub const @"audio/dsr-es202212": MimeType = MimeType{ .category = .audio, .value = "audio/dsr-es202212" };
+ pub const @"audio/dv": MimeType = MimeType{ .category = .audio, .value = "audio/dv" };
+ pub const @"audio/dvi4": MimeType = MimeType{ .category = .audio, .value = "audio/dvi4" };
+ pub const @"audio/eac3": MimeType = MimeType{ .category = .audio, .value = "audio/eac3" };
+ pub const @"audio/encaprtp": MimeType = MimeType{ .category = .audio, .value = "audio/encaprtp" };
+ pub const @"audio/evrc": MimeType = MimeType{ .category = .audio, .value = "audio/evrc" };
+ pub const @"audio/evrc-qcp": MimeType = MimeType{ .category = .audio, .value = "audio/evrc-qcp" };
+ pub const @"audio/evrc0": MimeType = MimeType{ .category = .audio, .value = "audio/evrc0" };
+ pub const @"audio/evrc1": MimeType = MimeType{ .category = .audio, .value = "audio/evrc1" };
+ pub const @"audio/evrcb": MimeType = MimeType{ .category = .audio, .value = "audio/evrcb" };
+ pub const @"audio/evrcb0": MimeType = MimeType{ .category = .audio, .value = "audio/evrcb0" };
+ pub const @"audio/evrcb1": MimeType = MimeType{ .category = .audio, .value = "audio/evrcb1" };
+ pub const @"audio/evrcnw": MimeType = MimeType{ .category = .audio, .value = "audio/evrcnw" };
+ pub const @"audio/evrcnw0": MimeType = MimeType{ .category = .audio, .value = "audio/evrcnw0" };
+ pub const @"audio/evrcnw1": MimeType = MimeType{ .category = .audio, .value = "audio/evrcnw1" };
+ pub const @"audio/evrcwb": MimeType = MimeType{ .category = .audio, .value = "audio/evrcwb" };
+ pub const @"audio/evrcwb0": MimeType = MimeType{ .category = .audio, .value = "audio/evrcwb0" };
+ pub const @"audio/evrcwb1": MimeType = MimeType{ .category = .audio, .value = "audio/evrcwb1" };
+ pub const @"audio/evs": MimeType = MimeType{ .category = .audio, .value = "audio/evs" };
+ pub const @"audio/flexfec": MimeType = MimeType{ .category = .audio, .value = "audio/flexfec" };
+ pub const @"audio/fwdred": MimeType = MimeType{ .category = .audio, .value = "audio/fwdred" };
+ pub const @"audio/g711-0": MimeType = MimeType{ .category = .audio, .value = "audio/g711-0" };
+ pub const @"audio/g719": MimeType = MimeType{ .category = .audio, .value = "audio/g719" };
+ pub const @"audio/g722": MimeType = MimeType{ .category = .audio, .value = "audio/g722" };
+ pub const @"audio/g7221": MimeType = MimeType{ .category = .audio, .value = "audio/g7221" };
+ pub const @"audio/g723": MimeType = MimeType{ .category = .audio, .value = "audio/g723" };
+ pub const @"audio/g726-16": MimeType = MimeType{ .category = .audio, .value = "audio/g726-16" };
+ pub const @"audio/g726-24": MimeType = MimeType{ .category = .audio, .value = "audio/g726-24" };
+ pub const @"audio/g726-32": MimeType = MimeType{ .category = .audio, .value = "audio/g726-32" };
+ pub const @"audio/g726-40": MimeType = MimeType{ .category = .audio, .value = "audio/g726-40" };
+ pub const @"audio/g728": MimeType = MimeType{ .category = .audio, .value = "audio/g728" };
+ pub const @"audio/g729": MimeType = MimeType{ .category = .audio, .value = "audio/g729" };
+ pub const @"audio/g7291": MimeType = MimeType{ .category = .audio, .value = "audio/g7291" };
+ pub const @"audio/g729d": MimeType = MimeType{ .category = .audio, .value = "audio/g729d" };
+ pub const @"audio/g729e": MimeType = MimeType{ .category = .audio, .value = "audio/g729e" };
+ pub const @"audio/gsm": MimeType = MimeType{ .category = .audio, .value = "audio/gsm" };
+ pub const @"audio/gsm-efr": MimeType = MimeType{ .category = .audio, .value = "audio/gsm-efr" };
+ pub const @"audio/gsm-hr-08": MimeType = MimeType{ .category = .audio, .value = "audio/gsm-hr-08" };
+ pub const @"audio/ilbc": MimeType = MimeType{ .category = .audio, .value = "audio/ilbc" };
+ pub const @"audio/ip-mr_v2.5": MimeType = MimeType{ .category = .audio, .value = "audio/ip-mr_v2.5" };
+ pub const @"audio/isac": MimeType = MimeType{ .category = .audio, .value = "audio/isac" };
+ pub const @"audio/l16": MimeType = MimeType{ .category = .audio, .value = "audio/l16" };
+ pub const @"audio/l20": MimeType = MimeType{ .category = .audio, .value = "audio/l20" };
+ pub const @"audio/l24": MimeType = MimeType{ .category = .audio, .value = "audio/l24" };
+ pub const @"audio/l8": MimeType = MimeType{ .category = .audio, .value = "audio/l8" };
+ pub const @"audio/lpc": MimeType = MimeType{ .category = .audio, .value = "audio/lpc" };
+ pub const @"audio/melp": MimeType = MimeType{ .category = .audio, .value = "audio/melp" };
+ pub const @"audio/melp1200": MimeType = MimeType{ .category = .audio, .value = "audio/melp1200" };
+ pub const @"audio/melp2400": MimeType = MimeType{ .category = .audio, .value = "audio/melp2400" };
+ pub const @"audio/melp600": MimeType = MimeType{ .category = .audio, .value = "audio/melp600" };
+ pub const @"audio/mhas": MimeType = MimeType{ .category = .audio, .value = "audio/mhas" };
+ pub const @"audio/midi": MimeType = MimeType{ .category = .audio, .value = "audio/midi" };
+ pub const @"audio/mobile-xmf": MimeType = MimeType{ .category = .audio, .value = "audio/mobile-xmf" };
+ pub const @"audio/mp3": MimeType = MimeType{ .category = .audio, .value = "audio/mp3" };
+ pub const @"audio/mp4": MimeType = MimeType{ .category = .audio, .value = "audio/mp4" };
+ pub const @"audio/mp4a-latm": MimeType = MimeType{ .category = .audio, .value = "audio/mp4a-latm" };
+ pub const @"audio/mpa": MimeType = MimeType{ .category = .audio, .value = "audio/mpa" };
+ pub const @"audio/mpa-robust": MimeType = MimeType{ .category = .audio, .value = "audio/mpa-robust" };
+ pub const @"audio/mpeg": MimeType = MimeType{ .category = .audio, .value = "audio/mpeg" };
+ pub const @"audio/mpeg4-generic": MimeType = MimeType{ .category = .audio, .value = "audio/mpeg4-generic" };
+ pub const @"audio/musepack": MimeType = MimeType{ .category = .audio, .value = "audio/musepack" };
+ pub const @"audio/ogg": MimeType = MimeType{ .category = .audio, .value = "audio/ogg" };
+ pub const @"audio/opus": MimeType = MimeType{ .category = .audio, .value = "audio/opus" };
+ pub const @"audio/parityfec": MimeType = MimeType{ .category = .audio, .value = "audio/parityfec" };
+ pub const @"audio/pcma": MimeType = MimeType{ .category = .audio, .value = "audio/pcma" };
+ pub const @"audio/pcma-wb": MimeType = MimeType{ .category = .audio, .value = "audio/pcma-wb" };
+ pub const @"audio/pcmu": MimeType = MimeType{ .category = .audio, .value = "audio/pcmu" };
+ pub const @"audio/pcmu-wb": MimeType = MimeType{ .category = .audio, .value = "audio/pcmu-wb" };
+ pub const @"audio/prs.sid": MimeType = MimeType{ .category = .audio, .value = "audio/prs.sid" };
+ pub const @"audio/qcelp": MimeType = MimeType{ .category = .audio, .value = "audio/qcelp" };
+ pub const @"audio/raptorfec": MimeType = MimeType{ .category = .audio, .value = "audio/raptorfec" };
+ pub const @"audio/red": MimeType = MimeType{ .category = .audio, .value = "audio/red" };
+ pub const @"audio/rtp-enc-aescm128": MimeType = MimeType{ .category = .audio, .value = "audio/rtp-enc-aescm128" };
+ pub const @"audio/rtp-midi": MimeType = MimeType{ .category = .audio, .value = "audio/rtp-midi" };
+ pub const @"audio/rtploopback": MimeType = MimeType{ .category = .audio, .value = "audio/rtploopback" };
+ pub const @"audio/rtx": MimeType = MimeType{ .category = .audio, .value = "audio/rtx" };
+ pub const @"audio/s3m": MimeType = MimeType{ .category = .audio, .value = "audio/s3m" };
+ pub const @"audio/scip": MimeType = MimeType{ .category = .audio, .value = "audio/scip" };
+ pub const @"audio/silk": MimeType = MimeType{ .category = .audio, .value = "audio/silk" };
+ pub const @"audio/smv": MimeType = MimeType{ .category = .audio, .value = "audio/smv" };
+ pub const @"audio/smv-qcp": MimeType = MimeType{ .category = .audio, .value = "audio/smv-qcp" };
+ pub const @"audio/smv0": MimeType = MimeType{ .category = .audio, .value = "audio/smv0" };
+ pub const @"audio/sofa": MimeType = MimeType{ .category = .audio, .value = "audio/sofa" };
+ pub const @"audio/sp-midi": MimeType = MimeType{ .category = .audio, .value = "audio/sp-midi" };
+ pub const @"audio/speex": MimeType = MimeType{ .category = .audio, .value = "audio/speex" };
+ pub const @"audio/t140c": MimeType = MimeType{ .category = .audio, .value = "audio/t140c" };
+ pub const @"audio/t38": MimeType = MimeType{ .category = .audio, .value = "audio/t38" };
+ pub const @"audio/telephone-event": MimeType = MimeType{ .category = .audio, .value = "audio/telephone-event" };
+ pub const @"audio/tetra_acelp": MimeType = MimeType{ .category = .audio, .value = "audio/tetra_acelp" };
+ pub const @"audio/tetra_acelp_bb": MimeType = MimeType{ .category = .audio, .value = "audio/tetra_acelp_bb" };
+ pub const @"audio/tone": MimeType = MimeType{ .category = .audio, .value = "audio/tone" };
+ pub const @"audio/tsvcis": MimeType = MimeType{ .category = .audio, .value = "audio/tsvcis" };
+ pub const @"audio/uemclip": MimeType = MimeType{ .category = .audio, .value = "audio/uemclip" };
+ pub const @"audio/ulpfec": MimeType = MimeType{ .category = .audio, .value = "audio/ulpfec" };
+ pub const @"audio/usac": MimeType = MimeType{ .category = .audio, .value = "audio/usac" };
+ pub const @"audio/vdvi": MimeType = MimeType{ .category = .audio, .value = "audio/vdvi" };
+ pub const @"audio/vmr-wb": MimeType = MimeType{ .category = .audio, .value = "audio/vmr-wb" };
+ pub const @"audio/vnd.3gpp.iufp": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.3gpp.iufp" };
+ pub const @"audio/vnd.4sb": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.4sb" };
+ pub const @"audio/vnd.audiokoz": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.audiokoz" };
+ pub const @"audio/vnd.celp": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.celp" };
+ pub const @"audio/vnd.cisco.nse": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.cisco.nse" };
+ pub const @"audio/vnd.cmles.radio-events": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.cmles.radio-events" };
+ pub const @"audio/vnd.cns.anp1": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.cns.anp1" };
+ pub const @"audio/vnd.cns.inf1": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.cns.inf1" };
+ pub const @"audio/vnd.dece.audio": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dece.audio" };
+ pub const @"audio/vnd.digital-winds": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.digital-winds" };
+ pub const @"audio/vnd.dlna.adts": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dlna.adts" };
+ pub const @"audio/vnd.dolby.heaac.1": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.heaac.1" };
+ pub const @"audio/vnd.dolby.heaac.2": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.heaac.2" };
+ pub const @"audio/vnd.dolby.mlp": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.mlp" };
+ pub const @"audio/vnd.dolby.mps": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.mps" };
+ pub const @"audio/vnd.dolby.pl2": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.pl2" };
+ pub const @"audio/vnd.dolby.pl2x": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.pl2x" };
+ pub const @"audio/vnd.dolby.pl2z": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.pl2z" };
+ pub const @"audio/vnd.dolby.pulse.1": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dolby.pulse.1" };
+ pub const @"audio/vnd.dra": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dra" };
+ pub const @"audio/vnd.dts": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dts" };
+ pub const @"audio/vnd.dts.hd": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dts.hd" };
+ pub const @"audio/vnd.dts.uhd": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dts.uhd" };
+ pub const @"audio/vnd.dvb.file": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.dvb.file" };
+ pub const @"audio/vnd.everad.plj": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.everad.plj" };
+ pub const @"audio/vnd.hns.audio": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.hns.audio" };
+ pub const @"audio/vnd.lucent.voice": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.lucent.voice" };
+ pub const @"audio/vnd.ms-playready.media.pya": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.ms-playready.media.pya" };
+ pub const @"audio/vnd.nokia.mobile-xmf": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.nokia.mobile-xmf" };
+ pub const @"audio/vnd.nortel.vbk": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.nortel.vbk" };
+ pub const @"audio/vnd.nuera.ecelp4800": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.nuera.ecelp4800" };
+ pub const @"audio/vnd.nuera.ecelp7470": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.nuera.ecelp7470" };
+ pub const @"audio/vnd.nuera.ecelp9600": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.nuera.ecelp9600" };
+ pub const @"audio/vnd.octel.sbc": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.octel.sbc" };
+ pub const @"audio/vnd.presonus.multitrack": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.presonus.multitrack" };
+ pub const @"audio/vnd.qcelp": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.qcelp" };
+ pub const @"audio/vnd.rhetorex.32kadpcm": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.rhetorex.32kadpcm" };
+ pub const @"audio/vnd.rip": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.rip" };
+ pub const @"audio/vnd.rn-realaudio": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.rn-realaudio" };
+ pub const @"audio/vnd.sealedmedia.softseal.mpeg": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.sealedmedia.softseal.mpeg" };
+ pub const @"audio/vnd.vmx.cvsd": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.vmx.cvsd" };
+ pub const @"audio/vnd.wave": MimeType = MimeType{ .category = .audio, .value = "audio/vnd.wave" };
+ pub const @"audio/vorbis": MimeType = MimeType{ .category = .audio, .value = "audio/vorbis" };
+ pub const @"audio/vorbis-config": MimeType = MimeType{ .category = .audio, .value = "audio/vorbis-config" };
+ pub const @"audio/wav": MimeType = MimeType{ .category = .audio, .value = "audio/wav" };
+ pub const @"audio/wave": MimeType = MimeType{ .category = .audio, .value = "audio/wave" };
+ pub const @"audio/webm": MimeType = MimeType{ .category = .audio, .value = "audio/webm" };
+ pub const @"audio/x-aac": MimeType = MimeType{ .category = .audio, .value = "audio/x-aac" };
+ pub const @"audio/x-aiff": MimeType = MimeType{ .category = .audio, .value = "audio/x-aiff" };
+ pub const @"audio/x-caf": MimeType = MimeType{ .category = .audio, .value = "audio/x-caf" };
+ pub const @"audio/x-flac": MimeType = MimeType{ .category = .audio, .value = "audio/x-flac" };
+ pub const @"audio/x-m4a": MimeType = MimeType{ .category = .audio, .value = "audio/x-m4a" };
+ pub const @"audio/x-matroska": MimeType = MimeType{ .category = .audio, .value = "audio/x-matroska" };
+ pub const @"audio/x-mpegurl": MimeType = MimeType{ .category = .audio, .value = "audio/x-mpegurl" };
+ pub const @"audio/x-ms-wax": MimeType = MimeType{ .category = .audio, .value = "audio/x-ms-wax" };
+ pub const @"audio/x-ms-wma": MimeType = MimeType{ .category = .audio, .value = "audio/x-ms-wma" };
+ pub const @"audio/x-pn-realaudio": MimeType = MimeType{ .category = .audio, .value = "audio/x-pn-realaudio" };
+ pub const @"audio/x-pn-realaudio-plugin": MimeType = MimeType{ .category = .audio, .value = "audio/x-pn-realaudio-plugin" };
+ pub const @"audio/x-realaudio": MimeType = MimeType{ .category = .audio, .value = "audio/x-realaudio" };
+ pub const @"audio/x-tta": MimeType = MimeType{ .category = .audio, .value = "audio/x-tta" };
+ pub const @"audio/x-wav": MimeType = MimeType{ .category = .audio, .value = "audio/x-wav" };
+ pub const @"audio/xm": MimeType = MimeType{ .category = .audio, .value = "audio/xm" };
+ pub const @"chemical/x-cdx": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-cdx" };
+ pub const @"chemical/x-cif": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-cif" };
+ pub const @"chemical/x-cmdf": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-cmdf" };
+ pub const @"chemical/x-cml": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-cml" };
+ pub const @"chemical/x-csml": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-csml" };
+ pub const @"chemical/x-pdb": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-pdb" };
+ pub const @"chemical/x-xyz": MimeType = MimeType{ .category = .chemical, .value = "chemical/x-xyz" };
+ pub const @"font/collection": MimeType = MimeType{ .category = .font, .value = "font/collection" };
+ pub const @"font/otf": MimeType = MimeType{ .category = .font, .value = "font/otf" };
+ pub const @"font/sfnt": MimeType = MimeType{ .category = .font, .value = "font/sfnt" };
+ pub const @"font/ttf": MimeType = MimeType{ .category = .font, .value = "font/ttf" };
+ pub const @"font/woff": MimeType = MimeType{ .category = .font, .value = "font/woff" };
+ pub const @"font/woff2": MimeType = MimeType{ .category = .font, .value = "font/woff2" };
+ pub const @"image/aces": MimeType = MimeType{ .category = .image, .value = "image/aces" };
+ pub const @"image/apng": MimeType = MimeType{ .category = .image, .value = "image/apng" };
+ pub const @"image/avci": MimeType = MimeType{ .category = .image, .value = "image/avci" };
+ pub const @"image/avcs": MimeType = MimeType{ .category = .image, .value = "image/avcs" };
+ pub const @"image/avif": MimeType = MimeType{ .category = .image, .value = "image/avif" };
+ pub const @"image/bmp": MimeType = MimeType{ .category = .image, .value = "image/bmp" };
+ pub const @"image/cgm": MimeType = MimeType{ .category = .image, .value = "image/cgm" };
+ pub const @"image/dicom-rle": MimeType = MimeType{ .category = .image, .value = "image/dicom-rle" };
+ pub const @"image/emf": MimeType = MimeType{ .category = .image, .value = "image/emf" };
+ pub const @"image/fits": MimeType = MimeType{ .category = .image, .value = "image/fits" };
+ pub const @"image/g3fax": MimeType = MimeType{ .category = .image, .value = "image/g3fax" };
+ pub const @"image/gif": MimeType = MimeType{ .category = .image, .value = "image/gif" };
+ pub const @"image/heic": MimeType = MimeType{ .category = .image, .value = "image/heic" };
+ pub const @"image/heic-sequence": MimeType = MimeType{ .category = .image, .value = "image/heic-sequence" };
+ pub const @"image/heif": MimeType = MimeType{ .category = .image, .value = "image/heif" };
+ pub const @"image/heif-sequence": MimeType = MimeType{ .category = .image, .value = "image/heif-sequence" };
+ pub const @"image/hej2k": MimeType = MimeType{ .category = .image, .value = "image/hej2k" };
+ pub const @"image/hsj2": MimeType = MimeType{ .category = .image, .value = "image/hsj2" };
+ pub const @"image/ief": MimeType = MimeType{ .category = .image, .value = "image/ief" };
+ pub const @"image/jls": MimeType = MimeType{ .category = .image, .value = "image/jls" };
+ pub const @"image/jp2": MimeType = MimeType{ .category = .image, .value = "image/jp2" };
+ pub const @"image/jpeg": MimeType = MimeType{ .category = .image, .value = "image/jpeg" };
+ pub const @"image/jph": MimeType = MimeType{ .category = .image, .value = "image/jph" };
+ pub const @"image/jphc": MimeType = MimeType{ .category = .image, .value = "image/jphc" };
+ pub const @"image/jpm": MimeType = MimeType{ .category = .image, .value = "image/jpm" };
+ pub const @"image/jpx": MimeType = MimeType{ .category = .image, .value = "image/jpx" };
+ pub const @"image/jxr": MimeType = MimeType{ .category = .image, .value = "image/jxr" };
+ pub const @"image/jxra": MimeType = MimeType{ .category = .image, .value = "image/jxra" };
+ pub const @"image/jxrs": MimeType = MimeType{ .category = .image, .value = "image/jxrs" };
+ pub const @"image/jxs": MimeType = MimeType{ .category = .image, .value = "image/jxs" };
+ pub const @"image/jxsc": MimeType = MimeType{ .category = .image, .value = "image/jxsc" };
+ pub const @"image/jxsi": MimeType = MimeType{ .category = .image, .value = "image/jxsi" };
+ pub const @"image/jxss": MimeType = MimeType{ .category = .image, .value = "image/jxss" };
+ pub const @"image/ktx": MimeType = MimeType{ .category = .image, .value = "image/ktx" };
+ pub const @"image/ktx2": MimeType = MimeType{ .category = .image, .value = "image/ktx2" };
+ pub const @"image/naplps": MimeType = MimeType{ .category = .image, .value = "image/naplps" };
+ pub const @"image/pjpeg": MimeType = MimeType{ .category = .image, .value = "image/pjpeg" };
+ pub const @"image/png": MimeType = MimeType{ .category = .image, .value = "image/png" };
+ pub const @"image/prs.btif": MimeType = MimeType{ .category = .image, .value = "image/prs.btif" };
+ pub const @"image/prs.pti": MimeType = MimeType{ .category = .image, .value = "image/prs.pti" };
+ pub const @"image/pwg-raster": MimeType = MimeType{ .category = .image, .value = "image/pwg-raster" };
+ pub const @"image/sgi": MimeType = MimeType{ .category = .image, .value = "image/sgi" };
+ pub const @"image/svg+xml": MimeType = MimeType{ .category = .image, .value = "image/svg+xml" };
+ pub const @"image/t38": MimeType = MimeType{ .category = .image, .value = "image/t38" };
+ pub const @"image/tiff": MimeType = MimeType{ .category = .image, .value = "image/tiff" };
+ pub const @"image/tiff-fx": MimeType = MimeType{ .category = .image, .value = "image/tiff-fx" };
+ pub const @"image/vnd.adobe.photoshop": MimeType = MimeType{ .category = .image, .value = "image/vnd.adobe.photoshop" };
+ pub const @"image/vnd.airzip.accelerator.azv": MimeType = MimeType{ .category = .image, .value = "image/vnd.airzip.accelerator.azv" };
+ pub const @"image/vnd.cns.inf2": MimeType = MimeType{ .category = .image, .value = "image/vnd.cns.inf2" };
+ pub const @"image/vnd.dece.graphic": MimeType = MimeType{ .category = .image, .value = "image/vnd.dece.graphic" };
+ pub const @"image/vnd.djvu": MimeType = MimeType{ .category = .image, .value = "image/vnd.djvu" };
+ pub const @"image/vnd.dvb.subtitle": MimeType = MimeType{ .category = .image, .value = "image/vnd.dvb.subtitle" };
+ pub const @"image/vnd.dwg": MimeType = MimeType{ .category = .image, .value = "image/vnd.dwg" };
+ pub const @"image/vnd.dxf": MimeType = MimeType{ .category = .image, .value = "image/vnd.dxf" };
+ pub const @"image/vnd.fastbidsheet": MimeType = MimeType{ .category = .image, .value = "image/vnd.fastbidsheet" };
+ pub const @"image/vnd.fpx": MimeType = MimeType{ .category = .image, .value = "image/vnd.fpx" };
+ pub const @"image/vnd.fst": MimeType = MimeType{ .category = .image, .value = "image/vnd.fst" };
+ pub const @"image/vnd.fujixerox.edmics-mmr": MimeType = MimeType{ .category = .image, .value = "image/vnd.fujixerox.edmics-mmr" };
+ pub const @"image/vnd.fujixerox.edmics-rlc": MimeType = MimeType{ .category = .image, .value = "image/vnd.fujixerox.edmics-rlc" };
+ pub const @"image/vnd.globalgraphics.pgb": MimeType = MimeType{ .category = .image, .value = "image/vnd.globalgraphics.pgb" };
pub const @"image/vnd.microsoft.icon" = ico;
- pub const @"image/vnd.mix": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.mix" };
- pub const @"image/vnd.mozilla.apng": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.mozilla.apng" };
- pub const @"image/vnd.ms-dds": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.ms-dds" };
- pub const @"image/vnd.ms-modi": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.ms-modi" };
- pub const @"image/vnd.ms-photo": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.ms-photo" };
- pub const @"image/vnd.net-fpx": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.net-fpx" };
- pub const @"image/vnd.pco.b16": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.pco.b16" };
- pub const @"image/vnd.radiance": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.radiance" };
- pub const @"image/vnd.sealed.png": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.sealed.png" };
- pub const @"image/vnd.sealedmedia.softseal.gif": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.sealedmedia.softseal.gif" };
- pub const @"image/vnd.sealedmedia.softseal.jpg": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.sealedmedia.softseal.jpg" };
- pub const @"image/vnd.svf": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.svf" };
- pub const @"image/vnd.tencent.tap": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.tencent.tap" };
- pub const @"image/vnd.valve.source.texture": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.valve.source.texture" };
- pub const @"image/vnd.wap.wbmp": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.wap.wbmp" };
- pub const @"image/vnd.xiff": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.xiff" };
- pub const @"image/vnd.zbrush.pcx": MimeType = MimeType{ .category = .@"image", .value = "image/vnd.zbrush.pcx" };
- pub const @"image/webp": MimeType = MimeType{ .category = .@"image", .value = "image/webp" };
- pub const @"image/wmf": MimeType = MimeType{ .category = .@"image", .value = "image/wmf" };
- pub const @"image/x-3ds": MimeType = MimeType{ .category = .@"image", .value = "image/x-3ds" };
- pub const @"image/x-cmu-raster": MimeType = MimeType{ .category = .@"image", .value = "image/x-cmu-raster" };
- pub const @"image/x-cmx": MimeType = MimeType{ .category = .@"image", .value = "image/x-cmx" };
- pub const @"image/x-freehand": MimeType = MimeType{ .category = .@"image", .value = "image/x-freehand" };
- pub const @"image/x-icon": MimeType = MimeType{ .category = .@"image", .value = "image/x-icon" };
- pub const @"image/x-jng": MimeType = MimeType{ .category = .@"image", .value = "image/x-jng" };
- pub const @"image/x-mrsid-image": MimeType = MimeType{ .category = .@"image", .value = "image/x-mrsid-image" };
- pub const @"image/x-ms-bmp": MimeType = MimeType{ .category = .@"image", .value = "image/x-ms-bmp" };
- pub const @"image/x-pcx": MimeType = MimeType{ .category = .@"image", .value = "image/x-pcx" };
- pub const @"image/x-pict": MimeType = MimeType{ .category = .@"image", .value = "image/x-pict" };
- pub const @"image/x-portable-anymap": MimeType = MimeType{ .category = .@"image", .value = "image/x-portable-anymap" };
- pub const @"image/x-portable-bitmap": MimeType = MimeType{ .category = .@"image", .value = "image/x-portable-bitmap" };
- pub const @"image/x-portable-graymap": MimeType = MimeType{ .category = .@"image", .value = "image/x-portable-graymap" };
- pub const @"image/x-portable-pixmap": MimeType = MimeType{ .category = .@"image", .value = "image/x-portable-pixmap" };
- pub const @"image/x-rgb": MimeType = MimeType{ .category = .@"image", .value = "image/x-rgb" };
- pub const @"image/x-tga": MimeType = MimeType{ .category = .@"image", .value = "image/x-tga" };
- pub const @"image/x-xbitmap": MimeType = MimeType{ .category = .@"image", .value = "image/x-xbitmap" };
- pub const @"image/x-xcf": MimeType = MimeType{ .category = .@"image", .value = "image/x-xcf" };
- pub const @"image/x-xpixmap": MimeType = MimeType{ .category = .@"image", .value = "image/x-xpixmap" };
- pub const @"image/x-xwindowdump": MimeType = MimeType{ .category = .@"image", .value = "image/x-xwindowdump" };
- pub const @"message/cpim": MimeType = MimeType{ .category = .@"message", .value = "message/cpim" };
- pub const @"message/delivery-status": MimeType = MimeType{ .category = .@"message", .value = "message/delivery-status" };
- pub const @"message/disposition-notification": MimeType = MimeType{ .category = .@"message", .value = "message/disposition-notification" };
- pub const @"message/external-body": MimeType = MimeType{ .category = .@"message", .value = "message/external-body" };
- pub const @"message/feedback-report": MimeType = MimeType{ .category = .@"message", .value = "message/feedback-report" };
- pub const @"message/global": MimeType = MimeType{ .category = .@"message", .value = "message/global" };
- pub const @"message/global-delivery-status": MimeType = MimeType{ .category = .@"message", .value = "message/global-delivery-status" };
- pub const @"message/global-disposition-notification": MimeType = MimeType{ .category = .@"message", .value = "message/global-disposition-notification" };
- pub const @"message/global-headers": MimeType = MimeType{ .category = .@"message", .value = "message/global-headers" };
- pub const @"message/http": MimeType = MimeType{ .category = .@"message", .value = "message/http" };
- pub const @"message/imdn+xml": MimeType = MimeType{ .category = .@"message", .value = "message/imdn+xml" };
- pub const @"message/news": MimeType = MimeType{ .category = .@"message", .value = "message/news" };
- pub const @"message/partial": MimeType = MimeType{ .category = .@"message", .value = "message/partial" };
- pub const @"message/rfc822": MimeType = MimeType{ .category = .@"message", .value = "message/rfc822" };
- pub const @"message/s-http": MimeType = MimeType{ .category = .@"message", .value = "message/s-http" };
- pub const @"message/sip": MimeType = MimeType{ .category = .@"message", .value = "message/sip" };
- pub const @"message/sipfrag": MimeType = MimeType{ .category = .@"message", .value = "message/sipfrag" };
- pub const @"message/tracking-status": MimeType = MimeType{ .category = .@"message", .value = "message/tracking-status" };
- pub const @"message/vnd.si.simp": MimeType = MimeType{ .category = .@"message", .value = "message/vnd.si.simp" };
- pub const @"message/vnd.wfa.wsc": MimeType = MimeType{ .category = .@"message", .value = "message/vnd.wfa.wsc" };
- pub const @"model/3mf": MimeType = MimeType{ .category = .@"model", .value = "model/3mf" };
- pub const @"model/e57": MimeType = MimeType{ .category = .@"model", .value = "model/e57" };
- pub const @"model/gltf+json": MimeType = MimeType{ .category = .@"model", .value = "model/gltf+json" };
- pub const @"model/gltf-binary": MimeType = MimeType{ .category = .@"model", .value = "model/gltf-binary" };
- pub const @"model/iges": MimeType = MimeType{ .category = .@"model", .value = "model/iges" };
- pub const @"model/mesh": MimeType = MimeType{ .category = .@"model", .value = "model/mesh" };
- pub const @"model/mtl": MimeType = MimeType{ .category = .@"model", .value = "model/mtl" };
- pub const @"model/obj": MimeType = MimeType{ .category = .@"model", .value = "model/obj" };
- pub const @"model/prc": MimeType = MimeType{ .category = .@"model", .value = "model/prc" };
- pub const @"model/step": MimeType = MimeType{ .category = .@"model", .value = "model/step" };
- pub const @"model/step+xml": MimeType = MimeType{ .category = .@"model", .value = "model/step+xml" };
- pub const @"model/step+zip": MimeType = MimeType{ .category = .@"model", .value = "model/step+zip" };
- pub const @"model/step-xml+zip": MimeType = MimeType{ .category = .@"model", .value = "model/step-xml+zip" };
- pub const @"model/stl": MimeType = MimeType{ .category = .@"model", .value = "model/stl" };
- pub const @"model/u3d": MimeType = MimeType{ .category = .@"model", .value = "model/u3d" };
- pub const @"model/vnd.collada+xml": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.collada+xml" };
- pub const @"model/vnd.dwf": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.dwf" };
- pub const @"model/vnd.flatland.3dml": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.flatland.3dml" };
- pub const @"model/vnd.gdl": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.gdl" };
- pub const @"model/vnd.gs-gdl": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.gs-gdl" };
- pub const @"model/vnd.gs.gdl": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.gs.gdl" };
- pub const @"model/vnd.gtw": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.gtw" };
- pub const @"model/vnd.moml+xml": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.moml+xml" };
- pub const @"model/vnd.mts": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.mts" };
- pub const @"model/vnd.opengex": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.opengex" };
- pub const @"model/vnd.parasolid.transmit.binary": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.parasolid.transmit.binary" };
- pub const @"model/vnd.parasolid.transmit.text": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.parasolid.transmit.text" };
- pub const @"model/vnd.pytha.pyox": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.pytha.pyox" };
- pub const @"model/vnd.rosette.annotated-data-model": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.rosette.annotated-data-model" };
- pub const @"model/vnd.sap.vds": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.sap.vds" };
- pub const @"model/vnd.usdz+zip": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.usdz+zip" };
- pub const @"model/vnd.valve.source.compiled-map": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.valve.source.compiled-map" };
- pub const @"model/vnd.vtu": MimeType = MimeType{ .category = .@"model", .value = "model/vnd.vtu" };
- pub const @"model/vrml": MimeType = MimeType{ .category = .@"model", .value = "model/vrml" };
- pub const @"model/x3d+binary": MimeType = MimeType{ .category = .@"model", .value = "model/x3d+binary" };
- pub const @"model/x3d+fastinfoset": MimeType = MimeType{ .category = .@"model", .value = "model/x3d+fastinfoset" };
- pub const @"model/x3d+vrml": MimeType = MimeType{ .category = .@"model", .value = "model/x3d+vrml" };
- pub const @"model/x3d+xml": MimeType = MimeType{ .category = .@"model", .value = "model/x3d+xml" };
- pub const @"model/x3d-vrml": MimeType = MimeType{ .category = .@"model", .value = "model/x3d-vrml" };
- pub const @"multipart/alternative": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/alternative" };
- pub const @"multipart/appledouble": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/appledouble" };
- pub const @"multipart/byteranges": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/byteranges" };
- pub const @"multipart/digest": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/digest" };
- pub const @"multipart/encrypted": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/encrypted" };
- pub const @"multipart/form-data": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/form-data" };
- pub const @"multipart/header-set": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/header-set" };
- pub const @"multipart/mixed": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/mixed" };
- pub const @"multipart/multilingual": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/multilingual" };
- pub const @"multipart/parallel": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/parallel" };
- pub const @"multipart/related": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/related" };
- pub const @"multipart/report": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/report" };
- pub const @"multipart/signed": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/signed" };
- pub const @"multipart/vnd.bint.med-plus": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/vnd.bint.med-plus" };
- pub const @"multipart/voice-message": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/voice-message" };
- pub const @"multipart/x-mixed-replace": MimeType = MimeType{ .category = .@"multipart", .value = "multipart/x-mixed-replace" };
- pub const @"text/1d-interleaved-parityfec": MimeType = MimeType{ .category = .@"text", .value = "text/1d-interleaved-parityfec" };
- pub const @"text/cache-manifest": MimeType = MimeType{ .category = .@"text", .value = "text/cache-manifest" };
- pub const @"text/calendar": MimeType = MimeType{ .category = .@"text", .value = "text/calendar" };
- pub const @"text/calender": MimeType = MimeType{ .category = .@"text", .value = "text/calender" };
- pub const @"text/cmd": MimeType = MimeType{ .category = .@"text", .value = "text/cmd" };
- pub const @"text/coffeescript": MimeType = MimeType{ .category = .@"text", .value = "text/coffeescript" };
- pub const @"text/cql": MimeType = MimeType{ .category = .@"text", .value = "text/cql" };
- pub const @"text/cql-expression": MimeType = MimeType{ .category = .@"text", .value = "text/cql-expression" };
- pub const @"text/cql-identifier": MimeType = MimeType{ .category = .@"text", .value = "text/cql-identifier" };
+ pub const @"image/vnd.mix": MimeType = MimeType{ .category = .image, .value = "image/vnd.mix" };
+ pub const @"image/vnd.mozilla.apng": MimeType = MimeType{ .category = .image, .value = "image/vnd.mozilla.apng" };
+ pub const @"image/vnd.ms-dds": MimeType = MimeType{ .category = .image, .value = "image/vnd.ms-dds" };
+ pub const @"image/vnd.ms-modi": MimeType = MimeType{ .category = .image, .value = "image/vnd.ms-modi" };
+ pub const @"image/vnd.ms-photo": MimeType = MimeType{ .category = .image, .value = "image/vnd.ms-photo" };
+ pub const @"image/vnd.net-fpx": MimeType = MimeType{ .category = .image, .value = "image/vnd.net-fpx" };
+ pub const @"image/vnd.pco.b16": MimeType = MimeType{ .category = .image, .value = "image/vnd.pco.b16" };
+ pub const @"image/vnd.radiance": MimeType = MimeType{ .category = .image, .value = "image/vnd.radiance" };
+ pub const @"image/vnd.sealed.png": MimeType = MimeType{ .category = .image, .value = "image/vnd.sealed.png" };
+ pub const @"image/vnd.sealedmedia.softseal.gif": MimeType = MimeType{ .category = .image, .value = "image/vnd.sealedmedia.softseal.gif" };
+ pub const @"image/vnd.sealedmedia.softseal.jpg": MimeType = MimeType{ .category = .image, .value = "image/vnd.sealedmedia.softseal.jpg" };
+ pub const @"image/vnd.svf": MimeType = MimeType{ .category = .image, .value = "image/vnd.svf" };
+ pub const @"image/vnd.tencent.tap": MimeType = MimeType{ .category = .image, .value = "image/vnd.tencent.tap" };
+ pub const @"image/vnd.valve.source.texture": MimeType = MimeType{ .category = .image, .value = "image/vnd.valve.source.texture" };
+ pub const @"image/vnd.wap.wbmp": MimeType = MimeType{ .category = .image, .value = "image/vnd.wap.wbmp" };
+ pub const @"image/vnd.xiff": MimeType = MimeType{ .category = .image, .value = "image/vnd.xiff" };
+ pub const @"image/vnd.zbrush.pcx": MimeType = MimeType{ .category = .image, .value = "image/vnd.zbrush.pcx" };
+ pub const @"image/webp": MimeType = MimeType{ .category = .image, .value = "image/webp" };
+ pub const @"image/wmf": MimeType = MimeType{ .category = .image, .value = "image/wmf" };
+ pub const @"image/x-3ds": MimeType = MimeType{ .category = .image, .value = "image/x-3ds" };
+ pub const @"image/x-cmu-raster": MimeType = MimeType{ .category = .image, .value = "image/x-cmu-raster" };
+ pub const @"image/x-cmx": MimeType = MimeType{ .category = .image, .value = "image/x-cmx" };
+ pub const @"image/x-freehand": MimeType = MimeType{ .category = .image, .value = "image/x-freehand" };
+ pub const @"image/x-icon": MimeType = MimeType{ .category = .image, .value = "image/x-icon" };
+ pub const @"image/x-jng": MimeType = MimeType{ .category = .image, .value = "image/x-jng" };
+ pub const @"image/x-mrsid-image": MimeType = MimeType{ .category = .image, .value = "image/x-mrsid-image" };
+ pub const @"image/x-ms-bmp": MimeType = MimeType{ .category = .image, .value = "image/x-ms-bmp" };
+ pub const @"image/x-pcx": MimeType = MimeType{ .category = .image, .value = "image/x-pcx" };
+ pub const @"image/x-pict": MimeType = MimeType{ .category = .image, .value = "image/x-pict" };
+ pub const @"image/x-portable-anymap": MimeType = MimeType{ .category = .image, .value = "image/x-portable-anymap" };
+ pub const @"image/x-portable-bitmap": MimeType = MimeType{ .category = .image, .value = "image/x-portable-bitmap" };
+ pub const @"image/x-portable-graymap": MimeType = MimeType{ .category = .image, .value = "image/x-portable-graymap" };
+ pub const @"image/x-portable-pixmap": MimeType = MimeType{ .category = .image, .value = "image/x-portable-pixmap" };
+ pub const @"image/x-rgb": MimeType = MimeType{ .category = .image, .value = "image/x-rgb" };
+ pub const @"image/x-tga": MimeType = MimeType{ .category = .image, .value = "image/x-tga" };
+ pub const @"image/x-xbitmap": MimeType = MimeType{ .category = .image, .value = "image/x-xbitmap" };
+ pub const @"image/x-xcf": MimeType = MimeType{ .category = .image, .value = "image/x-xcf" };
+ pub const @"image/x-xpixmap": MimeType = MimeType{ .category = .image, .value = "image/x-xpixmap" };
+ pub const @"image/x-xwindowdump": MimeType = MimeType{ .category = .image, .value = "image/x-xwindowdump" };
+ pub const @"message/cpim": MimeType = MimeType{ .category = .message, .value = "message/cpim" };
+ pub const @"message/delivery-status": MimeType = MimeType{ .category = .message, .value = "message/delivery-status" };
+ pub const @"message/disposition-notification": MimeType = MimeType{ .category = .message, .value = "message/disposition-notification" };
+ pub const @"message/external-body": MimeType = MimeType{ .category = .message, .value = "message/external-body" };
+ pub const @"message/feedback-report": MimeType = MimeType{ .category = .message, .value = "message/feedback-report" };
+ pub const @"message/global": MimeType = MimeType{ .category = .message, .value = "message/global" };
+ pub const @"message/global-delivery-status": MimeType = MimeType{ .category = .message, .value = "message/global-delivery-status" };
+ pub const @"message/global-disposition-notification": MimeType = MimeType{ .category = .message, .value = "message/global-disposition-notification" };
+ pub const @"message/global-headers": MimeType = MimeType{ .category = .message, .value = "message/global-headers" };
+ pub const @"message/http": MimeType = MimeType{ .category = .message, .value = "message/http" };
+ pub const @"message/imdn+xml": MimeType = MimeType{ .category = .message, .value = "message/imdn+xml" };
+ pub const @"message/news": MimeType = MimeType{ .category = .message, .value = "message/news" };
+ pub const @"message/partial": MimeType = MimeType{ .category = .message, .value = "message/partial" };
+ pub const @"message/rfc822": MimeType = MimeType{ .category = .message, .value = "message/rfc822" };
+ pub const @"message/s-http": MimeType = MimeType{ .category = .message, .value = "message/s-http" };
+ pub const @"message/sip": MimeType = MimeType{ .category = .message, .value = "message/sip" };
+ pub const @"message/sipfrag": MimeType = MimeType{ .category = .message, .value = "message/sipfrag" };
+ pub const @"message/tracking-status": MimeType = MimeType{ .category = .message, .value = "message/tracking-status" };
+ pub const @"message/vnd.si.simp": MimeType = MimeType{ .category = .message, .value = "message/vnd.si.simp" };
+ pub const @"message/vnd.wfa.wsc": MimeType = MimeType{ .category = .message, .value = "message/vnd.wfa.wsc" };
+ pub const @"model/3mf": MimeType = MimeType{ .category = .model, .value = "model/3mf" };
+ pub const @"model/e57": MimeType = MimeType{ .category = .model, .value = "model/e57" };
+ pub const @"model/gltf+json": MimeType = MimeType{ .category = .model, .value = "model/gltf+json" };
+ pub const @"model/gltf-binary": MimeType = MimeType{ .category = .model, .value = "model/gltf-binary" };
+ pub const @"model/iges": MimeType = MimeType{ .category = .model, .value = "model/iges" };
+ pub const @"model/mesh": MimeType = MimeType{ .category = .model, .value = "model/mesh" };
+ pub const @"model/mtl": MimeType = MimeType{ .category = .model, .value = "model/mtl" };
+ pub const @"model/obj": MimeType = MimeType{ .category = .model, .value = "model/obj" };
+ pub const @"model/prc": MimeType = MimeType{ .category = .model, .value = "model/prc" };
+ pub const @"model/step": MimeType = MimeType{ .category = .model, .value = "model/step" };
+ pub const @"model/step+xml": MimeType = MimeType{ .category = .model, .value = "model/step+xml" };
+ pub const @"model/step+zip": MimeType = MimeType{ .category = .model, .value = "model/step+zip" };
+ pub const @"model/step-xml+zip": MimeType = MimeType{ .category = .model, .value = "model/step-xml+zip" };
+ pub const @"model/stl": MimeType = MimeType{ .category = .model, .value = "model/stl" };
+ pub const @"model/u3d": MimeType = MimeType{ .category = .model, .value = "model/u3d" };
+ pub const @"model/vnd.collada+xml": MimeType = MimeType{ .category = .model, .value = "model/vnd.collada+xml" };
+ pub const @"model/vnd.dwf": MimeType = MimeType{ .category = .model, .value = "model/vnd.dwf" };
+ pub const @"model/vnd.flatland.3dml": MimeType = MimeType{ .category = .model, .value = "model/vnd.flatland.3dml" };
+ pub const @"model/vnd.gdl": MimeType = MimeType{ .category = .model, .value = "model/vnd.gdl" };
+ pub const @"model/vnd.gs-gdl": MimeType = MimeType{ .category = .model, .value = "model/vnd.gs-gdl" };
+ pub const @"model/vnd.gs.gdl": MimeType = MimeType{ .category = .model, .value = "model/vnd.gs.gdl" };
+ pub const @"model/vnd.gtw": MimeType = MimeType{ .category = .model, .value = "model/vnd.gtw" };
+ pub const @"model/vnd.moml+xml": MimeType = MimeType{ .category = .model, .value = "model/vnd.moml+xml" };
+ pub const @"model/vnd.mts": MimeType = MimeType{ .category = .model, .value = "model/vnd.mts" };
+ pub const @"model/vnd.opengex": MimeType = MimeType{ .category = .model, .value = "model/vnd.opengex" };
+ pub const @"model/vnd.parasolid.transmit.binary": MimeType = MimeType{ .category = .model, .value = "model/vnd.parasolid.transmit.binary" };
+ pub const @"model/vnd.parasolid.transmit.text": MimeType = MimeType{ .category = .model, .value = "model/vnd.parasolid.transmit.text" };
+ pub const @"model/vnd.pytha.pyox": MimeType = MimeType{ .category = .model, .value = "model/vnd.pytha.pyox" };
+ pub const @"model/vnd.rosette.annotated-data-model": MimeType = MimeType{ .category = .model, .value = "model/vnd.rosette.annotated-data-model" };
+ pub const @"model/vnd.sap.vds": MimeType = MimeType{ .category = .model, .value = "model/vnd.sap.vds" };
+ pub const @"model/vnd.usdz+zip": MimeType = MimeType{ .category = .model, .value = "model/vnd.usdz+zip" };
+ pub const @"model/vnd.valve.source.compiled-map": MimeType = MimeType{ .category = .model, .value = "model/vnd.valve.source.compiled-map" };
+ pub const @"model/vnd.vtu": MimeType = MimeType{ .category = .model, .value = "model/vnd.vtu" };
+ pub const @"model/vrml": MimeType = MimeType{ .category = .model, .value = "model/vrml" };
+ pub const @"model/x3d+binary": MimeType = MimeType{ .category = .model, .value = "model/x3d+binary" };
+ pub const @"model/x3d+fastinfoset": MimeType = MimeType{ .category = .model, .value = "model/x3d+fastinfoset" };
+ pub const @"model/x3d+vrml": MimeType = MimeType{ .category = .model, .value = "model/x3d+vrml" };
+ pub const @"model/x3d+xml": MimeType = MimeType{ .category = .model, .value = "model/x3d+xml" };
+ pub const @"model/x3d-vrml": MimeType = MimeType{ .category = .model, .value = "model/x3d-vrml" };
+ pub const @"multipart/alternative": MimeType = MimeType{ .category = .multipart, .value = "multipart/alternative" };
+ pub const @"multipart/appledouble": MimeType = MimeType{ .category = .multipart, .value = "multipart/appledouble" };
+ pub const @"multipart/byteranges": MimeType = MimeType{ .category = .multipart, .value = "multipart/byteranges" };
+ pub const @"multipart/digest": MimeType = MimeType{ .category = .multipart, .value = "multipart/digest" };
+ pub const @"multipart/encrypted": MimeType = MimeType{ .category = .multipart, .value = "multipart/encrypted" };
+ pub const @"multipart/form-data": MimeType = MimeType{ .category = .multipart, .value = "multipart/form-data" };
+ pub const @"multipart/header-set": MimeType = MimeType{ .category = .multipart, .value = "multipart/header-set" };
+ pub const @"multipart/mixed": MimeType = MimeType{ .category = .multipart, .value = "multipart/mixed" };
+ pub const @"multipart/multilingual": MimeType = MimeType{ .category = .multipart, .value = "multipart/multilingual" };
+ pub const @"multipart/parallel": MimeType = MimeType{ .category = .multipart, .value = "multipart/parallel" };
+ pub const @"multipart/related": MimeType = MimeType{ .category = .multipart, .value = "multipart/related" };
+ pub const @"multipart/report": MimeType = MimeType{ .category = .multipart, .value = "multipart/report" };
+ pub const @"multipart/signed": MimeType = MimeType{ .category = .multipart, .value = "multipart/signed" };
+ pub const @"multipart/vnd.bint.med-plus": MimeType = MimeType{ .category = .multipart, .value = "multipart/vnd.bint.med-plus" };
+ pub const @"multipart/voice-message": MimeType = MimeType{ .category = .multipart, .value = "multipart/voice-message" };
+ pub const @"multipart/x-mixed-replace": MimeType = MimeType{ .category = .multipart, .value = "multipart/x-mixed-replace" };
+ pub const @"text/1d-interleaved-parityfec": MimeType = MimeType{ .category = .text, .value = "text/1d-interleaved-parityfec" };
+ pub const @"text/cache-manifest": MimeType = MimeType{ .category = .text, .value = "text/cache-manifest" };
+ pub const @"text/calendar": MimeType = MimeType{ .category = .text, .value = "text/calendar" };
+ pub const @"text/calender": MimeType = MimeType{ .category = .text, .value = "text/calender" };
+ pub const @"text/cmd": MimeType = MimeType{ .category = .text, .value = "text/cmd" };
+ pub const @"text/coffeescript": MimeType = MimeType{ .category = .text, .value = "text/coffeescript" };
+ pub const @"text/cql": MimeType = MimeType{ .category = .text, .value = "text/cql" };
+ pub const @"text/cql-expression": MimeType = MimeType{ .category = .text, .value = "text/cql-expression" };
+ pub const @"text/cql-identifier": MimeType = MimeType{ .category = .text, .value = "text/cql-identifier" };
pub const @"text/css" = css;
- pub const @"text/csv": MimeType = MimeType{ .category = .@"text", .value = "text/csv" };
- pub const @"text/csv-schema": MimeType = MimeType{ .category = .@"text", .value = "text/csv-schema" };
- pub const @"text/directory": MimeType = MimeType{ .category = .@"text", .value = "text/directory" };
- pub const @"text/dns": MimeType = MimeType{ .category = .@"text", .value = "text/dns" };
- pub const @"text/ecmascript": MimeType = MimeType{ .category = .@"text", .value = "text/ecmascript" };
- pub const @"text/encaprtp": MimeType = MimeType{ .category = .@"text", .value = "text/encaprtp" };
- pub const @"text/enriched": MimeType = MimeType{ .category = .@"text", .value = "text/enriched" };
- pub const @"text/fhirpath": MimeType = MimeType{ .category = .@"text", .value = "text/fhirpath" };
- pub const @"text/flexfec": MimeType = MimeType{ .category = .@"text", .value = "text/flexfec" };
- pub const @"text/fwdred": MimeType = MimeType{ .category = .@"text", .value = "text/fwdred" };
- pub const @"text/gff3": MimeType = MimeType{ .category = .@"text", .value = "text/gff3" };
- pub const @"text/grammar-ref-list": MimeType = MimeType{ .category = .@"text", .value = "text/grammar-ref-list" };
+ pub const @"text/csv": MimeType = MimeType{ .category = .text, .value = "text/csv" };
+ pub const @"text/csv-schema": MimeType = MimeType{ .category = .text, .value = "text/csv-schema" };
+ pub const @"text/directory": MimeType = MimeType{ .category = .text, .value = "text/directory" };
+ pub const @"text/dns": MimeType = MimeType{ .category = .text, .value = "text/dns" };
+ pub const @"text/ecmascript": MimeType = MimeType{ .category = .text, .value = "text/ecmascript" };
+ pub const @"text/encaprtp": MimeType = MimeType{ .category = .text, .value = "text/encaprtp" };
+ pub const @"text/enriched": MimeType = MimeType{ .category = .text, .value = "text/enriched" };
+ pub const @"text/fhirpath": MimeType = MimeType{ .category = .text, .value = "text/fhirpath" };
+ pub const @"text/flexfec": MimeType = MimeType{ .category = .text, .value = "text/flexfec" };
+ pub const @"text/fwdred": MimeType = MimeType{ .category = .text, .value = "text/fwdred" };
+ pub const @"text/gff3": MimeType = MimeType{ .category = .text, .value = "text/gff3" };
+ pub const @"text/grammar-ref-list": MimeType = MimeType{ .category = .text, .value = "text/grammar-ref-list" };
pub const @"text/html": MimeType = html;
- pub const @"text/jade": MimeType = MimeType{ .category = .@"text", .value = "text/jade" };
+ pub const @"text/jade": MimeType = MimeType{ .category = .text, .value = "text/jade" };
pub const @"text/javascript": MimeType = javascript;
- pub const @"text/jcr-cnd": MimeType = MimeType{ .category = .@"text", .value = "text/jcr-cnd" };
+ pub const @"text/jcr-cnd": MimeType = MimeType{ .category = .text, .value = "text/jcr-cnd" };
pub const @"text/jsx": MimeType = javascript;
- pub const @"text/less": MimeType = MimeType{ .category = .@"text", .value = "text/less" };
- pub const @"text/markdown": MimeType = MimeType{ .category = .@"text", .value = "text/markdown" };
- pub const @"text/mathml": MimeType = MimeType{ .category = .@"text", .value = "text/mathml" };
- pub const @"text/mdx": MimeType = MimeType{ .category = .@"text", .value = "text/mdx" };
- pub const @"text/mizar": MimeType = MimeType{ .category = .@"text", .value = "text/mizar" };
- pub const @"text/n3": MimeType = MimeType{ .category = .@"text", .value = "text/n3" };
- pub const @"text/parameters": MimeType = MimeType{ .category = .@"text", .value = "text/parameters" };
- pub const @"text/parityfec": MimeType = MimeType{ .category = .@"text", .value = "text/parityfec" };
+ pub const @"text/less": MimeType = MimeType{ .category = .text, .value = "text/less" };
+ pub const @"text/markdown": MimeType = MimeType{ .category = .text, .value = "text/markdown" };
+ pub const @"text/mathml": MimeType = MimeType{ .category = .text, .value = "text/mathml" };
+ pub const @"text/mdx": MimeType = MimeType{ .category = .text, .value = "text/mdx" };
+ pub const @"text/mizar": MimeType = MimeType{ .category = .text, .value = "text/mizar" };
+ pub const @"text/n3": MimeType = MimeType{ .category = .text, .value = "text/n3" };
+ pub const @"text/parameters": MimeType = MimeType{ .category = .text, .value = "text/parameters" };
+ pub const @"text/parityfec": MimeType = MimeType{ .category = .text, .value = "text/parityfec" };
pub const @"text/plain" = text;
- pub const @"text/provenance-notation": MimeType = MimeType{ .category = .@"text", .value = "text/provenance-notation" };
- pub const @"text/prs.fallenstein.rst": MimeType = MimeType{ .category = .@"text", .value = "text/prs.fallenstein.rst" };
- pub const @"text/prs.lines.tag": MimeType = MimeType{ .category = .@"text", .value = "text/prs.lines.tag" };
- pub const @"text/prs.prop.logic": MimeType = MimeType{ .category = .@"text", .value = "text/prs.prop.logic" };
- pub const @"text/raptorfec": MimeType = MimeType{ .category = .@"text", .value = "text/raptorfec" };
- pub const @"text/red": MimeType = MimeType{ .category = .@"text", .value = "text/red" };
- pub const @"text/rfc822-headers": MimeType = MimeType{ .category = .@"text", .value = "text/rfc822-headers" };
- pub const @"text/richtext": MimeType = MimeType{ .category = .@"text", .value = "text/richtext" };
- pub const @"text/rtf": MimeType = MimeType{ .category = .@"text", .value = "text/rtf" };
- pub const @"text/rtp-enc-aescm128": MimeType = MimeType{ .category = .@"text", .value = "text/rtp-enc-aescm128" };
- pub const @"text/rtploopback": MimeType = MimeType{ .category = .@"text", .value = "text/rtploopback" };
- pub const @"text/rtx": MimeType = MimeType{ .category = .@"text", .value = "text/rtx" };
- pub const @"text/sgml": MimeType = MimeType{ .category = .@"text", .value = "text/sgml" };
- pub const @"text/shaclc": MimeType = MimeType{ .category = .@"text", .value = "text/shaclc" };
- pub const @"text/shex": MimeType = MimeType{ .category = .@"text", .value = "text/shex" };
- pub const @"text/slim": MimeType = MimeType{ .category = .@"text", .value = "text/slim" };
- pub const @"text/spdx": MimeType = MimeType{ .category = .@"text", .value = "text/spdx" };
- pub const @"text/strings": MimeType = MimeType{ .category = .@"text", .value = "text/strings" };
- pub const @"text/stylus": MimeType = MimeType{ .category = .@"text", .value = "text/stylus" };
- pub const @"text/t140": MimeType = MimeType{ .category = .@"text", .value = "text/t140" };
- pub const @"text/tab-separated-values": MimeType = MimeType{ .category = .@"text", .value = "text/tab-separated-values" };
- pub const @"text/troff": MimeType = MimeType{ .category = .@"text", .value = "text/troff" };
- pub const @"text/turtle": MimeType = MimeType{ .category = .@"text", .value = "text/turtle" };
- pub const @"text/ulpfec": MimeType = MimeType{ .category = .@"text", .value = "text/ulpfec" };
- pub const @"text/uri-list": MimeType = MimeType{ .category = .@"text", .value = "text/uri-list" };
- pub const @"text/vcard": MimeType = MimeType{ .category = .@"text", .value = "text/vcard" };
- pub const @"text/vnd.a": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.a" };
- pub const @"text/vnd.abc": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.abc" };
- pub const @"text/vnd.ascii-art": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.ascii-art" };
- pub const @"text/vnd.curl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.curl" };
- pub const @"text/vnd.curl.dcurl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.curl.dcurl" };
- pub const @"text/vnd.curl.mcurl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.curl.mcurl" };
- pub const @"text/vnd.curl.scurl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.curl.scurl" };
- pub const @"text/vnd.debian.copyright": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.debian.copyright" };
- pub const @"text/vnd.dmclientscript": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.dmclientscript" };
- pub const @"text/vnd.dvb.subtitle": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.dvb.subtitle" };
- pub const @"text/vnd.esmertec.theme-descriptor": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.esmertec.theme-descriptor" };
- pub const @"text/vnd.familysearch.gedcom": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.familysearch.gedcom" };
- pub const @"text/vnd.ficlab.flt": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.ficlab.flt" };
- pub const @"text/vnd.fly": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.fly" };
- pub const @"text/vnd.fmi.flexstor": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.fmi.flexstor" };
- pub const @"text/vnd.gml": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.gml" };
- pub const @"text/vnd.graphviz": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.graphviz" };
- pub const @"text/vnd.hans": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.hans" };
- pub const @"text/vnd.hgl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.hgl" };
- pub const @"text/vnd.in3d.3dml": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.in3d.3dml" };
- pub const @"text/vnd.in3d.spot": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.in3d.spot" };
- pub const @"text/vnd.iptc.newsml": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.iptc.newsml" };
- pub const @"text/vnd.iptc.nitf": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.iptc.nitf" };
- pub const @"text/vnd.latex-z": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.latex-z" };
- pub const @"text/vnd.motorola.reflex": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.motorola.reflex" };
- pub const @"text/vnd.ms-mediapackage": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.ms-mediapackage" };
- pub const @"text/vnd.net2phone.commcenter.command": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.net2phone.commcenter.command" };
- pub const @"text/vnd.radisys.msml-basic-layout": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.radisys.msml-basic-layout" };
- pub const @"text/vnd.senx.warpscript": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.senx.warpscript" };
- pub const @"text/vnd.si.uricatalogue": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.si.uricatalogue" };
- pub const @"text/vnd.sosi": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.sosi" };
- pub const @"text/vnd.sun.j2me.app-descriptor": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.sun.j2me.app-descriptor" };
- pub const @"text/vnd.trolltech.linguist": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.trolltech.linguist" };
- pub const @"text/vnd.wap.si": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.wap.si" };
- pub const @"text/vnd.wap.sl": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.wap.sl" };
- pub const @"text/vnd.wap.wml": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.wap.wml" };
- pub const @"text/vnd.wap.wmlscript": MimeType = MimeType{ .category = .@"text", .value = "text/vnd.wap.wmlscript" };
- pub const @"text/vtt": MimeType = MimeType{ .category = .@"text", .value = "text/vtt" };
- pub const @"text/x-asm": MimeType = MimeType{ .category = .@"text", .value = "text/x-asm" };
- pub const @"text/x-c": MimeType = MimeType{ .category = .@"text", .value = "text/x-c" };
- pub const @"text/x-component": MimeType = MimeType{ .category = .@"text", .value = "text/x-component" };
- pub const @"text/x-fortran": MimeType = MimeType{ .category = .@"text", .value = "text/x-fortran" };
- pub const @"text/x-gwt-rpc": MimeType = MimeType{ .category = .@"text", .value = "text/x-gwt-rpc" };
- pub const @"text/x-handlebars-template": MimeType = MimeType{ .category = .@"text", .value = "text/x-handlebars-template" };
- pub const @"text/x-java-source": MimeType = MimeType{ .category = .@"text", .value = "text/x-java-source" };
- pub const @"text/x-jquery-tmpl": MimeType = MimeType{ .category = .@"text", .value = "text/x-jquery-tmpl" };
- pub const @"text/x-lua": MimeType = MimeType{ .category = .@"text", .value = "text/x-lua" };
- pub const @"text/x-markdown": MimeType = MimeType{ .category = .@"text", .value = "text/x-markdown" };
- pub const @"text/x-nfo": MimeType = MimeType{ .category = .@"text", .value = "text/x-nfo" };
- pub const @"text/x-opml": MimeType = MimeType{ .category = .@"text", .value = "text/x-opml" };
- pub const @"text/x-org": MimeType = MimeType{ .category = .@"text", .value = "text/x-org" };
- pub const @"text/x-pascal": MimeType = MimeType{ .category = .@"text", .value = "text/x-pascal" };
- pub const @"text/x-processing": MimeType = MimeType{ .category = .@"text", .value = "text/x-processing" };
- pub const @"text/x-sass": MimeType = MimeType{ .category = .@"text", .value = "text/x-sass" };
- pub const @"text/x-scss": MimeType = MimeType{ .category = .@"text", .value = "text/x-scss" };
- pub const @"text/x-setext": MimeType = MimeType{ .category = .@"text", .value = "text/x-setext" };
- pub const @"text/x-sfv": MimeType = MimeType{ .category = .@"text", .value = "text/x-sfv" };
- pub const @"text/x-suse-ymp": MimeType = MimeType{ .category = .@"text", .value = "text/x-suse-ymp" };
- pub const @"text/x-uuencode": MimeType = MimeType{ .category = .@"text", .value = "text/x-uuencode" };
- pub const @"text/x-vcalendar": MimeType = MimeType{ .category = .@"text", .value = "text/x-vcalendar" };
- pub const @"text/x-vcard": MimeType = MimeType{ .category = .@"text", .value = "text/x-vcard" };
- pub const @"text/xml": MimeType = MimeType{ .category = .@"text", .value = "text/xml" };
- pub const @"text/xml-external-parsed-entity": MimeType = MimeType{ .category = .@"text", .value = "text/xml-external-parsed-entity" };
- pub const @"text/yaml": MimeType = MimeType{ .category = .@"text", .value = "text/yaml" };
- pub const @"video/1d-interleaved-parityfec": MimeType = MimeType{ .category = .@"video", .value = "video/1d-interleaved-parityfec" };
- pub const @"video/3gpp": MimeType = MimeType{ .category = .@"video", .value = "video/3gpp" };
- pub const @"video/3gpp-tt": MimeType = MimeType{ .category = .@"video", .value = "video/3gpp-tt" };
- pub const @"video/3gpp2": MimeType = MimeType{ .category = .@"video", .value = "video/3gpp2" };
- pub const @"video/av1": MimeType = MimeType{ .category = .@"video", .value = "video/av1" };
- pub const @"video/bmpeg": MimeType = MimeType{ .category = .@"video", .value = "video/bmpeg" };
- pub const @"video/bt656": MimeType = MimeType{ .category = .@"video", .value = "video/bt656" };
- pub const @"video/celb": MimeType = MimeType{ .category = .@"video", .value = "video/celb" };
- pub const @"video/dv": MimeType = MimeType{ .category = .@"video", .value = "video/dv" };
- pub const @"video/encaprtp": MimeType = MimeType{ .category = .@"video", .value = "video/encaprtp" };
- pub const @"video/ffv1": MimeType = MimeType{ .category = .@"video", .value = "video/ffv1" };
- pub const @"video/flexfec": MimeType = MimeType{ .category = .@"video", .value = "video/flexfec" };
- pub const @"video/h261": MimeType = MimeType{ .category = .@"video", .value = "video/h261" };
- pub const @"video/h263": MimeType = MimeType{ .category = .@"video", .value = "video/h263" };
- pub const @"video/h263-1998": MimeType = MimeType{ .category = .@"video", .value = "video/h263-1998" };
- pub const @"video/h263-2000": MimeType = MimeType{ .category = .@"video", .value = "video/h263-2000" };
- pub const @"video/h264": MimeType = MimeType{ .category = .@"video", .value = "video/h264" };
- pub const @"video/h264-rcdo": MimeType = MimeType{ .category = .@"video", .value = "video/h264-rcdo" };
- pub const @"video/h264-svc": MimeType = MimeType{ .category = .@"video", .value = "video/h264-svc" };
- pub const @"video/h265": MimeType = MimeType{ .category = .@"video", .value = "video/h265" };
- pub const @"video/iso.segment": MimeType = MimeType{ .category = .@"video", .value = "video/iso.segment" };
- pub const @"video/jpeg": MimeType = MimeType{ .category = .@"video", .value = "video/jpeg" };
- pub const @"video/jpeg2000": MimeType = MimeType{ .category = .@"video", .value = "video/jpeg2000" };
- pub const @"video/jpm": MimeType = MimeType{ .category = .@"video", .value = "video/jpm" };
- pub const @"video/jxsv": MimeType = MimeType{ .category = .@"video", .value = "video/jxsv" };
- pub const @"video/mj2": MimeType = MimeType{ .category = .@"video", .value = "video/mj2" };
- pub const @"video/mp1s": MimeType = MimeType{ .category = .@"video", .value = "video/mp1s" };
- pub const @"video/mp2p": MimeType = MimeType{ .category = .@"video", .value = "video/mp2p" };
- pub const @"video/mp2t": MimeType = MimeType{ .category = .@"video", .value = "video/mp2t" };
- pub const @"video/mp4": MimeType = MimeType{ .category = .@"video", .value = "video/mp4" };
- pub const @"video/mp4v-es": MimeType = MimeType{ .category = .@"video", .value = "video/mp4v-es" };
- pub const @"video/mpeg": MimeType = MimeType{ .category = .@"video", .value = "video/mpeg" };
- pub const @"video/mpeg4-generic": MimeType = MimeType{ .category = .@"video", .value = "video/mpeg4-generic" };
- pub const @"video/mpv": MimeType = MimeType{ .category = .@"video", .value = "video/mpv" };
- pub const @"video/nv": MimeType = MimeType{ .category = .@"video", .value = "video/nv" };
- pub const @"video/ogg": MimeType = MimeType{ .category = .@"video", .value = "video/ogg" };
- pub const @"video/parityfec": MimeType = MimeType{ .category = .@"video", .value = "video/parityfec" };
- pub const @"video/pointer": MimeType = MimeType{ .category = .@"video", .value = "video/pointer" };
- pub const @"video/quicktime": MimeType = MimeType{ .category = .@"video", .value = "video/quicktime" };
- pub const @"video/raptorfec": MimeType = MimeType{ .category = .@"video", .value = "video/raptorfec" };
- pub const @"video/raw": MimeType = MimeType{ .category = .@"video", .value = "video/raw" };
- pub const @"video/rtp-enc-aescm128": MimeType = MimeType{ .category = .@"video", .value = "video/rtp-enc-aescm128" };
- pub const @"video/rtploopback": MimeType = MimeType{ .category = .@"video", .value = "video/rtploopback" };
- pub const @"video/rtx": MimeType = MimeType{ .category = .@"video", .value = "video/rtx" };
- pub const @"video/scip": MimeType = MimeType{ .category = .@"video", .value = "video/scip" };
- pub const @"video/smpte291": MimeType = MimeType{ .category = .@"video", .value = "video/smpte291" };
- pub const @"video/smpte292m": MimeType = MimeType{ .category = .@"video", .value = "video/smpte292m" };
- pub const @"video/ulpfec": MimeType = MimeType{ .category = .@"video", .value = "video/ulpfec" };
- pub const @"video/vc1": MimeType = MimeType{ .category = .@"video", .value = "video/vc1" };
- pub const @"video/vc2": MimeType = MimeType{ .category = .@"video", .value = "video/vc2" };
- pub const @"video/vnd.cctv": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.cctv" };
- pub const @"video/vnd.dece.hd": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.hd" };
- pub const @"video/vnd.dece.mobile": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.mobile" };
- pub const @"video/vnd.dece.mp4": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.mp4" };
- pub const @"video/vnd.dece.pd": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.pd" };
- pub const @"video/vnd.dece.sd": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.sd" };
- pub const @"video/vnd.dece.video": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dece.video" };
- pub const @"video/vnd.directv.mpeg": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.directv.mpeg" };
- pub const @"video/vnd.directv.mpeg-tts": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.directv.mpeg-tts" };
- pub const @"video/vnd.dlna.mpeg-tts": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dlna.mpeg-tts" };
- pub const @"video/vnd.dvb.file": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.dvb.file" };
- pub const @"video/vnd.fvt": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.fvt" };
- pub const @"video/vnd.hns.video": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.hns.video" };
- pub const @"video/vnd.iptvforum.1dparityfec-1010": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.1dparityfec-1010" };
- pub const @"video/vnd.iptvforum.1dparityfec-2005": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.1dparityfec-2005" };
- pub const @"video/vnd.iptvforum.2dparityfec-1010": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.2dparityfec-1010" };
- pub const @"video/vnd.iptvforum.2dparityfec-2005": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.2dparityfec-2005" };
- pub const @"video/vnd.iptvforum.ttsavc": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.ttsavc" };
- pub const @"video/vnd.iptvforum.ttsmpeg2": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.iptvforum.ttsmpeg2" };
- pub const @"video/vnd.motorola.video": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.motorola.video" };
- pub const @"video/vnd.motorola.videop": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.motorola.videop" };
- pub const @"video/vnd.mpegurl": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.mpegurl" };
- pub const @"video/vnd.ms-playready.media.pyv": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.ms-playready.media.pyv" };
- pub const @"video/vnd.nokia.interleaved-multimedia": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.nokia.interleaved-multimedia" };
- pub const @"video/vnd.nokia.mp4vr": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.nokia.mp4vr" };
- pub const @"video/vnd.nokia.videovoip": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.nokia.videovoip" };
- pub const @"video/vnd.objectvideo": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.objectvideo" };
- pub const @"video/vnd.radgamettools.bink": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.radgamettools.bink" };
- pub const @"video/vnd.radgamettools.smacker": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.radgamettools.smacker" };
- pub const @"video/vnd.sealed.mpeg1": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.sealed.mpeg1" };
- pub const @"video/vnd.sealed.mpeg4": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.sealed.mpeg4" };
- pub const @"video/vnd.sealed.swf": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.sealed.swf" };
- pub const @"video/vnd.sealedmedia.softseal.mov": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.sealedmedia.softseal.mov" };
- pub const @"video/vnd.uvvu.mp4": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.uvvu.mp4" };
- pub const @"video/vnd.vivo": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.vivo" };
- pub const @"video/vnd.youtube.yt": MimeType = MimeType{ .category = .@"video", .value = "video/vnd.youtube.yt" };
- pub const @"video/vp8": MimeType = MimeType{ .category = .@"video", .value = "video/vp8" };
- pub const @"video/vp9": MimeType = MimeType{ .category = .@"video", .value = "video/vp9" };
- pub const @"video/webm": MimeType = MimeType{ .category = .@"video", .value = "video/webm" };
- pub const @"video/x-f4v": MimeType = MimeType{ .category = .@"video", .value = "video/x-f4v" };
- pub const @"video/x-fli": MimeType = MimeType{ .category = .@"video", .value = "video/x-fli" };
- pub const @"video/x-flv": MimeType = MimeType{ .category = .@"video", .value = "video/x-flv" };
- pub const @"video/x-m4v": MimeType = MimeType{ .category = .@"video", .value = "video/x-m4v" };
- pub const @"video/x-matroska": MimeType = MimeType{ .category = .@"video", .value = "video/x-matroska" };
- pub const @"video/x-mng": MimeType = MimeType{ .category = .@"video", .value = "video/x-mng" };
- pub const @"video/x-ms-asf": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-asf" };
- pub const @"video/x-ms-vob": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-vob" };
- pub const @"video/x-ms-wm": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-wm" };
- pub const @"video/x-ms-wmv": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-wmv" };
- pub const @"video/x-ms-wmx": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-wmx" };
- pub const @"video/x-ms-wvx": MimeType = MimeType{ .category = .@"video", .value = "video/x-ms-wvx" };
- pub const @"video/x-msvideo": MimeType = MimeType{ .category = .@"video", .value = "video/x-msvideo" };
- pub const @"video/x-sgi-movie": MimeType = MimeType{ .category = .@"video", .value = "video/x-sgi-movie" };
- pub const @"video/x-smv": MimeType = MimeType{ .category = .@"video", .value = "video/x-smv" };
+ pub const @"text/provenance-notation": MimeType = MimeType{ .category = .text, .value = "text/provenance-notation" };
+ pub const @"text/prs.fallenstein.rst": MimeType = MimeType{ .category = .text, .value = "text/prs.fallenstein.rst" };
+ pub const @"text/prs.lines.tag": MimeType = MimeType{ .category = .text, .value = "text/prs.lines.tag" };
+ pub const @"text/prs.prop.logic": MimeType = MimeType{ .category = .text, .value = "text/prs.prop.logic" };
+ pub const @"text/raptorfec": MimeType = MimeType{ .category = .text, .value = "text/raptorfec" };
+ pub const @"text/red": MimeType = MimeType{ .category = .text, .value = "text/red" };
+ pub const @"text/rfc822-headers": MimeType = MimeType{ .category = .text, .value = "text/rfc822-headers" };
+ pub const @"text/richtext": MimeType = MimeType{ .category = .text, .value = "text/richtext" };
+ pub const @"text/rtf": MimeType = MimeType{ .category = .text, .value = "text/rtf" };
+ pub const @"text/rtp-enc-aescm128": MimeType = MimeType{ .category = .text, .value = "text/rtp-enc-aescm128" };
+ pub const @"text/rtploopback": MimeType = MimeType{ .category = .text, .value = "text/rtploopback" };
+ pub const @"text/rtx": MimeType = MimeType{ .category = .text, .value = "text/rtx" };
+ pub const @"text/sgml": MimeType = MimeType{ .category = .text, .value = "text/sgml" };
+ pub const @"text/shaclc": MimeType = MimeType{ .category = .text, .value = "text/shaclc" };
+ pub const @"text/shex": MimeType = MimeType{ .category = .text, .value = "text/shex" };
+ pub const @"text/slim": MimeType = MimeType{ .category = .text, .value = "text/slim" };
+ pub const @"text/spdx": MimeType = MimeType{ .category = .text, .value = "text/spdx" };
+ pub const @"text/strings": MimeType = MimeType{ .category = .text, .value = "text/strings" };
+ pub const @"text/stylus": MimeType = MimeType{ .category = .text, .value = "text/stylus" };
+ pub const @"text/t140": MimeType = MimeType{ .category = .text, .value = "text/t140" };
+ pub const @"text/tab-separated-values": MimeType = MimeType{ .category = .text, .value = "text/tab-separated-values" };
+ pub const @"text/troff": MimeType = MimeType{ .category = .text, .value = "text/troff" };
+ pub const @"text/turtle": MimeType = MimeType{ .category = .text, .value = "text/turtle" };
+ pub const @"text/ulpfec": MimeType = MimeType{ .category = .text, .value = "text/ulpfec" };
+ pub const @"text/uri-list": MimeType = MimeType{ .category = .text, .value = "text/uri-list" };
+ pub const @"text/vcard": MimeType = MimeType{ .category = .text, .value = "text/vcard" };
+ pub const @"text/vnd.a": MimeType = MimeType{ .category = .text, .value = "text/vnd.a" };
+ pub const @"text/vnd.abc": MimeType = MimeType{ .category = .text, .value = "text/vnd.abc" };
+ pub const @"text/vnd.ascii-art": MimeType = MimeType{ .category = .text, .value = "text/vnd.ascii-art" };
+ pub const @"text/vnd.curl": MimeType = MimeType{ .category = .text, .value = "text/vnd.curl" };
+ pub const @"text/vnd.curl.dcurl": MimeType = MimeType{ .category = .text, .value = "text/vnd.curl.dcurl" };
+ pub const @"text/vnd.curl.mcurl": MimeType = MimeType{ .category = .text, .value = "text/vnd.curl.mcurl" };
+ pub const @"text/vnd.curl.scurl": MimeType = MimeType{ .category = .text, .value = "text/vnd.curl.scurl" };
+ pub const @"text/vnd.debian.copyright": MimeType = MimeType{ .category = .text, .value = "text/vnd.debian.copyright" };
+ pub const @"text/vnd.dmclientscript": MimeType = MimeType{ .category = .text, .value = "text/vnd.dmclientscript" };
+ pub const @"text/vnd.dvb.subtitle": MimeType = MimeType{ .category = .text, .value = "text/vnd.dvb.subtitle" };
+ pub const @"text/vnd.esmertec.theme-descriptor": MimeType = MimeType{ .category = .text, .value = "text/vnd.esmertec.theme-descriptor" };
+ pub const @"text/vnd.familysearch.gedcom": MimeType = MimeType{ .category = .text, .value = "text/vnd.familysearch.gedcom" };
+ pub const @"text/vnd.ficlab.flt": MimeType = MimeType{ .category = .text, .value = "text/vnd.ficlab.flt" };
+ pub const @"text/vnd.fly": MimeType = MimeType{ .category = .text, .value = "text/vnd.fly" };
+ pub const @"text/vnd.fmi.flexstor": MimeType = MimeType{ .category = .text, .value = "text/vnd.fmi.flexstor" };
+ pub const @"text/vnd.gml": MimeType = MimeType{ .category = .text, .value = "text/vnd.gml" };
+ pub const @"text/vnd.graphviz": MimeType = MimeType{ .category = .text, .value = "text/vnd.graphviz" };
+ pub const @"text/vnd.hans": MimeType = MimeType{ .category = .text, .value = "text/vnd.hans" };
+ pub const @"text/vnd.hgl": MimeType = MimeType{ .category = .text, .value = "text/vnd.hgl" };
+ pub const @"text/vnd.in3d.3dml": MimeType = MimeType{ .category = .text, .value = "text/vnd.in3d.3dml" };
+ pub const @"text/vnd.in3d.spot": MimeType = MimeType{ .category = .text, .value = "text/vnd.in3d.spot" };
+ pub const @"text/vnd.iptc.newsml": MimeType = MimeType{ .category = .text, .value = "text/vnd.iptc.newsml" };
+ pub const @"text/vnd.iptc.nitf": MimeType = MimeType{ .category = .text, .value = "text/vnd.iptc.nitf" };
+ pub const @"text/vnd.latex-z": MimeType = MimeType{ .category = .text, .value = "text/vnd.latex-z" };
+ pub const @"text/vnd.motorola.reflex": MimeType = MimeType{ .category = .text, .value = "text/vnd.motorola.reflex" };
+ pub const @"text/vnd.ms-mediapackage": MimeType = MimeType{ .category = .text, .value = "text/vnd.ms-mediapackage" };
+ pub const @"text/vnd.net2phone.commcenter.command": MimeType = MimeType{ .category = .text, .value = "text/vnd.net2phone.commcenter.command" };
+ pub const @"text/vnd.radisys.msml-basic-layout": MimeType = MimeType{ .category = .text, .value = "text/vnd.radisys.msml-basic-layout" };
+ pub const @"text/vnd.senx.warpscript": MimeType = MimeType{ .category = .text, .value = "text/vnd.senx.warpscript" };
+ pub const @"text/vnd.si.uricatalogue": MimeType = MimeType{ .category = .text, .value = "text/vnd.si.uricatalogue" };
+ pub const @"text/vnd.sosi": MimeType = MimeType{ .category = .text, .value = "text/vnd.sosi" };
+ pub const @"text/vnd.sun.j2me.app-descriptor": MimeType = MimeType{ .category = .text, .value = "text/vnd.sun.j2me.app-descriptor" };
+ pub const @"text/vnd.trolltech.linguist": MimeType = MimeType{ .category = .text, .value = "text/vnd.trolltech.linguist" };
+ pub const @"text/vnd.wap.si": MimeType = MimeType{ .category = .text, .value = "text/vnd.wap.si" };
+ pub const @"text/vnd.wap.sl": MimeType = MimeType{ .category = .text, .value = "text/vnd.wap.sl" };
+ pub const @"text/vnd.wap.wml": MimeType = MimeType{ .category = .text, .value = "text/vnd.wap.wml" };
+ pub const @"text/vnd.wap.wmlscript": MimeType = MimeType{ .category = .text, .value = "text/vnd.wap.wmlscript" };
+ pub const @"text/vtt": MimeType = MimeType{ .category = .text, .value = "text/vtt" };
+ pub const @"text/x-asm": MimeType = MimeType{ .category = .text, .value = "text/x-asm" };
+ pub const @"text/x-c": MimeType = MimeType{ .category = .text, .value = "text/x-c" };
+ pub const @"text/x-component": MimeType = MimeType{ .category = .text, .value = "text/x-component" };
+ pub const @"text/x-fortran": MimeType = MimeType{ .category = .text, .value = "text/x-fortran" };
+ pub const @"text/x-gwt-rpc": MimeType = MimeType{ .category = .text, .value = "text/x-gwt-rpc" };
+ pub const @"text/x-handlebars-template": MimeType = MimeType{ .category = .text, .value = "text/x-handlebars-template" };
+ pub const @"text/x-java-source": MimeType = MimeType{ .category = .text, .value = "text/x-java-source" };
+ pub const @"text/x-jquery-tmpl": MimeType = MimeType{ .category = .text, .value = "text/x-jquery-tmpl" };
+ pub const @"text/x-lua": MimeType = MimeType{ .category = .text, .value = "text/x-lua" };
+ pub const @"text/x-markdown": MimeType = MimeType{ .category = .text, .value = "text/x-markdown" };
+ pub const @"text/x-nfo": MimeType = MimeType{ .category = .text, .value = "text/x-nfo" };
+ pub const @"text/x-opml": MimeType = MimeType{ .category = .text, .value = "text/x-opml" };
+ pub const @"text/x-org": MimeType = MimeType{ .category = .text, .value = "text/x-org" };
+ pub const @"text/x-pascal": MimeType = MimeType{ .category = .text, .value = "text/x-pascal" };
+ pub const @"text/x-processing": MimeType = MimeType{ .category = .text, .value = "text/x-processing" };
+ pub const @"text/x-sass": MimeType = MimeType{ .category = .text, .value = "text/x-sass" };
+ pub const @"text/x-scss": MimeType = MimeType{ .category = .text, .value = "text/x-scss" };
+ pub const @"text/x-setext": MimeType = MimeType{ .category = .text, .value = "text/x-setext" };
+ pub const @"text/x-sfv": MimeType = MimeType{ .category = .text, .value = "text/x-sfv" };
+ pub const @"text/x-suse-ymp": MimeType = MimeType{ .category = .text, .value = "text/x-suse-ymp" };
+ pub const @"text/x-uuencode": MimeType = MimeType{ .category = .text, .value = "text/x-uuencode" };
+ pub const @"text/x-vcalendar": MimeType = MimeType{ .category = .text, .value = "text/x-vcalendar" };
+ pub const @"text/x-vcard": MimeType = MimeType{ .category = .text, .value = "text/x-vcard" };
+ pub const @"text/xml": MimeType = MimeType{ .category = .text, .value = "text/xml" };
+ pub const @"text/xml-external-parsed-entity": MimeType = MimeType{ .category = .text, .value = "text/xml-external-parsed-entity" };
+ pub const @"text/yaml": MimeType = MimeType{ .category = .text, .value = "text/yaml" };
+ pub const @"video/1d-interleaved-parityfec": MimeType = MimeType{ .category = .video, .value = "video/1d-interleaved-parityfec" };
+ pub const @"video/3gpp": MimeType = MimeType{ .category = .video, .value = "video/3gpp" };
+ pub const @"video/3gpp-tt": MimeType = MimeType{ .category = .video, .value = "video/3gpp-tt" };
+ pub const @"video/3gpp2": MimeType = MimeType{ .category = .video, .value = "video/3gpp2" };
+ pub const @"video/av1": MimeType = MimeType{ .category = .video, .value = "video/av1" };
+ pub const @"video/bmpeg": MimeType = MimeType{ .category = .video, .value = "video/bmpeg" };
+ pub const @"video/bt656": MimeType = MimeType{ .category = .video, .value = "video/bt656" };
+ pub const @"video/celb": MimeType = MimeType{ .category = .video, .value = "video/celb" };
+ pub const @"video/dv": MimeType = MimeType{ .category = .video, .value = "video/dv" };
+ pub const @"video/encaprtp": MimeType = MimeType{ .category = .video, .value = "video/encaprtp" };
+ pub const @"video/ffv1": MimeType = MimeType{ .category = .video, .value = "video/ffv1" };
+ pub const @"video/flexfec": MimeType = MimeType{ .category = .video, .value = "video/flexfec" };
+ pub const @"video/h261": MimeType = MimeType{ .category = .video, .value = "video/h261" };
+ pub const @"video/h263": MimeType = MimeType{ .category = .video, .value = "video/h263" };
+ pub const @"video/h263-1998": MimeType = MimeType{ .category = .video, .value = "video/h263-1998" };
+ pub const @"video/h263-2000": MimeType = MimeType{ .category = .video, .value = "video/h263-2000" };
+ pub const @"video/h264": MimeType = MimeType{ .category = .video, .value = "video/h264" };
+ pub const @"video/h264-rcdo": MimeType = MimeType{ .category = .video, .value = "video/h264-rcdo" };
+ pub const @"video/h264-svc": MimeType = MimeType{ .category = .video, .value = "video/h264-svc" };
+ pub const @"video/h265": MimeType = MimeType{ .category = .video, .value = "video/h265" };
+ pub const @"video/iso.segment": MimeType = MimeType{ .category = .video, .value = "video/iso.segment" };
+ pub const @"video/jpeg": MimeType = MimeType{ .category = .video, .value = "video/jpeg" };
+ pub const @"video/jpeg2000": MimeType = MimeType{ .category = .video, .value = "video/jpeg2000" };
+ pub const @"video/jpm": MimeType = MimeType{ .category = .video, .value = "video/jpm" };
+ pub const @"video/jxsv": MimeType = MimeType{ .category = .video, .value = "video/jxsv" };
+ pub const @"video/mj2": MimeType = MimeType{ .category = .video, .value = "video/mj2" };
+ pub const @"video/mp1s": MimeType = MimeType{ .category = .video, .value = "video/mp1s" };
+ pub const @"video/mp2p": MimeType = MimeType{ .category = .video, .value = "video/mp2p" };
+ pub const @"video/mp2t": MimeType = MimeType{ .category = .video, .value = "video/mp2t" };
+ pub const @"video/mp4": MimeType = MimeType{ .category = .video, .value = "video/mp4" };
+ pub const @"video/mp4v-es": MimeType = MimeType{ .category = .video, .value = "video/mp4v-es" };
+ pub const @"video/mpeg": MimeType = MimeType{ .category = .video, .value = "video/mpeg" };
+ pub const @"video/mpeg4-generic": MimeType = MimeType{ .category = .video, .value = "video/mpeg4-generic" };
+ pub const @"video/mpv": MimeType = MimeType{ .category = .video, .value = "video/mpv" };
+ pub const @"video/nv": MimeType = MimeType{ .category = .video, .value = "video/nv" };
+ pub const @"video/ogg": MimeType = MimeType{ .category = .video, .value = "video/ogg" };
+ pub const @"video/parityfec": MimeType = MimeType{ .category = .video, .value = "video/parityfec" };
+ pub const @"video/pointer": MimeType = MimeType{ .category = .video, .value = "video/pointer" };
+ pub const @"video/quicktime": MimeType = MimeType{ .category = .video, .value = "video/quicktime" };
+ pub const @"video/raptorfec": MimeType = MimeType{ .category = .video, .value = "video/raptorfec" };
+ pub const @"video/raw": MimeType = MimeType{ .category = .video, .value = "video/raw" };
+ pub const @"video/rtp-enc-aescm128": MimeType = MimeType{ .category = .video, .value = "video/rtp-enc-aescm128" };
+ pub const @"video/rtploopback": MimeType = MimeType{ .category = .video, .value = "video/rtploopback" };
+ pub const @"video/rtx": MimeType = MimeType{ .category = .video, .value = "video/rtx" };
+ pub const @"video/scip": MimeType = MimeType{ .category = .video, .value = "video/scip" };
+ pub const @"video/smpte291": MimeType = MimeType{ .category = .video, .value = "video/smpte291" };
+ pub const @"video/smpte292m": MimeType = MimeType{ .category = .video, .value = "video/smpte292m" };
+ pub const @"video/ulpfec": MimeType = MimeType{ .category = .video, .value = "video/ulpfec" };
+ pub const @"video/vc1": MimeType = MimeType{ .category = .video, .value = "video/vc1" };
+ pub const @"video/vc2": MimeType = MimeType{ .category = .video, .value = "video/vc2" };
+ pub const @"video/vnd.cctv": MimeType = MimeType{ .category = .video, .value = "video/vnd.cctv" };
+ pub const @"video/vnd.dece.hd": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.hd" };
+ pub const @"video/vnd.dece.mobile": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.mobile" };
+ pub const @"video/vnd.dece.mp4": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.mp4" };
+ pub const @"video/vnd.dece.pd": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.pd" };
+ pub const @"video/vnd.dece.sd": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.sd" };
+ pub const @"video/vnd.dece.video": MimeType = MimeType{ .category = .video, .value = "video/vnd.dece.video" };
+ pub const @"video/vnd.directv.mpeg": MimeType = MimeType{ .category = .video, .value = "video/vnd.directv.mpeg" };
+ pub const @"video/vnd.directv.mpeg-tts": MimeType = MimeType{ .category = .video, .value = "video/vnd.directv.mpeg-tts" };
+ pub const @"video/vnd.dlna.mpeg-tts": MimeType = MimeType{ .category = .video, .value = "video/vnd.dlna.mpeg-tts" };
+ pub const @"video/vnd.dvb.file": MimeType = MimeType{ .category = .video, .value = "video/vnd.dvb.file" };
+ pub const @"video/vnd.fvt": MimeType = MimeType{ .category = .video, .value = "video/vnd.fvt" };
+ pub const @"video/vnd.hns.video": MimeType = MimeType{ .category = .video, .value = "video/vnd.hns.video" };
+ pub const @"video/vnd.iptvforum.1dparityfec-1010": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.1dparityfec-1010" };
+ pub const @"video/vnd.iptvforum.1dparityfec-2005": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.1dparityfec-2005" };
+ pub const @"video/vnd.iptvforum.2dparityfec-1010": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.2dparityfec-1010" };
+ pub const @"video/vnd.iptvforum.2dparityfec-2005": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.2dparityfec-2005" };
+ pub const @"video/vnd.iptvforum.ttsavc": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.ttsavc" };
+ pub const @"video/vnd.iptvforum.ttsmpeg2": MimeType = MimeType{ .category = .video, .value = "video/vnd.iptvforum.ttsmpeg2" };
+ pub const @"video/vnd.motorola.video": MimeType = MimeType{ .category = .video, .value = "video/vnd.motorola.video" };
+ pub const @"video/vnd.motorola.videop": MimeType = MimeType{ .category = .video, .value = "video/vnd.motorola.videop" };
+ pub const @"video/vnd.mpegurl": MimeType = MimeType{ .category = .video, .value = "video/vnd.mpegurl" };
+ pub const @"video/vnd.ms-playready.media.pyv": MimeType = MimeType{ .category = .video, .value = "video/vnd.ms-playready.media.pyv" };
+ pub const @"video/vnd.nokia.interleaved-multimedia": MimeType = MimeType{ .category = .video, .value = "video/vnd.nokia.interleaved-multimedia" };
+ pub const @"video/vnd.nokia.mp4vr": MimeType = MimeType{ .category = .video, .value = "video/vnd.nokia.mp4vr" };
+ pub const @"video/vnd.nokia.videovoip": MimeType = MimeType{ .category = .video, .value = "video/vnd.nokia.videovoip" };
+ pub const @"video/vnd.objectvideo": MimeType = MimeType{ .category = .video, .value = "video/vnd.objectvideo" };
+ pub const @"video/vnd.radgamettools.bink": MimeType = MimeType{ .category = .video, .value = "video/vnd.radgamettools.bink" };
+ pub const @"video/vnd.radgamettools.smacker": MimeType = MimeType{ .category = .video, .value = "video/vnd.radgamettools.smacker" };
+ pub const @"video/vnd.sealed.mpeg1": MimeType = MimeType{ .category = .video, .value = "video/vnd.sealed.mpeg1" };
+ pub const @"video/vnd.sealed.mpeg4": MimeType = MimeType{ .category = .video, .value = "video/vnd.sealed.mpeg4" };
+ pub const @"video/vnd.sealed.swf": MimeType = MimeType{ .category = .video, .value = "video/vnd.sealed.swf" };
+ pub const @"video/vnd.sealedmedia.softseal.mov": MimeType = MimeType{ .category = .video, .value = "video/vnd.sealedmedia.softseal.mov" };
+ pub const @"video/vnd.uvvu.mp4": MimeType = MimeType{ .category = .video, .value = "video/vnd.uvvu.mp4" };
+ pub const @"video/vnd.vivo": MimeType = MimeType{ .category = .video, .value = "video/vnd.vivo" };
+ pub const @"video/vnd.youtube.yt": MimeType = MimeType{ .category = .video, .value = "video/vnd.youtube.yt" };
+ pub const @"video/vp8": MimeType = MimeType{ .category = .video, .value = "video/vp8" };
+ pub const @"video/vp9": MimeType = MimeType{ .category = .video, .value = "video/vp9" };
+ pub const @"video/webm": MimeType = MimeType{ .category = .video, .value = "video/webm" };
+ pub const @"video/x-f4v": MimeType = MimeType{ .category = .video, .value = "video/x-f4v" };
+ pub const @"video/x-fli": MimeType = MimeType{ .category = .video, .value = "video/x-fli" };
+ pub const @"video/x-flv": MimeType = MimeType{ .category = .video, .value = "video/x-flv" };
+ pub const @"video/x-m4v": MimeType = MimeType{ .category = .video, .value = "video/x-m4v" };
+ pub const @"video/x-matroska": MimeType = MimeType{ .category = .video, .value = "video/x-matroska" };
+ pub const @"video/x-mng": MimeType = MimeType{ .category = .video, .value = "video/x-mng" };
+ pub const @"video/x-ms-asf": MimeType = MimeType{ .category = .video, .value = "video/x-ms-asf" };
+ pub const @"video/x-ms-vob": MimeType = MimeType{ .category = .video, .value = "video/x-ms-vob" };
+ pub const @"video/x-ms-wm": MimeType = MimeType{ .category = .video, .value = "video/x-ms-wm" };
+ pub const @"video/x-ms-wmv": MimeType = MimeType{ .category = .video, .value = "video/x-ms-wmv" };
+ pub const @"video/x-ms-wmx": MimeType = MimeType{ .category = .video, .value = "video/x-ms-wmx" };
+ pub const @"video/x-ms-wvx": MimeType = MimeType{ .category = .video, .value = "video/x-ms-wvx" };
+ pub const @"video/x-msvideo": MimeType = MimeType{ .category = .video, .value = "video/x-msvideo" };
+ pub const @"video/x-sgi-movie": MimeType = MimeType{ .category = .video, .value = "video/x-sgi-movie" };
+ pub const @"video/x-smv": MimeType = MimeType{ .category = .video, .value = "video/x-smv" };
pub const @"x-conference/x-cooltalk": MimeType = MimeType{ .category = .@"x-conference", .value = "x-conference/x-cooltalk" };
pub const @"x-shader/x-fragment": MimeType = MimeType{ .category = .@"x-shader", .value = "x-shader/x-fragment" };
pub const @"x-shader/x-vertex": MimeType = MimeType{ .category = .@"x-shader", .value = "x-shader/x-vertex" };
diff --git a/src/http/url_path.zig b/src/http/url_path.zig
index e262777da..d5f9ddbc1 100644
--- a/src/http/url_path.zig
+++ b/src/http/url_path.zig
@@ -97,7 +97,7 @@ pub fn parse(possibly_encoded_pathname_: string) !URLPath {
switch (c) {
'?' => {
- question_mark_i = @maximum(question_mark_i, i);
+ question_mark_i = @max(question_mark_i, i);
if (question_mark_i < period_i) {
period_i = -1;
}
@@ -107,13 +107,13 @@ pub fn parse(possibly_encoded_pathname_: string) !URLPath {
}
},
'.' => {
- period_i = @maximum(period_i, i);
+ period_i = @max(period_i, i);
},
'/' => {
- last_slash = @maximum(last_slash, i);
+ last_slash = @max(last_slash, i);
if (i > 0) {
- first_segment_end = @minimum(first_segment_end, i);
+ first_segment_end = @min(first_segment_end, i);
}
},
else => {},
@@ -140,7 +140,7 @@ pub fn parse(possibly_encoded_pathname_: string) !URLPath {
var path = if (question_mark_i < 0) decoded_pathname[1..] else decoded_pathname[1..@intCast(usize, question_mark_i)];
- const first_segment = decoded_pathname[1..@minimum(@intCast(usize, first_segment_end), decoded_pathname.len)];
+ const first_segment = decoded_pathname[1..@min(@intCast(usize, first_segment_end), decoded_pathname.len)];
const is_source_map = strings.eqlComptime(extname, "map");
var backup_extname: string = extname;
if (is_source_map and path.len > ".map".len) {
diff --git a/src/http/websocket.zig b/src/http/websocket.zig
index 9221ccaac..1f5b1436b 100644
--- a/src/http/websocket.zig
+++ b/src/http/websocket.zig
@@ -190,7 +190,7 @@ pub const Websocket = struct {
// Close and send the status
pub fn close(self: *Websocket, code: u16) !void {
- const c = if (native_endian == .Big) code else @byteSwap(u16, code);
+ const c = if (native_endian == .Big) code else @byteSwap(code);
const data = @bitCast([2]u8, c);
_ = try self.writeMessage(.Close, &data);
}
diff --git a/src/http/websocket_http_client.zig b/src/http/websocket_http_client.zig
index 2dd06cef1..c908b4bff 100644
--- a/src/http/websocket_http_client.zig
+++ b/src/http/websocket_http_client.zig
@@ -126,7 +126,7 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
body_buf: ?*BodyBuf = null,
body_written: usize = 0,
websocket_protocol: u64 = 0,
- hostname: [:0]u8 = "",
+ hostname: [:0]const u8 = "",
poll_ref: JSC.PollRef = .{},
pub const name = if (ssl) "WebSocketHTTPSClient" else "WebSocketHTTPClient";
@@ -226,7 +226,7 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
this.input_body_buf.len = 0;
}
pub fn clearData(this: *HTTPClient) void {
- this.poll_ref.unref(JSC.VirtualMachine.vm);
+ this.poll_ref.unref(JSC.VirtualMachine.get());
this.clearInput();
if (this.body_buf) |buf| {
@@ -312,7 +312,7 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
}
}
- const to_write = remain[0..@minimum(remain.len, data.len)];
+ const to_write = remain[0..@min(remain.len, data.len)];
if (data.len > 0 and to_write.len > 0) {
@memcpy(remain.ptr, data.ptr, to_write.len);
this.body_written += to_write.len;
@@ -412,17 +412,17 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
// return;
// }
- if (@minimum(upgrade_header.name.len, upgrade_header.value.len) == 0) {
+ if (@min(upgrade_header.name.len, upgrade_header.value.len) == 0) {
this.terminate(ErrorCode.missing_upgrade_header);
return;
}
- if (@minimum(connection_header.name.len, connection_header.value.len) == 0) {
+ if (@min(connection_header.name.len, connection_header.value.len) == 0) {
this.terminate(ErrorCode.missing_connection_header);
return;
}
- if (@minimum(websocket_accept_header.name.len, websocket_accept_header.value.len) == 0) {
+ if (@min(websocket_accept_header.name.len, websocket_accept_header.value.len) == 0) {
this.terminate(ErrorCode.missing_websocket_accept_header);
return;
}
@@ -475,7 +475,7 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
this.terminate(ErrorCode.failed_to_write);
return;
}
- this.to_send = this.to_send[@minimum(@intCast(usize, wrote), this.to_send.len)..];
+ this.to_send = this.to_send[@min(@intCast(usize, wrote), this.to_send.len)..];
}
pub fn handleTimeout(
this: *HTTPClient,
@@ -639,7 +639,7 @@ fn parseWebSocketHeader(
// + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
// | Payload Data continued ... |
// +---------------------------------------------------------------+
- const header = @bitCast(WebsocketHeader, @byteSwap(u16, @bitCast(u16, bytes)));
+ const header = @bitCast(WebsocketHeader, @byteSwap(@bitCast(u16, bytes)));
const payload = @as(usize, header.len);
payload_length.* = payload;
receiving_type.* = header.opcode;
@@ -739,7 +739,8 @@ const Copy = union(enum) {
std.debug.assert(@as(usize, encode_into_result.read) == utf16.len);
header.len = WebsocketHeader.packLength(encode_into_result.written);
header.opcode = Opcode.Text;
- header.writeHeader(std.io.fixedBufferStream(buf).writer(), encode_into_result.written) catch unreachable;
+ var fib = std.io.fixedBufferStream(buf);
+ header.writeHeader(fib.writer(), encode_into_result.written) catch unreachable;
Mask.fill(globalThis, buf[mask_offset..][0..4], to_mask[0..content_byte_len], to_mask[0..content_byte_len]);
},
@@ -749,13 +750,15 @@ const Copy = union(enum) {
std.debug.assert(@as(usize, encode_into_result.read) == latin1.len);
header.len = WebsocketHeader.packLength(encode_into_result.written);
header.opcode = Opcode.Text;
- header.writeHeader(std.io.fixedBufferStream(buf).writer(), encode_into_result.written) catch unreachable;
+ var fib = std.io.fixedBufferStream(buf);
+ header.writeHeader(fib.writer(), encode_into_result.written) catch unreachable;
Mask.fill(globalThis, buf[mask_offset..][0..4], to_mask[0..content_byte_len], to_mask[0..content_byte_len]);
},
.bytes => |bytes| {
header.len = WebsocketHeader.packLength(bytes.len);
header.opcode = Opcode.Binary;
- header.writeHeader(std.io.fixedBufferStream(buf).writer(), bytes.len) catch unreachable;
+ var fib = std.io.fixedBufferStream(buf);
+ header.writeHeader(fib.writer(), bytes.len) catch unreachable;
Mask.fill(globalThis, buf[mask_offset..][0..4], to_mask[0..content_byte_len], bytes);
},
.raw => unreachable,
@@ -1087,7 +1090,7 @@ pub fn NewWebSocketClient(comptime ssl: bool) type {
},
.ping => {
- const ping_len = @minimum(data.len, @minimum(receive_body_remain, 125));
+ const ping_len = @min(data.len, @min(receive_body_remain, 125));
this.ping_len = @truncate(u8, ping_len);
if (ping_len > 0) {
@@ -1102,7 +1105,7 @@ pub fn NewWebSocketClient(comptime ssl: bool) type {
if (data.len == 0) break;
},
.pong => {
- const pong_len = @minimum(data.len, @minimum(receive_body_remain, this.ping_frame_bytes.len));
+ const pong_len = @min(data.len, @min(receive_body_remain, this.ping_frame_bytes.len));
data = data[pong_len..];
receive_state = .need_header;
receiving_type = last_receive_data_type;
@@ -1116,7 +1119,7 @@ pub fn NewWebSocketClient(comptime ssl: bool) type {
}
if (data.len == 0) return;
- const to_consume = @minimum(receive_body_remain, data.len);
+ const to_consume = @min(receive_body_remain, data.len);
const consumed = this.consume(data[0..to_consume], receive_body_remain, last_receive_data_type, is_final);
if (consumed == 0 and last_receive_data_type == .Text) {
@@ -1254,7 +1257,7 @@ pub fn NewWebSocketClient(comptime ssl: bool) type {
header.mask = to_mask.len > 0;
header.len = @truncate(u7, this.ping_len);
- this.ping_frame_bytes[0..2].* = @bitCast(u16, header);
+ this.ping_frame_bytes[0..2].* = @bitCast([2]u8, header);
if (to_mask.len > 0) {
Mask.fill(this.globalThis, this.ping_frame_bytes[2..6], to_mask, to_mask);
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index 37f4c7c34..a8ed07113 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -359,6 +359,10 @@ pub const HTTPThread = struct {
timer: std.time.Timer = undefined,
const threadlog = Output.scoped(.HTTPThread, true);
+ const FakeStruct = struct {
+ trash: i64 = 0,
+ };
+
pub fn init() !void {
if (http_thread_loaded.swap(true, .SeqCst)) {
return;
@@ -375,13 +379,19 @@ pub const HTTPThread = struct {
.timer = std.time.Timer.start() catch unreachable,
};
- var thread = try std.Thread.spawn(.{
- .stack_size = 4 * 1024 * 1024,
- }, onStart, .{});
+ const thread = try std.Thread.spawn(
+ .{
+ .stack_size = 4 * 1024 * 1024,
+ },
+ comptime onStart,
+ .{
+ FakeStruct{},
+ },
+ );
thread.detach();
}
- pub fn onStart() void {
+ pub fn onStart(_: FakeStruct) void {
Output.Source.configureNamedThread("HTTP Client");
default_arena = Arena.init() catch unreachable;
default_allocator = default_arena.allocator();
@@ -435,7 +445,7 @@ pub const HTTPThread = struct {
}
fn processEvents_(this: *@This()) void {
- this.loop.num_polls = @maximum(2, this.loop.num_polls);
+ this.loop.num_polls = @max(2, this.loop.num_polls);
while (true) {
this.drainEvents();
@@ -492,7 +502,7 @@ pub fn onOpen(
if (comptime is_ssl) {
var ssl: *BoringSSL.SSL = @ptrCast(*BoringSSL.SSL, socket.getNativeHandle());
if (!ssl.isInitFinished()) {
- var hostname: [:0]u8 = "";
+ var hostname: [:0]const u8 = "";
var hostname_needs_free = false;
if (!strings.isIPAddress(client.url.hostname)) {
if (client.url.hostname.len < temp_hostname.len) {
@@ -519,7 +529,6 @@ pub fn onClose(
comptime is_ssl: bool,
socket: NewHTTPContext(is_ssl).HTTPSocket,
) void {
- _ = socket;
log("Closed {s}\n", .{client.url.href});
const in_progress = client.state.stage != .done and client.state.stage != .fail;
@@ -821,7 +830,7 @@ pub fn hashHeaderName(name: string) u64 {
var buf_slice: []u8 = std.mem.span(&buf);
while (remain.len > 0) {
- const end = @minimum(hasher.buf.len, remain.len);
+ const end = @min(hasher.buf.len, remain.len);
hasher.update(strings.copyLowercase(std.mem.span(remain[0..end]), buf_slice));
remain = remain[end..];
@@ -919,7 +928,7 @@ pub const AsyncHTTP = struct {
real: ?*AsyncHTTP = null,
next: ?*AsyncHTTP = null,
- task: ThreadPool.Task = ThreadPool.Task{ .callback = startAsyncHTTP },
+ task: ThreadPool.Task = ThreadPool.Task{ .callback = &startAsyncHTTP },
completion_callback: HTTPClientResult.Callback = undefined,
/// Timeout in nanoseconds
@@ -1293,7 +1302,7 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s
std.debug.assert(list.items.len == writer.context.items.len);
if (this.state.request_body.len > 0 and list.capacity - list.items.len > 0) {
var remain = list.items.ptr[list.items.len..list.capacity];
- const wrote = @minimum(remain.len, this.state.request_body.len);
+ const wrote = @min(remain.len, this.state.request_body.len);
std.debug.assert(wrote > 0);
@memcpy(remain.ptr, this.state.request_body.ptr, wrote);
list.items.len += wrote;
@@ -1416,7 +1425,7 @@ pub fn onData(this: *HTTPClient, comptime is_ssl: bool, incoming_data: []const u
this.state.pending_response = response;
- var body_buf = to_read[@minimum(@intCast(usize, response.bytes_read), to_read.len)..];
+ var body_buf = to_read[@min(@intCast(usize, response.bytes_read), to_read.len)..];
var deferred_redirect: ?*URLBufferPool.Node = null;
const can_continue = this.handleResponseMetadata(
@@ -1643,7 +1652,7 @@ pub const HTTPClientResult = struct {
ctx: *anyopaque,
function: Function,
- pub const Function = fn (*anyopaque, HTTPClientResult) void;
+ pub const Function = *const fn (*anyopaque, HTTPClientResult) void;
pub fn run(self: Callback, result: HTTPClientResult) void {
self.function(self.ctx, result);
@@ -1660,7 +1669,7 @@ pub const HTTPClientResult = struct {
pub fn wrapped_callback(ptr: *anyopaque, result: HTTPClientResult) void {
var casted = @ptrCast(Type, @alignCast(std.meta.alignment(Type), ptr));
- @call(.{ .modifier = .always_inline }, callback, .{ casted, result });
+ @call(.always_inline, callback, .{ casted, result });
}
};
}
@@ -1701,8 +1710,8 @@ fn handleResponseBodyFromSinglePacket(this: *HTTPClient, incoming_data: []const
if (this.state.encoding.isCompressed()) {
var body_buffer = this.state.body_out_str.?;
if (body_buffer.list.capacity == 0) {
- const min = @minimum(@ceil(@intToFloat(f64, incoming_data.len) * 1.5), @as(f64, 1024 * 1024 * 2));
- try body_buffer.growBy(@maximum(@floatToInt(usize, min), 32));
+ const min = @min(@ceil(@intToFloat(f64, incoming_data.len) * 1.5), @as(f64, 1024 * 1024 * 2));
+ try body_buffer.growBy(@max(@floatToInt(usize, min), 32));
}
try ZlibPool.decompress(incoming_data, body_buffer, default_allocator);
@@ -1741,7 +1750,7 @@ fn handleResponseBodyFromMultiplePackets(this: *HTTPClient, incoming_data: []con
}
const remaining_content_length = this.state.body_size -| buffer.list.items.len;
- var remainder = incoming_data[0..@minimum(incoming_data.len, remaining_content_length)];
+ var remainder = incoming_data[0..@min(incoming_data.len, remaining_content_length)];
_ = try buffer.write(remainder);
diff --git a/src/install/bin.zig b/src/install/bin.zig
index fd2220abc..c7c3b3799 100644
--- a/src/install/bin.zig
+++ b/src/install/bin.zig
@@ -18,7 +18,7 @@ const bun = @import("bun");
/// - map where keys are names of the binaries and values are file paths to the binaries
pub const Bin = extern struct {
tag: Tag = Tag.none,
- value: Value = Value{ .none = .{} },
+ value: Value = Value{ .none = {} },
pub fn count(this: Bin, buf: []const u8, extern_strings: []const ExternalString, comptime StringBuilder: type, builder: StringBuilder) u32 {
switch (this.tag) {
@@ -42,7 +42,7 @@ pub const Bin = extern struct {
pub fn clone(this: Bin, buf: []const u8, prev_external_strings: []const ExternalString, all_extern_strings: []ExternalString, extern_strings_slice: []ExternalString, comptime StringBuilder: type, builder: StringBuilder) Bin {
return switch (this.tag) {
- .none => Bin{ .tag = .none, .value = .{ .none = .{} } },
+ .none => Bin{ .tag = .none, .value = .{ .none = {} } },
.file => Bin{
.tag = .file,
.value = .{ .file = builder.append(String, this.value.file.slice(buf)) },
@@ -146,7 +146,7 @@ pub const Bin = extern struct {
bin: Bin,
i: usize = 0,
done: bool = false,
- dir_iterator: ?std.fs.Dir.Iterator = null,
+ dir_iterator: ?std.fs.IterableDir.Iterator = null,
package_name: String,
package_installed_node_modules: std.fs.Dir = std.fs.Dir{ .fd = std.math.maxInt(std.os.fd_t) },
buf: [bun.MAX_PATH_BYTES]u8 = undefined,
@@ -167,7 +167,7 @@ pub const Bin = extern struct {
var joined = Path.joinStringBuf(&this.buf, &parts, .auto);
this.buf[joined.len] = 0;
var joined_: [:0]u8 = this.buf[0..joined.len :0];
- var child_dir = try dir.openDirZ(joined_, .{ .iterate = true });
+ var child_dir = try bun.openDir(dir, joined_);
this.dir_iterator = child_dir.iterate();
}
@@ -419,7 +419,7 @@ pub const Bin = extern struct {
var joined = Path.joinStringBuf(&target_buf, &parts, .auto);
@intToPtr([*]u8, @ptrToInt(joined.ptr))[joined.len] = 0;
var joined_: [:0]const u8 = joined.ptr[0..joined.len :0];
- var child_dir = dir.openDirZ(joined_, .{ .iterate = true }) catch |err| {
+ var child_dir = bun.openDir(dir, joined_) catch |err| {
this.err = err;
return;
};
@@ -427,7 +427,7 @@ pub const Bin = extern struct {
var iter = child_dir.iterate();
- var basedir_path = std.os.getFdPath(child_dir.fd, &target_buf) catch |err| {
+ var basedir_path = std.os.getFdPath(child_dir.dir.fd, &target_buf) catch |err| {
this.err = err;
return;
};
@@ -436,9 +436,9 @@ pub const Bin = extern struct {
var prev_target_buf_remain = target_buf_remain;
while (iter.next() catch null) |entry_| {
- const entry: std.fs.Dir.Entry = entry_;
+ const entry: std.fs.IterableDir.Entry = entry_;
switch (entry.kind) {
- std.fs.Dir.Entry.Kind.SymLink, std.fs.Dir.Entry.Kind.File => {
+ std.fs.IterableDir.Entry.Kind.SymLink, std.fs.IterableDir.Entry.Kind.File => {
target_buf_remain = prev_target_buf_remain;
std.mem.copy(u8, target_buf_remain, entry.name);
target_buf_remain = target_buf_remain[entry.name.len..];
@@ -571,7 +571,7 @@ pub const Bin = extern struct {
var joined = Path.joinStringBuf(&target_buf, &parts, .auto);
@intToPtr([*]u8, @ptrToInt(joined.ptr))[joined.len] = 0;
var joined_: [:0]const u8 = joined.ptr[0..joined.len :0];
- var child_dir = dir.openDirZ(joined_, .{ .iterate = true }) catch |err| {
+ var child_dir = bun.openDir(dir, joined_) catch |err| {
this.err = err;
return;
};
@@ -579,7 +579,7 @@ pub const Bin = extern struct {
var iter = child_dir.iterate();
- var basedir_path = std.os.getFdPath(child_dir.fd, &target_buf) catch |err| {
+ var basedir_path = std.os.getFdPath(child_dir.dir.fd, &target_buf) catch |err| {
this.err = err;
return;
};
@@ -588,9 +588,9 @@ pub const Bin = extern struct {
var prev_target_buf_remain = target_buf_remain;
while (iter.next() catch null) |entry_| {
- const entry: std.fs.Dir.Entry = entry_;
+ const entry: std.fs.IterableDir.Entry = entry_;
switch (entry.kind) {
- std.fs.Dir.Entry.Kind.SymLink, std.fs.Dir.Entry.Kind.File => {
+ std.fs.IterableDir.Entry.Kind.SymLink, std.fs.IterableDir.Entry.Kind.File => {
target_buf_remain = prev_target_buf_remain;
std.mem.copy(u8, target_buf_remain, entry.name);
target_buf_remain = target_buf_remain[entry.name.len..];
diff --git a/src/install/bit_set.zig b/src/install/bit_set.zig
index 64903c9e9..b9f63e2ab 100644
--- a/src/install/bit_set.zig
+++ b/src/install/bit_set.zig
@@ -91,7 +91,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
/// Returns the total number of set bits in this bit set.
pub fn count(self: Self) usize {
- return @popCount(MaskInt, self.mask);
+ return @popCount(self.mask);
}
/// Changes the value of the specified bit of the bit
@@ -154,7 +154,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
pub fn findFirstSet(self: Self) ?usize {
const mask = self.mask;
if (mask == 0) return null;
- return @ctz(MaskInt, mask);
+ return @ctz(mask);
}
/// Finds the index of the first set bit, and unsets it.
@@ -162,7 +162,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
pub fn toggleFirstSet(self: *Self) ?usize {
const mask = self.mask;
if (mask == 0) return null;
- const index = @ctz(MaskInt, mask);
+ const index = @ctz(mask);
self.mask = mask & (mask - 1);
return index;
}
@@ -197,12 +197,12 @@ pub fn IntegerBitSet(comptime size: u16) type {
switch (direction) {
.forward => {
- const next_index = @ctz(MaskInt, self.bits_remain);
+ const next_index = @ctz(self.bits_remain);
self.bits_remain &= self.bits_remain - 1;
return next_index;
},
.reverse => {
- const leading_zeroes = @clz(MaskInt, self.bits_remain);
+ const leading_zeroes = @clz(self.bits_remain);
const top_bit = (@bitSizeOf(MaskInt) - 1) - leading_zeroes;
self.bits_remain &= (@as(MaskInt, 1) << @intCast(ShiftInt, top_bit)) - 1;
return top_bit;
@@ -227,7 +227,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
/// This set is good for sets with a larger size, but may use
/// more bytes than necessary if your set is small.
pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
- const mask_info: std.builtin.TypeInfo = @typeInfo(MaskIntType);
+ const mask_info: std.builtin.Type = @typeInfo(MaskIntType);
// Make sure the mask int is indeed an int
if (mask_info != .Int) @compileError("ArrayBitSet can only operate on integer masks, but was passed " ++ @typeName(MaskIntType));
@@ -322,7 +322,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
pub fn count(self: Self) usize {
var total: usize = 0;
for (self.masks) |mask| {
- total += @popCount(MaskInt, mask);
+ total += @popCount(mask);
}
return total;
}
@@ -405,7 +405,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
if (mask != 0) break mask;
offset += @bitSizeOf(MaskInt);
} else return null;
- return offset + @ctz(MaskInt, mask);
+ return offset + @ctz(mask);
}
/// Finds the index of the first set bit, and unsets it.
@@ -416,7 +416,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
if (mask.* != 0) break mask;
offset += @bitSizeOf(MaskInt);
} else return null;
- const index = @ctz(MaskInt, mask.*);
+ const index = @ctz(mask.*);
mask.* &= (mask.* - 1);
return offset + index;
}
@@ -587,7 +587,7 @@ pub const DynamicBitSetUnmanaged = struct {
var total: usize = 0;
for (self.masks[0..num_masks]) |mask| {
// Note: This is where we depend on padding bits being zero
- total += @popCount(MaskInt, mask);
+ total += @popCount(mask);
}
return total;
}
@@ -712,7 +712,7 @@ pub const DynamicBitSetUnmanaged = struct {
mask += 1;
offset += @bitSizeOf(MaskInt);
} else return null;
- return offset + @ctz(MaskInt, mask[0]);
+ return offset + @ctz(mask[0]);
}
/// Finds the index of the first set bit, and unsets it.
@@ -725,7 +725,7 @@ pub const DynamicBitSetUnmanaged = struct {
mask += 1;
offset += @bitSizeOf(MaskInt);
} else return null;
- const index = @ctz(MaskInt, mask[0]);
+ const index = @ctz(mask[0]);
mask[0] &= (mask[0] - 1);
return offset + index;
}
@@ -978,12 +978,12 @@ fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) typ
switch (direction) {
.forward => {
- const next_index = @ctz(MaskInt, self.bits_remain) + self.bit_offset;
+ const next_index = @ctz(self.bits_remain) + self.bit_offset;
self.bits_remain &= self.bits_remain - 1;
return next_index;
},
.reverse => {
- const leading_zeroes = @clz(MaskInt, self.bits_remain);
+ const leading_zeroes = @clz(self.bits_remain);
const top_bit = (@bitSizeOf(MaskInt) - 1) - leading_zeroes;
const no_top_bit_mask = (@as(MaskInt, 1) << @intCast(ShiftInt, top_bit)) - 1;
self.bits_remain &= no_top_bit_mask;
diff --git a/src/install/dependency.zig b/src/install/dependency.zig
index 0c81edfad..f3dd663f8 100644
--- a/src/install/dependency.zig
+++ b/src/install/dependency.zig
@@ -189,7 +189,7 @@ pub const Version = struct {
pub fn isLessThan(string_buf: []const u8, lhs: Dependency.Version, rhs: Dependency.Version) bool {
std.debug.assert(lhs.tag == rhs.tag);
- return strings.cmpStringsAsc(.{}, lhs.literal.slice(string_buf), rhs.literal.slice(string_buf));
+ return strings.cmpStringsAsc({}, lhs.literal.slice(string_buf), rhs.literal.slice(string_buf));
}
pub const External = [9]u8;
@@ -332,29 +332,29 @@ pub const Version = struct {
// git://, git@, git+ssh
'g' => {
if (strings.eqlComptime(
- dependency[0..@minimum("git://".len, dependency.len)],
+ dependency[0..@min("git://".len, dependency.len)],
"git://",
) or strings.eqlComptime(
- dependency[0..@minimum("git@".len, dependency.len)],
+ dependency[0..@min("git@".len, dependency.len)],
"git@",
) or strings.eqlComptime(
- dependency[0..@minimum("git+ssh".len, dependency.len)],
+ dependency[0..@min("git+ssh".len, dependency.len)],
"git+ssh",
) or strings.eqlComptime(
- dependency[0..@minimum("git+file".len, dependency.len)],
+ dependency[0..@min("git+file".len, dependency.len)],
"git+file",
) or strings.eqlComptime(
- dependency[0..@minimum("git+http".len, dependency.len)],
+ dependency[0..@min("git+http".len, dependency.len)],
"git+http",
) or strings.eqlComptime(
- dependency[0..@minimum("git+https".len, dependency.len)],
+ dependency[0..@min("git+https".len, dependency.len)],
"git+https",
)) {
return .git;
}
if (strings.eqlComptime(
- dependency[0..@minimum("github".len, dependency.len)],
+ dependency[0..@min("github".len, dependency.len)],
"github",
) or isGitHubRepoPath(dependency)) {
return .github;
@@ -379,21 +379,21 @@ pub const Version = struct {
var remainder = dependency;
if (strings.eqlComptime(
- remainder[0..@minimum("https://".len, remainder.len)],
+ remainder[0..@min("https://".len, remainder.len)],
"https://",
)) {
remainder = remainder["https://".len..];
}
if (strings.eqlComptime(
- remainder[0..@minimum("http://".len, remainder.len)],
+ remainder[0..@min("http://".len, remainder.len)],
"http://",
)) {
remainder = remainder["http://".len..];
}
if (strings.eqlComptime(
- remainder[0..@minimum("github".len, remainder.len)],
+ remainder[0..@min("github".len, remainder.len)],
"github",
) or isGitHubRepoPath(remainder)) {
return .github;
@@ -423,7 +423,7 @@ pub const Version = struct {
return .tarball;
if (strings.eqlComptime(
- dependency[0..@minimum("file:".len, dependency.len)],
+ dependency[0..@min("file:".len, dependency.len)],
"file:",
)) {
return .folder;
@@ -442,7 +442,7 @@ pub const Version = struct {
return .tarball;
if (strings.eqlComptime(
- dependency[0..@minimum("link:".len, dependency.len)],
+ dependency[0..@min("link:".len, dependency.len)],
"link:",
)) {
return .symlink;
@@ -458,7 +458,7 @@ pub const Version = struct {
// workspace://
'w' => {
if (strings.eqlComptime(
- dependency[0..@minimum("workspace://".len, dependency.len)],
+ dependency[0..@min("workspace://".len, dependency.len)],
"workspace://",
)) {
return .workspace;
diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig
index 3b5271d48..219c89399 100644
--- a/src/install/extract_tarball.zig
+++ b/src/install/extract_tarball.zig
@@ -22,7 +22,7 @@ package_id: PackageID,
skip_verify: bool = false,
integrity: Integrity = Integrity{},
url: string = "",
-package_manager: *PackageManager = &PackageManager.instance,
+package_manager: *PackageManager,
pub inline fn run(this: ExtractTarball, bytes: []const u8) !string {
if (!this.skip_verify and this.integrity.tag.isSupported()) {
@@ -156,9 +156,9 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
}
}
- var tmpname = try FileSystem.instance.tmpname(basename[0..@minimum(basename.len, 32)], &tmpname_buf, tgz_bytes.len);
+ var tmpname = try FileSystem.instance.tmpname(basename[0..@min(basename.len, 32)], &tmpname_buf, tgz_bytes.len);
{
- var extract_destination = tmpdir.makeOpenPath(std.mem.span(tmpname), .{ .iterate = true }) catch |err| {
+ var extract_destination = tmpdir.makeOpenPathIterable(std.mem.span(tmpname), .{}) catch |err| {
Output.panic("err: {s} when create temporary directory named {s} (while extracting {s})", .{ @errorName(err), tmpname, name });
};
@@ -248,7 +248,7 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
// We return a resolved absolute absolute file path to the cache dir.
// To get that directory, we open the directory again.
- var final_dir = cache_dir.openDirZ(folder_name, .{ .iterate = false }) catch |err| {
+ var final_dir = cache_dir.openDirZ(folder_name, .{}, true) catch |err| {
Output.prettyErrorln(
"<r><red>Error {s}<r> failed to verify cache dir for {s}",
.{
@@ -277,9 +277,9 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
// create an index storing each version of a package installed
create_index: {
- var index_dir = cache_dir.makeOpenPath(name, .{ .iterate = true }) catch break :create_index;
+ var index_dir = cache_dir.makeOpenPathIterable(name, .{}) catch break :create_index;
defer index_dir.close();
- index_dir.symLink(
+ index_dir.dir.symLink(
final_path,
// trim "name@" from the prefix
folder_name[name.len + 1 ..],
diff --git a/src/install/install.zig b/src/install/install.zig
index 2748a0af0..24512dff9 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -112,11 +112,11 @@ pub fn ExternalSliceAligned(comptime Type: type, comptime alignment_: ?u29) type
pub inline fn get(this: Slice, in: []const Type) []const Type {
// it should be impossible to address this out of bounds due to the minimum here
- return in.ptr[this.off..@minimum(in.len, this.off + this.len)];
+ return in.ptr[this.off..@min(in.len, this.off + this.len)];
}
pub inline fn mut(this: Slice, in: []Type) []Type {
- return in.ptr[this.off..@minimum(in.len, this.off + this.len)];
+ return in.ptr[this.off..@min(in.len, this.off + this.len)];
}
pub fn init(buf: []const Type, in: []const Type) Slice {
@@ -157,7 +157,7 @@ pub const Aligner = struct {
pub fn write(comptime Type: type, comptime Writer: type, writer: Writer, pos: usize) !usize {
const to_write = skipAmount(Type, pos);
- var remainder: string = alignment_bytes_to_repeat_buffer[0..@minimum(to_write, alignment_bytes_to_repeat_buffer.len)];
+ var remainder: string = alignment_bytes_to_repeat_buffer[0..@min(to_write, alignment_bytes_to_repeat_buffer.len)];
try writer.writeAll(remainder);
return to_write;
@@ -175,7 +175,7 @@ const NetworkTask = struct {
allocator: std.mem.Allocator,
request_buffer: MutableString = undefined,
response_buffer: MutableString = undefined,
- package_manager: *PackageManager = &PackageManager.instance,
+ package_manager: *PackageManager,
callback: union(Task.Tag) {
package_manifest: struct {
loaded_manifest: ?Npm.PackageManifest = null,
@@ -490,11 +490,11 @@ const Task = struct {
request: Request,
data: Data,
status: Status = Status.waiting,
- threadpool_task: ThreadPool.Task = ThreadPool.Task{ .callback = callback },
+ threadpool_task: ThreadPool.Task = ThreadPool.Task{ .callback = &callback },
log: logger.Log,
id: u64,
err: ?anyerror = null,
- package_manager: *PackageManager = &PackageManager.instance,
+ package_manager: *PackageManager,
/// An ID that lets us register a callback without keeping the same pointer around
pub const Id = struct {
@@ -631,8 +631,8 @@ const Task = struct {
};
const PackageInstall = struct {
- cache_dir: std.fs.Dir,
- destination_dir: std.fs.Dir,
+ cache_dir: std.fs.IterableDir,
+ destination_dir: std.fs.IterableDir,
cache_dir_subpath: stringZ = "",
destination_dir_subpath: stringZ = "",
destination_dir_subpath_buf: []u8,
@@ -655,17 +655,17 @@ const PackageInstall = struct {
channel: PackageInstall.Task.Channel = undefined,
skip_verify: bool = false,
progress: *Progress = undefined,
- cache_dir: std.fs.Dir = undefined,
+ cache_dir: std.fs.IterableDir = undefined,
allocator: std.mem.Allocator,
};
pub const Task = struct {
- task: ThreadPool.Task = .{ .callback = callback },
+ task: ThreadPool.Task = .{ .callback = &callback },
result: Result = Result{ .pending = void{} },
package_install: PackageInstall = undefined,
package_id: PackageID,
ctx: *PackageInstall.Context,
- destination_dir: std.fs.Dir,
+ destination_dir: std.fs.IterableDir,
pub const Channel = sync.Channel(*PackageInstall.Task, .{ .Static = 1024 });
@@ -797,7 +797,7 @@ const PackageInstall = struct {
var package_json_path: [:0]u8 = this.destination_dir_subpath_buf[0 .. this.destination_dir_subpath.len + std.fs.path.sep_str.len + "package.json".len :0];
defer this.destination_dir_subpath_buf[this.destination_dir_subpath.len] = 0;
- var package_json_file = this.destination_dir.openFileZ(package_json_path, .{ .mode = .read_only }) catch return false;
+ var package_json_file = this.destination_dir.dir.openFileZ(package_json_path, .{ .mode = .read_only }) catch return false;
defer package_json_file.close();
var body_pool = Npm.Registry.BodyPool.get(allocator);
@@ -814,7 +814,7 @@ const PackageInstall = struct {
// Heuristic: most package.jsons will be less than 2048 bytes.
read = package_json_file.read(mutable.list.items[total..]) catch return false;
- var remain = mutable.list.items[@minimum(total, read)..];
+ var remain = mutable.list.items[@min(total, read)..];
if (read > 0 and remain.len < 1024) {
mutable.growBy(4096) catch return false;
mutable.list.expandToCapacity();
@@ -857,7 +857,7 @@ const PackageInstall = struct {
skip: void,
fail: struct {
err: anyerror,
- step: Step = Step.clone,
+ step: Step,
pub inline fn isPackageMissingFromCache(this: @This()) bool {
return this.err == error.FileNotFound and this.step == .opening_cache_dir;
@@ -893,9 +893,7 @@ const PackageInstall = struct {
fn installWithClonefileEachDir(this: *PackageInstall) !Result {
const Walker = @import("../walker_skippable.zig");
- var cached_package_dir = this.cache_dir.openDirZ(this.cache_dir_subpath, .{
- .iterate = true,
- }) catch |err| return Result{
+ var cached_package_dir = bun.openDir(this.cache_dir.dir, this.cache_dir_subpath) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
defer cached_package_dir.close();
@@ -911,7 +909,7 @@ const PackageInstall = struct {
const FileCopier = struct {
pub fn copy(
- destination_dir_: std.fs.Dir,
+ destination_dir_: std.fs.IterableDir,
walker: *Walker,
) !u32 {
var real_file_count: u32 = 0;
@@ -919,7 +917,7 @@ const PackageInstall = struct {
while (try walker.next()) |entry| {
switch (entry.kind) {
.Directory => {
- std.os.mkdirat(destination_dir_.fd, entry.path, 0o755) catch {};
+ std.os.mkdirat(destination_dir_.dir.fd, entry.path, 0o755) catch {};
},
.File => {
std.mem.copy(u8, &stackpath, entry.path);
@@ -927,9 +925,9 @@ const PackageInstall = struct {
var path: [:0]u8 = stackpath[0..entry.path.len :0];
var basename: [:0]u8 = stackpath[entry.path.len - entry.basename.len .. entry.path.len :0];
switch (C.clonefileat(
- entry.dir.fd,
+ entry.dir.dir.fd,
basename,
- destination_dir_.fd,
+ destination_dir_.dir.fd,
path,
0,
)) {
@@ -953,7 +951,7 @@ const PackageInstall = struct {
}
};
- var subdir = this.destination_dir.makeOpenPath(std.mem.span(this.destination_dir_subpath), .{ .iterate = true }) catch |err| return Result{
+ var subdir = this.destination_dir.dir.makeOpenPathIterable(std.mem.span(this.destination_dir_subpath), .{}) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
@@ -980,15 +978,15 @@ const PackageInstall = struct {
if (strings.indexOfChar(current, std.fs.path.sep)) |slash| {
this.destination_dir_subpath_buf[slash] = 0;
var subdir = this.destination_dir_subpath_buf[0..slash :0];
- this.destination_dir.makeDirZ(subdir) catch {};
+ this.destination_dir.dir.makeDirZ(subdir) catch {};
this.destination_dir_subpath_buf[slash] = std.fs.path.sep;
}
}
return switch (C.clonefileat(
- this.cache_dir.fd,
+ this.cache_dir.dir.fd,
this.cache_dir_subpath,
- this.destination_dir.fd,
+ this.destination_dir.dir.fd,
this.destination_dir_subpath,
0,
)) {
@@ -1008,9 +1006,7 @@ const PackageInstall = struct {
fn installWithCopyfile(this: *PackageInstall) Result {
const Walker = @import("../walker_skippable.zig");
- var cached_package_dir = this.cache_dir.openDirZ(this.cache_dir_subpath, .{
- .iterate = true,
- }) catch |err| return Result{
+ var cached_package_dir = bun.openDir(this.cache_dir.dir, this.cache_dir_subpath) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
defer cached_package_dir.close();
@@ -1050,7 +1046,7 @@ const PackageInstall = struct {
};
defer outfile.close();
- var infile = try entry.dir.openFile(entry.basename, .{ .mode = .read_only });
+ var infile = try entry.dir.dir.openFile(entry.basename, .{ .mode = .read_only });
defer infile.close();
const stat = infile.stat() catch continue;
@@ -1070,13 +1066,13 @@ const PackageInstall = struct {
}
};
- var subdir = this.destination_dir.makeOpenPath(std.mem.span(this.destination_dir_subpath), .{ .iterate = true }) catch |err| return Result{
+ var subdir = this.destination_dir.dir.makeOpenPathIterable(std.mem.span(this.destination_dir_subpath), .{}) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
- defer subdir.close();
+ defer subdir.dir.close();
- this.file_count = FileCopier.copy(subdir, &walker_, this.progress) catch |err| return Result{
+ this.file_count = FileCopier.copy(subdir.dir, &walker_, this.progress) catch |err| return Result{
.fail = .{ .err = err, .step = .copying_files },
};
@@ -1088,9 +1084,7 @@ const PackageInstall = struct {
fn installWithHardlink(this: *PackageInstall) !Result {
const Walker = @import("../walker_skippable.zig");
- var cached_package_dir = this.cache_dir.openDirZ(this.cache_dir_subpath, .{
- .iterate = true,
- }) catch |err| return Result{
+ var cached_package_dir = bun.openDir(this.cache_dir.dir, this.cache_dir_subpath) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
defer cached_package_dir.close();
@@ -1106,17 +1100,17 @@ const PackageInstall = struct {
const FileCopier = struct {
pub fn copy(
- destination_dir_: std.fs.Dir,
+ destination_dir_: std.fs.IterableDir,
walker: *Walker,
) !u32 {
var real_file_count: u32 = 0;
while (try walker.next()) |entry| {
switch (entry.kind) {
.Directory => {
- std.os.mkdirat(destination_dir_.fd, entry.path, 0o755) catch {};
+ std.os.mkdirat(destination_dir_.dir.fd, entry.path, 0o755) catch {};
},
.File => {
- try std.os.linkat(entry.dir.fd, entry.basename, destination_dir_.fd, entry.path, 0);
+ try std.os.linkat(entry.dir.dir.fd, entry.basename, destination_dir_.dir.fd, entry.path, 0);
real_file_count += 1;
},
else => {},
@@ -1127,7 +1121,7 @@ const PackageInstall = struct {
}
};
- var subdir = this.destination_dir.makeOpenPath(std.mem.span(this.destination_dir_subpath), .{ .iterate = true }) catch |err| return Result{
+ var subdir = bun.openDir(this.destination_dir.dir, this.destination_dir_subpath) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
@@ -1151,9 +1145,7 @@ const PackageInstall = struct {
fn installWithSymlink(this: *PackageInstall) !Result {
const Walker = @import("../walker_skippable.zig");
- var cached_package_dir = this.cache_dir.openDirZ(this.cache_dir_subpath, .{
- .iterate = true,
- }) catch |err| return Result{
+ var cached_package_dir = bun.openDir(this.cache_dir.dir, this.cache_dir_subpath) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
defer cached_package_dir.close();
@@ -1222,15 +1214,15 @@ const PackageInstall = struct {
}
};
- var subdir = this.destination_dir.makeOpenPath(std.mem.span(this.destination_dir_subpath), .{ .iterate = true }) catch |err| return Result{
+ var subdir = this.destination_dir.dir.makeOpenPathIterable(std.mem.span(this.destination_dir_subpath), .{}) catch |err| return Result{
.fail = .{ .err = err, .step = .opening_cache_dir },
};
defer subdir.close();
this.file_count = FileCopier.copy(
- subdir.fd,
- cached_package_dir.fd,
+ subdir.dir.fd,
+ cached_package_dir.dir.fd,
&walker_,
) catch |err|
return Result{
@@ -1246,12 +1238,12 @@ const PackageInstall = struct {
}
pub fn uninstall(this: *PackageInstall) !void {
- try this.destination_dir.deleteTree(std.mem.span(this.destination_dir_subpath));
+ try this.destination_dir.dir.deleteTree(std.mem.span(this.destination_dir_subpath));
}
fn isDanglingSymlink(path: [:0]const u8) bool {
if (comptime Environment.isLinux) {
- const rc = Syscall.system.open(path, @as(u31, std.os.O.PATH | 0), @as(u31, 0));
+ const rc = Syscall.system.open(path, @as(u32, std.os.O.PATH | 0), @as(u32, 0));
switch (Syscall.getErrno(rc)) {
.SUCCESS => {
const fd = @intCast(std.os.fd_t, rc);
@@ -1261,7 +1253,7 @@ const PackageInstall = struct {
else => return true,
}
} else {
- const rc = Syscall.system.open(path, @as(u31, 0), @as(u31, 0));
+ const rc = Syscall.system.open(path, @as(u32, 0), @as(u32, 0));
switch (Syscall.getErrno(rc)) {
.SUCCESS => {
_ = Syscall.system.close(rc);
@@ -1281,7 +1273,7 @@ const PackageInstall = struct {
// cache_dir_subpath in here is actually the full path to the symlink pointing to the linked package
const symlinked_path = this.cache_dir_subpath;
- std.os.symlinkatZ(symlinked_path, this.destination_dir.fd, this.destination_dir_subpath) catch |err| {
+ std.os.symlinkatZ(symlinked_path, this.destination_dir.dir.fd, this.destination_dir_subpath) catch |err| {
return Result{
.fail = .{
.err = err,
@@ -1443,8 +1435,8 @@ const Waker = AsyncIO.Waker;
// 1. Download all packages, parsing their dependencies and enqueuing all dependencies for resolution
// 2.
pub const PackageManager = struct {
- cache_directory_: ?std.fs.Dir = null,
- temp_dir_: ?std.fs.Dir = null,
+ cache_directory_: ?std.fs.IterableDir = null,
+ temp_dir_: ?std.fs.IterableDir = null,
root_dir: *Fs.FileSystem.DirEntry,
env_loader: *DotEnv.Loader,
allocator: std.mem.Allocator,
@@ -1496,8 +1488,8 @@ pub const PackageManager = struct {
options: Options = Options{},
preinstall_state: std.ArrayListUnmanaged(PreinstallState) = std.ArrayListUnmanaged(PreinstallState){},
- global_link_dir: ?std.fs.Dir = null,
- global_dir: ?std.fs.Dir = null,
+ global_link_dir: ?std.fs.IterableDir = null,
+ global_dir: ?std.fs.IterableDir = null,
global_link_dir_path: string = "",
waiter: Waker = undefined,
wait_count: std.atomic.Atomic(usize) = std.atomic.Atomic(usize).init(0),
@@ -1517,16 +1509,26 @@ pub const PackageManager = struct {
);
pub const WakeHandler = struct {
- handler: fn (ctx: *anyopaque, pm: *PackageManager) void = undefined,
- onDependencyError: fn (ctx: *anyopaque, Dependency, PackageID, anyerror) void = undefined,
+ // handler: fn (ctx: *anyopaque, pm: *PackageManager) void = undefined,
+ // onDependencyError: fn (ctx: *anyopaque, Dependency, PackageID, anyerror) void = undefined,
+ handler: *const anyopaque = undefined,
+ onDependencyError: *const anyopaque = undefined,
context: ?*anyopaque = null,
+
+ pub inline fn getHandler(t: @This()) *const fn (ctx: *anyopaque, pm: *PackageManager) void {
+ return bun.cast(*const fn (ctx: *anyopaque, pm: *PackageManager) void, t.handler);
+ }
+
+ pub inline fn getonDependencyError(t: @This()) *const fn (ctx: *anyopaque, Dependency, PackageID, anyerror) void {
+ return bun.cast(*const fn (ctx: *anyopaque, Dependency, PackageID, anyerror) void, t.handler);
+ }
};
pub fn failRootResolution(this: *PackageManager, dependency: Dependency, dependency_id: PackageID, err: anyerror) void {
if (this.dynamic_root_dependencies) |*dynamic| {
dynamic.items[dependency_id].failed = err;
if (this.onWake.context) |ctx| {
- this.onWake.onDependencyError(
+ this.onWake.getonDependencyError()(
ctx,
dependency,
dependency_id,
@@ -1541,7 +1543,7 @@ pub const PackageManager = struct {
pub fn wake(this: *PackageManager) void {
if (this.onWake.context != null) {
- this.onWake.handler(this.onWake.context.?, this);
+ this.onWake.getHandler()(this.onWake.context.?, this);
return;
}
@@ -1655,13 +1657,13 @@ pub const PackageManager = struct {
return .{ .pending = index };
}
- pub fn globalLinkDir(this: *PackageManager) !std.fs.Dir {
+ pub fn globalLinkDir(this: *PackageManager) !std.fs.IterableDir {
return this.global_link_dir orelse brk: {
var global_dir = try Options.openGlobalDir(this.options.explicit_global_directory);
this.global_dir = global_dir;
- this.global_link_dir = try global_dir.makeOpenPath("node_modules", .{ .iterate = true });
+ this.global_link_dir = try global_dir.dir.makeOpenPathIterable("node_modules", .{});
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- const _path = try std.os.getFdPath(this.global_link_dir.?.fd, &buf);
+ const _path = try std.os.getFdPath(this.global_link_dir.?.dir.fd, &buf);
this.global_link_dir_path = try Fs.FileSystem.DirnameStore.instance.append([]const u8, _path);
break :brk this.global_link_dir.?;
};
@@ -1751,31 +1753,31 @@ pub const PackageManager = struct {
var cached_package_folder_name_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
- pub inline fn getCacheDirectory(this: *PackageManager) std.fs.Dir {
+ pub inline fn getCacheDirectory(this: *PackageManager) std.fs.IterableDir {
return this.cache_directory_ orelse brk: {
this.cache_directory_ = this.ensureCacheDirectory();
break :brk this.cache_directory_.?;
};
}
- pub inline fn getTemporaryDirectory(this: *PackageManager) std.fs.Dir {
+ pub inline fn getTemporaryDirectory(this: *PackageManager) std.fs.IterableDir {
return this.temp_dir_ orelse brk: {
this.temp_dir_ = this.ensureTemporaryDirectory();
break :brk this.temp_dir_.?;
};
}
- noinline fn ensureCacheDirectory(this: *PackageManager) std.fs.Dir {
+ noinline fn ensureCacheDirectory(this: *PackageManager) std.fs.IterableDir {
loop: while (true) {
if (this.options.enable.cache) {
const cache_dir = fetchCacheDirectoryPath(this.env_loader);
- return std.fs.cwd().makeOpenPath(cache_dir.path, .{ .iterate = true }) catch {
+ return std.fs.cwd().makeOpenPathIterable(cache_dir.path, .{}) catch {
this.options.enable.cache = false;
continue :loop;
};
}
- return std.fs.cwd().makeOpenPath("node_modules/.cache", .{ .iterate = true }) catch |err| {
+ return std.fs.cwd().makeOpenPathIterable("node_modules/.cache", .{}) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to write files: {s}", .{@errorName(err)});
Global.crash();
};
@@ -1788,15 +1790,15 @@ pub const PackageManager = struct {
//
// However, we want it to be reused! Otherwise a cache is silly.
// Error RenameAcrossMountPoints moving react-is to cache dir:
- noinline fn ensureTemporaryDirectory(this: *PackageManager) std.fs.Dir {
+ noinline fn ensureTemporaryDirectory(this: *PackageManager) std.fs.IterableDir {
var cache_directory = this.getCacheDirectory();
// The chosen tempdir must be on the same filesystem as the cache directory
// This makes renameat() work
const default_tempdir = Fs.FileSystem.RealFS.getDefaultTempDir();
var tried_dot_tmp = false;
- var tempdir: std.fs.Dir = std.fs.cwd().makeOpenPath(default_tempdir, .{ .iterate = true }) catch brk: {
+ var tempdir: std.fs.IterableDir = std.fs.cwd().makeOpenPathIterable(default_tempdir, .{}) catch brk: {
tried_dot_tmp = true;
- break :brk cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err| {
+ break :brk cache_directory.dir.makeOpenPathIterable(".tmp", .{}) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to access tempdir: {s}", .{@errorName(err)});
Global.crash();
};
@@ -1805,11 +1807,11 @@ pub const PackageManager = struct {
const tmpname = Fs.FileSystem.instance.tmpname("hm", &tmpbuf, 999) catch unreachable;
var timer: std.time.Timer = if (this.options.log_level != .silent) std.time.Timer.start() catch unreachable else undefined;
brk: while (true) {
- _ = tempdir.createFileZ(tmpname, .{ .truncate = true }) catch |err2| {
+ _ = tempdir.dir.createFileZ(tmpname, .{ .truncate = true }) catch |err2| {
if (!tried_dot_tmp) {
tried_dot_tmp = true;
- tempdir = cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err| {
+ tempdir = cache_directory.dir.makeOpenPathIterable(".tmp", .{}) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to access tempdir: {s}", .{@errorName(err)});
Global.crash();
};
@@ -1821,10 +1823,10 @@ pub const PackageManager = struct {
Global.crash();
};
- std.os.renameatZ(tempdir.fd, tmpname, cache_directory.fd, tmpname) catch |err| {
+ std.os.renameatZ(tempdir.dir.fd, tmpname, cache_directory.dir.fd, tmpname) catch |err| {
if (!tried_dot_tmp) {
tried_dot_tmp = true;
- tempdir = cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err2| {
+ tempdir = cache_directory.dir.makeOpenPathIterable(".tmp", .{}) catch |err2| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to write files to tempdir: {s}", .{@errorName(err2)});
Global.crash();
};
@@ -1836,13 +1838,13 @@ pub const PackageManager = struct {
});
Global.crash();
};
- cache_directory.deleteFileZ(tmpname) catch {};
+ cache_directory.dir.deleteFileZ(tmpname) catch {};
break;
}
if (this.options.log_level != .silent) {
const elapsed = timer.read();
if (elapsed > std.time.ns_per_ms * 100) {
- var cache_dir_path = std.os.getFdPath(cache_directory.fd, &path_buf) catch "it's";
+ var cache_dir_path = std.os.getFdPath(cache_directory.dir.fd, &path_buf) catch "it's";
Output.prettyErrorln(
"<r><yellow>warn<r>: Slow filesystem detected. If {s} is a network drive, consider setting $BUN_INSTALL_CACHE_DIR to a local folder.",
.{cache_dir_path},
@@ -1879,8 +1881,8 @@ pub const PackageManager = struct {
var available = buf[spanned.len..];
var end: []u8 = undefined;
if (scope.url.hostname.len > 32 or available.len < 64) {
- const visible_hostname = scope.url.hostname[0..@minimum(scope.url.hostname.len, 12)];
- end = std.fmt.bufPrint(available, "@@{s}__{x}", .{ visible_hostname, String.Builder.stringHash(scope.url.href) }) catch unreachable;
+ const visible_hostname = scope.url.hostname[0..@min(scope.url.hostname.len, 12)];
+ end = std.fmt.bufPrint(available, "@@{s}__{any}", .{ visible_hostname, bun.fmt.hexIntLower(String.Builder.stringHash(scope.url.href)) }) catch unreachable;
} else {
end = std.fmt.bufPrint(available, "@@{s}", .{scope.url.hostname}) catch unreachable;
}
@@ -1900,25 +1902,28 @@ pub const PackageManager = struct {
// TODO: normalize to alphanumeric
pub fn cachedNPMPackageFolderPrintBasename(buf: []u8, name: string, version: Semver.Version) stringZ {
+ const pre_hex_int = version.tag.pre.hash;
+ const build_hex_int = version.tag.build.hash;
+
if (!version.tag.hasPre() and !version.tag.hasBuild()) {
return std.fmt.bufPrintZ(buf, "{s}@{d}.{d}.{d}", .{ name, version.major, version.minor, version.patch }) catch unreachable;
} else if (version.tag.hasPre() and version.tag.hasBuild()) {
return std.fmt.bufPrintZ(
buf,
- "{s}@{d}.{d}.{d}-{x}+{X}",
- .{ name, version.major, version.minor, version.patch, version.tag.pre.hash, version.tag.build.hash },
+ "{s}@{d}.{d}.{d}-{any}+{any}",
+ .{ name, version.major, version.minor, version.patch, bun.fmt.hexIntLower(pre_hex_int), bun.fmt.hexIntUpper(build_hex_int) },
) catch unreachable;
} else if (version.tag.hasPre()) {
return std.fmt.bufPrintZ(
buf,
- "{s}@{d}.{d}.{d}-{x}",
- .{ name, version.major, version.minor, version.patch, version.tag.pre.hash },
+ "{s}@{d}.{d}.{d}-{any}",
+ .{ name, version.major, version.minor, version.patch, bun.fmt.hexIntLower(pre_hex_int) },
) catch unreachable;
} else if (version.tag.hasBuild()) {
return std.fmt.bufPrintZ(
buf,
- "{s}@{d}.{d}.{d}+{X}",
- .{ name, version.major, version.minor, version.patch, version.tag.build.hash },
+ "{s}@{d}.{d}.{d}+{any}",
+ .{ name, version.major, version.minor, version.patch, bun.fmt.hexIntUpper(build_hex_int) },
) catch unreachable;
} else {
unreachable;
@@ -1929,7 +1934,7 @@ pub const PackageManager = struct {
pub fn isFolderInCache(this: *PackageManager, folder_path: stringZ) bool {
// TODO: is this slow?
- var dir = this.getCacheDirectory().openDirZ(folder_path, .{ .iterate = false }) catch return false;
+ var dir = this.getCacheDirectory().dir.openDirZ(folder_path, .{}, true) catch return false;
dir.close();
return true;
}
@@ -1950,13 +1955,13 @@ pub const PackageManager = struct {
npm.fmt(this.lockfile.buffers.string_bytes.items),
},
) catch unreachable;
- return this.getCacheDirectory().readLink(
+ return this.getCacheDirectory().dir.readLink(
subpath,
buf,
) catch |err| {
// if we run into an error, delete the symlink
// so that we don't repeatedly try to read it
- std.os.unlinkat(this.getCacheDirectory().fd, subpath, 0) catch {};
+ std.os.unlinkat(this.getCacheDirectory().dir.fd, subpath, 0) catch {};
return err;
};
}
@@ -1982,7 +1987,7 @@ pub const PackageManager = struct {
pub fn getInstalledVersionsFromDiskCache(this: *PackageManager, tags_buf: *std.ArrayList(u8), package_name: []const u8, allocator: std.mem.Allocator) !std.ArrayList(Semver.Version) {
var list = std.ArrayList(Semver.Version).init(allocator);
- var dir = this.getCacheDirectory().openDir(package_name, .{ .iterate = true }) catch |err| {
+ var dir = this.getCacheDirectory().dir.openIterableDir(package_name, .{}) catch |err| {
switch (err) {
error.FileNotFound, error.NotDir, error.AccessDenied, error.DeviceBusy => {
return list;
@@ -2191,6 +2196,7 @@ pub const PackageManager = struct {
try network_task.forTarball(
this.allocator,
ExtractTarball{
+ .package_manager = &PackageManager.instance, // https://github.com/ziglang/zig/issues/14005
.name = if (package.name.len() >= strings.StringOrTinyString.Max)
strings.StringOrTinyString.init(
try FileSystem.FilenameStore.instance.append(
@@ -2202,8 +2208,8 @@ pub const PackageManager = struct {
strings.StringOrTinyString.init(this.lockfile.str(package.name)),
.resolution = package.resolution,
- .cache_dir = this.getCacheDirectory(),
- .temp_dir = this.getTemporaryDirectory(),
+ .cache_dir = this.getCacheDirectory().dir,
+ .temp_dir = this.getTemporaryDirectory().dir,
.registry = scope.url.href,
.package_id = package.meta.id,
.integrity = package.meta.integrity,
@@ -2281,8 +2287,8 @@ pub const PackageManager = struct {
this.network_task_fifo.writeItemAssumeCapacity(task);
}
- const SuccessFn = fn (*PackageManager, PackageID, PackageID) void;
- const FailFn = fn (*PackageManager, Dependency, PackageID, anyerror) void;
+ const SuccessFn = *const fn (*PackageManager, PackageID, PackageID) void;
+ const FailFn = *const fn (*PackageManager, Dependency, PackageID, anyerror) void;
fn assignResolution(this: *PackageManager, dependency_id: PackageID, package_id: PackageID) void {
this.lockfile.buffers.resolutions.items[dependency_id] = package_id;
}
@@ -2387,6 +2393,7 @@ pub const PackageManager = struct {
) *ThreadPool.Task {
var task = this.allocator.create(Task) catch unreachable;
task.* = Task{
+ .package_manager = &PackageManager.instance, // https://github.com/ziglang/zig/issues/14005
.log = logger.Log.init(this.allocator),
.tag = Task.Tag.package_manifest,
.request = .{
@@ -2408,6 +2415,7 @@ pub const PackageManager = struct {
) *ThreadPool.Task {
var task = this.allocator.create(Task) catch unreachable;
task.* = Task{
+ .package_manager = &PackageManager.instance, // https://github.com/ziglang/zig/issues/14005
.log = logger.Log.init(this.allocator),
.tag = Task.Tag.extract,
.request = .{
@@ -2459,7 +2467,8 @@ pub const PackageManager = struct {
var tmpfile = FileSystem.RealFS.Tmpfile{};
var secret: [32]u8 = undefined;
std.mem.writeIntNative(u64, secret[0..8], @intCast(u64, std.time.milliTimestamp()));
- var rng = std.rand.Xoodoo.init(secret).random();
+ var state = std.rand.Xoodoo.init(secret);
+ const rng = state.random();
var base64_bytes: [64]u8 = undefined;
rng.bytes(&base64_bytes);
@@ -2484,7 +2493,7 @@ pub const PackageManager = struct {
_ = C.fchmod(
tmpfile.fd,
// chmod 666,
- 0000040 | 0000004 | 0000002 | 0000400 | 0000200 | 0000020,
+ 0o0000040 | 0o0000004 | 0o0000002 | 0o0000400 | 0o0000200 | 0o0000020,
);
try tmpfile.promote(tmpname, std.fs.cwd().fd, "yarn.lock");
@@ -2696,6 +2705,7 @@ pub const PackageManager = struct {
var network_task = this.getNetworkTask();
network_task.* = NetworkTask{
+ .package_manager = &PackageManager.instance, // https://github.com/ziglang/zig/issues/14005
.callback = undefined,
.task_id = task_id,
.allocator = this.allocator,
@@ -2735,7 +2745,7 @@ pub const PackageManager = struct {
successFn,
) catch |err| brk: {
if (err == error.MissingPackageJSON) {
- break :brk null;
+ break :brk @as(?ResolvedPackageResult, null);
}
return err;
@@ -3146,7 +3156,7 @@ pub const PackageManager = struct {
if (comptime log_level.isVerbose()) {
Output.prettyError(" ", .{});
- Output.printElapsed(@floatCast(f64, @intToFloat(f128, task.http.elapsed) / std.time.ns_per_ms));
+ Output.printElapsed(@intToFloat(f64, task.http.elapsed) / std.time.ns_per_ms);
Output.prettyError("\n <d>Downloaded <r><green>{s}<r> versions\n", .{name.slice()});
Output.flush();
}
@@ -3158,7 +3168,7 @@ pub const PackageManager = struct {
entry.value_ptr.* = manifest;
if (timestamp_this_tick == null) {
- timestamp_this_tick = @truncate(u32, @intCast(u64, @maximum(0, std.time.timestamp()))) +| 300;
+ timestamp_this_tick = @truncate(u32, @intCast(u64, @max(0, std.time.timestamp()))) +| 300;
}
entry.value_ptr.*.pkg.public_max_age = timestamp_this_tick.?;
@@ -3268,7 +3278,7 @@ pub const PackageManager = struct {
if (comptime log_level.isVerbose()) {
Output.prettyError(" ", .{});
- Output.printElapsed(@floatCast(f64, @intToFloat(f128, task.http.elapsed) / std.time.ns_per_ms));
+ Output.printElapsed(@floatCast(f64, @intToFloat(f64, task.http.elapsed) / std.time.ns_per_ms));
Output.prettyError(" <d>Downloaded <r><green>{s}<r> tarball\n", .{extract.name.slice()});
Output.flush();
}
@@ -3444,7 +3454,7 @@ pub const PackageManager = struct {
log_level: LogLevel = LogLevel.default,
global: bool = false,
- global_bin_dir: std.fs.Dir = std.fs.Dir{ .fd = std.math.maxInt(std.os.fd_t) },
+ global_bin_dir: std.fs.IterableDir = std.fs.IterableDir{ .dir = .{ .fd = std.math.maxInt(std.os.fd_t) } },
explicit_global_directory: string = "",
/// destination directory to link bins into
// must be a variable due to global installs and bunx
@@ -3523,41 +3533,41 @@ pub const PackageManager = struct {
optional: bool = false,
};
- pub fn openGlobalDir(explicit_global_dir: string) !std.fs.Dir {
+ pub fn openGlobalDir(explicit_global_dir: string) !std.fs.IterableDir {
if (bun.getenvZ("BUN_INSTALL_GLOBAL_DIR")) |home_dir| {
- return try std.fs.cwd().makeOpenPath(home_dir, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(home_dir, .{});
}
if (explicit_global_dir.len > 0) {
- return try std.fs.cwd().makeOpenPath(explicit_global_dir, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(explicit_global_dir, .{});
}
if (bun.getenvZ("BUN_INSTALL")) |home_dir| {
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var parts = [_]string{ "install", "global" };
var path = Path.joinAbsStringBuf(home_dir, &buf, &parts, .auto);
- return try std.fs.cwd().makeOpenPath(path, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(path, .{});
}
if (bun.getenvZ("XDG_CACHE_HOME") orelse bun.getenvZ("HOME")) |home_dir| {
var buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var parts = [_]string{ ".bun", "install", "global" };
var path = Path.joinAbsStringBuf(home_dir, &buf, &parts, .auto);
- return try std.fs.cwd().makeOpenPath(path, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(path, .{});
}
return error.@"No global directory found";
}
- pub fn openGlobalBinDir(opts_: ?*const Api.BunInstall) !std.fs.Dir {
+ pub fn openGlobalBinDir(opts_: ?*const Api.BunInstall) !std.fs.IterableDir {
if (bun.getenvZ("BUN_INSTALL_BIN")) |home_dir| {
- return try std.fs.cwd().makeOpenPath(home_dir, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(home_dir, .{});
}
if (opts_) |opts| {
if (opts.global_bin_dir) |home_dir| {
if (home_dir.len > 0) {
- return try std.fs.cwd().makeOpenPath(home_dir, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(home_dir, .{});
}
}
}
@@ -3568,7 +3578,7 @@ pub const PackageManager = struct {
"bin",
};
var path = Path.joinAbsStringBuf(home_dir, &buf, &parts, .auto);
- return try std.fs.cwd().makeOpenPath(path, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(path, .{});
}
if (bun.getenvZ("XDG_CACHE_HOME") orelse bun.getenvZ("HOME")) |home_dir| {
@@ -3578,7 +3588,7 @@ pub const PackageManager = struct {
"bin",
};
var path = Path.joinAbsStringBuf(home_dir, &buf, &parts, .auto);
- return try std.fs.cwd().makeOpenPath(path, .{ .iterate = true });
+ return try std.fs.cwd().makeOpenPathIterable(path, .{});
}
return error.@"Missing global bin directory: try setting $BUN_INSTALL";
@@ -3778,7 +3788,7 @@ pub const PackageManager = struct {
if (env_loader.map.get("BUN_CONFIG_HTTP_RETRY_COUNT")) |retry_count| {
if (std.fmt.parseInt(i32, retry_count, 10)) |int| {
- this.max_retry_count = @intCast(u16, @minimum(@maximum(int, 0), 65355));
+ this.max_retry_count = @intCast(u16, @min(@max(int, 0), 65355));
} else |_| {}
}
@@ -4199,7 +4209,7 @@ pub const PackageManager = struct {
explicit_global_dir = opts.global_dir orelse explicit_global_dir;
}
var global_dir = try Options.openGlobalDir(explicit_global_dir);
- try global_dir.setAsCwd();
+ try global_dir.dir.setAsCwd();
}
var fs = try Fs.FileSystem.init1(ctx.allocator, null);
@@ -4282,7 +4292,7 @@ pub const PackageManager = struct {
if (env_loader.map.get("GOMAXPROCS")) |max_procs| {
if (std.fmt.parseInt(u32, max_procs, 10)) |cpu_count_| {
- cpu_count = @minimum(cpu_count, cpu_count_);
+ cpu_count = @min(cpu_count, cpu_count_);
} else |_| {}
}
@@ -4335,7 +4345,7 @@ pub const PackageManager = struct {
ctx.install,
);
- manager.timestamp_for_manifest_cache_control = @truncate(u32, @intCast(u64, @maximum(std.time.timestamp(), 0)));
+ manager.timestamp_for_manifest_cache_control = @truncate(u32, @intCast(u64, @max(std.time.timestamp(), 0)));
return manager;
}
@@ -4354,7 +4364,7 @@ pub const PackageManager = struct {
if (env_loader.map.get("GOMAXPROCS")) |max_procs| {
if (std.fmt.parseInt(u32, max_procs, 10)) |cpu_count_| {
- cpu_count = @minimum(cpu_count, cpu_count_);
+ cpu_count = @min(cpu_count, cpu_count_);
} else |_| {}
}
@@ -4421,7 +4431,7 @@ pub const PackageManager = struct {
u32,
@intCast(
u64,
- @maximum(
+ @max(
std.time.timestamp(),
0,
),
@@ -4540,7 +4550,7 @@ pub const PackageManager = struct {
}
// Step 2. Setup the global directory
- var node_modules: std.fs.Dir = brk: {
+ var node_modules: std.fs.IterableDir = brk: {
Bin.Linker.umask = C.umask(0);
var explicit_global_dir: string = "";
if (ctx.install) |install_| {
@@ -4550,7 +4560,7 @@ pub const PackageManager = struct {
try manager.setupGlobalDir(&ctx);
- break :brk manager.global_dir.?.makeOpenPath("node_modules", .{ .iterate = true }) catch |err| {
+ break :brk manager.global_dir.?.dir.makeOpenPathIterable("node_modules", .{}) catch |err| {
if (manager.options.log_level != .silent)
Output.prettyErrorln("<r><red>error:<r> failed to create node_modules in global dir due to error {s}", .{@errorName(err)});
Global.crash();
@@ -4560,10 +4570,10 @@ pub const PackageManager = struct {
// Step 3a. symlink to the node_modules folder
{
// delete it if it exists
- node_modules.deleteTree(name) catch {};
+ node_modules.dir.deleteTree(name) catch {};
// create the symlink
- node_modules.symLink(Fs.FileSystem.instance.topLevelDirWithoutTrailingSlash(), name, .{ .is_directory = true }) catch |err| {
+ node_modules.dir.symLink(Fs.FileSystem.instance.topLevelDirWithoutTrailingSlash(), name, .{ .is_directory = true }) catch |err| {
if (manager.options.log_level != .silent)
Output.prettyErrorln("<r><red>error:<r> failed to create symlink to node_modules in global dir due to error {s}", .{@errorName(err)});
Global.crash();
@@ -4574,12 +4584,12 @@ pub const PackageManager = struct {
if (package.bin.tag != .none) {
var bin_linker = Bin.Linker{
.bin = package.bin,
- .package_installed_node_modules = node_modules.fd,
+ .package_installed_node_modules = node_modules.dir.fd,
.global_bin_path = manager.options.bin_path,
- .global_bin_dir = manager.options.global_bin_dir,
+ .global_bin_dir = manager.options.global_bin_dir.dir,
// .destination_dir_subpath = destination_dir_subpath,
- .root_node_modules_folder = node_modules.fd,
+ .root_node_modules_folder = node_modules.dir.fd,
.package_name = strings.StringOrTinyString.init(name),
.string_buf = lockfile.buffers.string_bytes.items,
.extern_string_buf = lockfile.buffers.extern_strings.items,
@@ -4703,7 +4713,7 @@ pub const PackageManager = struct {
}
// Step 2. Setup the global directory
- var node_modules: std.fs.Dir = brk: {
+ var node_modules: std.fs.IterableDir = brk: {
Bin.Linker.umask = C.umask(0);
var explicit_global_dir: string = "";
if (ctx.install) |install_| {
@@ -4713,7 +4723,7 @@ pub const PackageManager = struct {
try manager.setupGlobalDir(&ctx);
- break :brk manager.global_dir.?.makeOpenPath("node_modules", .{ .iterate = true }) catch |err| {
+ break :brk manager.global_dir.?.dir.makeOpenPathIterable("node_modules", .{}) catch |err| {
if (manager.options.log_level != .silent)
Output.prettyErrorln("<r><red>error:<r> failed to create node_modules in global dir due to error {s}", .{@errorName(err)});
Global.crash();
@@ -4724,12 +4734,12 @@ pub const PackageManager = struct {
if (package.bin.tag != .none) {
var bin_linker = Bin.Linker{
.bin = package.bin,
- .package_installed_node_modules = node_modules.fd,
+ .package_installed_node_modules = node_modules.dir.fd,
.global_bin_path = manager.options.bin_path,
- .global_bin_dir = manager.options.global_bin_dir,
+ .global_bin_dir = manager.options.global_bin_dir.dir,
// .destination_dir_subpath = destination_dir_subpath,
- .root_node_modules_folder = node_modules.fd,
+ .root_node_modules_folder = node_modules.dir.fd,
.package_name = strings.StringOrTinyString.init(name),
.string_buf = lockfile.buffers.string_bytes.items,
.extern_string_buf = lockfile.buffers.extern_strings.items,
@@ -4738,7 +4748,7 @@ pub const PackageManager = struct {
}
// delete it if it exists
- node_modules.deleteTree(name) catch |err| {
+ node_modules.dir.deleteTree(name) catch |err| {
if (manager.options.log_level != .silent)
Output.prettyErrorln("<r><red>error:<r> failed to unlink package in global dir due to error {s}", .{@errorName(err)});
Global.crash();
@@ -5475,14 +5485,12 @@ pub const PackageManager = struct {
// This is where we clean dangling symlinks
// This could be slow if there are a lot of symlinks
- if (cwd.openDirZ(manager.options.bin_path, .{
- .iterate = true,
- })) |node_modules_bin_| {
- var node_modules_bin: std.fs.Dir = node_modules_bin_;
- var iter: std.fs.Dir.Iterator = node_modules_bin.iterate();
+ if (cwd.openIterableDir(manager.options.bin_path, .{})) |node_modules_bin_| {
+ var node_modules_bin: std.fs.IterableDir = node_modules_bin_;
+ var iter: std.fs.IterableDir.Iterator = node_modules_bin.iterate();
iterator: while (iter.next() catch null) |entry| {
switch (entry.kind) {
- std.fs.Dir.Entry.Kind.SymLink => {
+ std.fs.IterableDir.Entry.Kind.SymLink => {
// any symlinks which we are unable to open are assumed to be dangling
// note that using access won't work here, because access doesn't resolve symlinks
@@ -5490,8 +5498,8 @@ pub const PackageManager = struct {
node_modules_buf[entry.name.len] = 0;
var buf: [:0]u8 = node_modules_buf[0..entry.name.len :0];
- var file = node_modules_bin.openFileZ(buf, .{ .mode = .read_only }) catch {
- node_modules_bin.deleteFileZ(buf) catch {};
+ var file = node_modules_bin.dir.openFileZ(buf, .{ .mode = .read_only }) catch {
+ node_modules_bin.dir.deleteFileZ(buf) catch {};
continue :iterator;
};
@@ -5545,11 +5553,11 @@ pub const PackageManager = struct {
manager: *PackageManager,
lockfile: *Lockfile,
progress: *std.Progress,
- node_modules_folder: std.fs.Dir,
+ node_modules_folder: std.fs.IterableDir,
skip_verify_installed_version_number: bool,
skip_delete: bool,
force_install: bool,
- root_node_modules_folder: std.fs.Dir,
+ root_node_modules_folder: std.fs.IterableDir,
summary: *PackageInstall.Summary,
options: *const PackageManager.Options,
metas: []const Lockfile.Package.Meta,
@@ -5558,7 +5566,7 @@ pub const PackageManager = struct {
resolutions: []Resolution,
node: *Progress.Node,
has_created_bin: bool = false,
- global_bin_dir: std.fs.Dir,
+ global_bin_dir: std.fs.IterableDir,
destination_dir_subpath_buf: [bun.MAX_PATH_BYTES]u8 = undefined,
folder_path_buf: [bun.MAX_PATH_BYTES]u8 = undefined,
install_count: usize = 0,
@@ -5571,7 +5579,7 @@ pub const PackageManager = struct {
pub const DeferredBinLink = struct {
package_id: PackageID,
- node_modules_folder: std.fs.Dir,
+ node_modules_folder: std.fs.IterableDir,
};
/// Install versions of a package which are waiting on a network request
@@ -5597,7 +5605,7 @@ pub const PackageManager = struct {
defer this.node_modules_folder = prev_node_modules_folder;
for (callbacks.items) |cb| {
const node_modules_folder = cb.node_modules_folder;
- this.node_modules_folder = std.fs.Dir{ .fd = @intCast(std.os.fd_t, node_modules_folder) };
+ this.node_modules_folder = .{ .dir = .{ .fd = @intCast(bun.FileDescriptor, node_modules_folder) } };
this.installPackageWithNameAndResolution(package_id, log_level, name, resolution);
}
}
@@ -5641,12 +5649,12 @@ pub const PackageManager = struct {
// "mineflayer": "file:."
if (folder.len == 0 or (folder.len == 1 and folder[0] == '.')) {
installer.cache_dir_subpath = ".";
- installer.cache_dir = std.fs.cwd();
+ installer.cache_dir = .{ .dir = std.fs.cwd() };
} else {
@memcpy(&this.folder_path_buf, folder.ptr, folder.len);
this.folder_path_buf[folder.len] = 0;
installer.cache_dir_subpath = std.meta.assumeSentinel(this.folder_path_buf[0..folder.len], 0);
- installer.cache_dir = std.fs.cwd();
+ installer.cache_dir = .{ .dir = std.fs.cwd() };
}
},
.symlink => {
@@ -5679,7 +5687,7 @@ pub const PackageManager = struct {
if (folder.len == 0 or (folder.len == 1 and folder[0] == '.')) {
installer.cache_dir_subpath = ".";
- installer.cache_dir = std.fs.cwd();
+ installer.cache_dir = .{ .dir = std.fs.cwd() };
} else {
const global_link_dir = this.manager.globalLinkDirPath() catch unreachable;
var ptr = &this.folder_path_buf;
@@ -5727,7 +5735,7 @@ pub const PackageManager = struct {
if (!this.has_created_bin) {
Bin.Linker.umask = C.umask(0);
if (!this.options.global)
- this.node_modules_folder.makeDirZ(".bin") catch {};
+ this.node_modules_folder.dir.makeDirZ(".bin") catch {};
this.has_created_bin = true;
}
@@ -5746,12 +5754,12 @@ pub const PackageManager = struct {
var bin_linker = Bin.Linker{
.bin = bin,
- .package_installed_node_modules = this.node_modules_folder.fd,
+ .package_installed_node_modules = this.node_modules_folder.dir.fd,
.global_bin_path = this.options.bin_path,
- .global_bin_dir = this.options.global_bin_dir,
+ .global_bin_dir = this.options.global_bin_dir.dir,
// .destination_dir_subpath = destination_dir_subpath,
- .root_node_modules_folder = this.root_node_modules_folder.fd,
+ .root_node_modules_folder = this.root_node_modules_folder.dir.fd,
.package_name = strings.StringOrTinyString.init(name),
.string_buf = buf,
.extern_string_buf = extern_string_buf,
@@ -5794,7 +5802,7 @@ pub const PackageManager = struct {
resolution.value.npm.version,
resolution.value.npm.url.slice(buf),
.{
- .node_modules_folder = @intCast(u32, this.node_modules_folder.fd),
+ .node_modules_folder = @intCast(u32, this.node_modules_folder.dir.fd),
},
);
},
@@ -5917,13 +5925,13 @@ pub const PackageManager = struct {
// we want to check lazily though
// no need to download packages you've already installed!!
var skip_verify_installed_version_number = false;
- var node_modules_folder = std.fs.cwd().openDirZ("node_modules", .{ .iterate = true }) catch brk: {
+ var node_modules_folder = std.fs.cwd().openIterableDir("node_modules", .{}) catch brk: {
skip_verify_installed_version_number = true;
std.fs.cwd().makeDirZ("node_modules") catch |err| {
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> creating <b>node_modules<r> folder", .{@errorName(err)});
Global.crash();
};
- break :brk std.fs.cwd().openDirZ("node_modules", .{ .iterate = true }) catch |err| {
+ break :brk std.fs.cwd().openIterableDir("node_modules", .{}) catch |err| {
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> opening <b>node_modules<r> folder", .{@errorName(err)});
Global.crash();
};
@@ -5982,9 +5990,7 @@ pub const PackageManager = struct {
// We deliberately do not close this folder.
// If the package hasn't been downloaded, we will need to install it later
// We use this file descriptor to know where to put it.
- var folder = try cwd.openDirZ(node_modules.relative_path, .{
- .iterate = true,
- });
+ var folder = try cwd.openIterableDir(node_modules.relative_path, .{});
installer.node_modules_folder = folder;
@@ -6078,7 +6084,7 @@ pub const PackageManager = struct {
if (!installer.has_created_bin) {
if (!this.options.global) {
- node_modules_folder.makeDirZ(".bin") catch {};
+ node_modules_folder.dir.makeDirZ(".bin") catch {};
}
Bin.Linker.umask = C.umask(0);
installer.has_created_bin = true;
@@ -6086,10 +6092,10 @@ pub const PackageManager = struct {
var bin_linker = Bin.Linker{
.bin = original_bin,
- .package_installed_node_modules = folder.fd,
- .root_node_modules_folder = node_modules_folder.fd,
+ .package_installed_node_modules = folder.dir.fd,
+ .root_node_modules_folder = node_modules_folder.dir.fd,
.global_bin_path = this.options.bin_path,
- .global_bin_dir = this.options.global_bin_dir,
+ .global_bin_dir = this.options.global_bin_dir.dir,
.package_name = strings.StringOrTinyString.init(name),
.string_buf = lockfile.buffers.string_bytes.items,
@@ -6145,7 +6151,7 @@ pub const PackageManager = struct {
pub fn setupGlobalDir(manager: *PackageManager, ctx: *const Command.Context) !void {
manager.options.global_bin_dir = try Options.openGlobalBinDir(ctx.install);
var out_buffer: [bun.MAX_PATH_BYTES]u8 = undefined;
- var result = try std.os.getFdPath(manager.options.global_bin_dir.fd, &out_buffer);
+ var result = try std.os.getFdPath(manager.options.global_bin_dir.dir.fd, &out_buffer);
out_buffer[result.len] = 0;
var result_: [:0]u8 = out_buffer[0..result.len :0];
manager.options.bin_path = std.meta.assumeSentinel(try FileSystem.instance.dirname_store.append([:0]u8, result_), 0);
@@ -6191,7 +6197,7 @@ pub const PackageManager = struct {
manager.options.lockfile_path,
)
else
- Lockfile.LoadFromDiskResult{ .not_found = .{} };
+ Lockfile.LoadFromDiskResult{ .not_found = {} };
var root = Lockfile.Package{};
var maybe_root: Lockfile.Package = undefined;
@@ -6632,7 +6638,7 @@ pub const PackageManager = struct {
if (install_summary.success > 0) {
// it's confusing when it shows 3 packages and says it installed 1
- Output.pretty("\n <green>{d}<r> packages<r> installed ", .{@maximum(
+ Output.pretty("\n <green>{d}<r> packages<r> installed ", .{@max(
install_summary.success,
@truncate(
u32,
@@ -6706,7 +6712,7 @@ pub const PackageManager = struct {
// bun install may have installed new bins, so we need to update the PATH
// this can happen if node_modules/.bin didn't previously exist
// note: it is harmless to have the same directory in the PATH multiple times
- const current_path = manager.env.map.get("PATH");
+ const current_path = manager.env.map.get("PATH") orelse "";
// TODO: windows
const cwd_without_trailing_slash = if (Fs.FileSystem.instance.top_level_dir.len > 1 and Fs.FileSystem.instance.top_level_dir[Fs.FileSystem.instance.top_level_dir.len - 1] == '/')
diff --git a/src/install/integrity.zig b/src/install/integrity.zig
index 3d3ab41c4..e54d9b7e1 100644
--- a/src/install/integrity.zig
+++ b/src/install/integrity.zig
@@ -20,7 +20,7 @@ pub const Integrity = extern struct {
var value: usize = 0;
for (values) |val| {
- value = @maximum(val, value);
+ value = @max(val, value);
}
break :brk value;
@@ -36,7 +36,7 @@ pub const Integrity = extern struct {
// e.g. "3cd0599b099384b815c10f7fa7df0092b62d534f"
var integrity = Integrity{ .tag = Tag.sha1 };
- const end: usize = @minimum("3cd0599b099384b815c10f7fa7df0092b62d534f".len, buf.len);
+ const end: usize = @min("3cd0599b099384b815c10f7fa7df0092b62d534f".len, buf.len);
var out_i: usize = 0;
var i: usize = 0;
@@ -117,7 +117,7 @@ pub const Integrity = extern struct {
pub fn parse(buf: []const u8) Tag {
const Matcher = strings.ExactSizeMatcher(8);
- const i = std.mem.indexOfScalar(u8, buf[0..@minimum(buf.len, 7)], '-') orelse return Tag.unknown;
+ const i = std.mem.indexOfScalar(u8, buf[0..@min(buf.len, 7)], '-') orelse return Tag.unknown;
return switch (Matcher.match(buf[0..i])) {
Matcher.case("sha1") => Tag.sha1,
@@ -167,7 +167,7 @@ pub const Integrity = extern struct {
}
pub fn verify(this: *const Integrity, bytes: []const u8) bool {
- return @call(.{ .modifier = .always_inline }, verifyByTag, .{ this.tag, bytes, &this.value });
+ return @call(.always_inline, verifyByTag, .{ this.tag, bytes, &this.value });
}
pub fn verifyByTag(tag: Tag, bytes: []const u8, sum: []const u8) bool {
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index 8e90eb58a..93d81e18e 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -171,7 +171,7 @@ pub fn loadFromDisk(this: *Lockfile, allocator: std.mem.Allocator, log: *logger.
if (filename.len > 0)
file = std.fs.cwd().openFileZ(filename, .{ .mode = .read_only }) catch |err| {
return switch (err) {
- error.FileNotFound, error.AccessDenied, error.BadPathName => LoadFromDiskResult{ .not_found = .{} },
+ error.FileNotFound, error.AccessDenied, error.BadPathName => LoadFromDiskResult{ .not_found = {} },
else => LoadFromDiskResult{ .err = .{ .step = .open_file, .value = err } },
};
};
@@ -1438,7 +1438,7 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
_ = C.fchmod(
tmpfile.fd,
// chmod 777
- 0000010 | 0000100 | 0000001 | 0001000 | 0000040 | 0000004 | 0000002 | 0000400 | 0000200 | 0000020,
+ 0o0000010 | 0o0000100 | 0o0000001 | 0o0001000 | 0o0000040 | 0o0000004 | 0o0000002 | 0o0000400 | 0o0000200 | 0o0000020,
);
tmpfile.promote(tmpname, std.fs.cwd().fd, filename) catch |err| {
@@ -1687,7 +1687,7 @@ pub const StringBuilder = struct {
}
pub fn append(this: *StringBuilder, comptime Type: type, slice: string) Type {
- return @call(.{ .modifier = .always_inline }, appendWithHash, .{ this, Type, slice, stringHash(slice) });
+ return @call(.always_inline, appendWithHash, .{ this, Type, slice, stringHash(slice) });
}
// SlicedString is not supported due to inline strings.
@@ -2566,7 +2566,7 @@ pub const Package = extern struct {
} else {
package.resolution = .{
.tag = .root,
- .value = .{ .root = .{} },
+ .value = .{ .root = {} },
};
}
@@ -2617,12 +2617,12 @@ pub const Package = extern struct {
break :bin;
},
- .e_string => |str| {
- if (str.data.len > 0) {
+ .e_string => |stri| {
+ if (stri.data.len > 0) {
package.bin = Bin{
.tag = Bin.Tag.file,
.value = .{
- .file = string_builder.append(String, str.data),
+ .file = string_builder.append(String, stri.data),
},
};
break :bin;
@@ -2829,10 +2829,10 @@ pub const Package = extern struct {
var data: [fields.len]Data = undefined;
for (fields) |field_info, i| {
data[i] = .{
- .size = @sizeOf(field_info.field_type),
+ .size = @sizeOf(field_info.type),
.size_index = i,
- .Type = field_info.field_type,
- .alignment = if (@sizeOf(field_info.field_type) == 0) 1 else field_info.alignment,
+ .Type = field_info.type,
+ .alignment = if (@sizeOf(field_info.type) == 0) 1 else field_info.alignment,
};
}
const Sort = struct {
@@ -2977,16 +2977,16 @@ const Buffers = struct {
const Data = struct {
size: usize,
name: []const u8,
- field_type: type,
+ type: type,
alignment: usize,
};
var data: [fields.len]Data = undefined;
for (fields) |field_info, i| {
data[i] = .{
- .size = @sizeOf(field_info.field_type),
+ .size = @sizeOf(field_info.type),
.name = field_info.name,
- .alignment = if (@sizeOf(field_info.field_type) == 0) 1 else field_info.alignment,
- .field_type = field_info.field_type.Slice,
+ .alignment = if (@sizeOf(field_info.type) == 0) 1 else field_info.alignment,
+ .type = field_info.type.Slice,
};
}
const Sort = struct {
@@ -3003,7 +3003,7 @@ const Buffers = struct {
for (data) |elem, i| {
sizes_bytes[i] = elem.size;
names[i] = elem.name;
- types[i] = elem.field_type;
+ types[i] = elem.type;
}
break :blk .{
.bytes = sizes_bytes,
diff --git a/src/install/npm.zig b/src/install/npm.zig
index 60ffefdbb..ca1472039 100644
--- a/src/install/npm.zig
+++ b/src/install/npm.zig
@@ -1,4 +1,5 @@
const URL = @import("../url.zig").URL;
+const bun = @import("bun");
const std = @import("std");
const MutableString = @import("../string_mutable.zig").MutableString;
const Semver = @import("./semver.zig");
@@ -163,7 +164,7 @@ pub const Registry = struct {
switch (response.status_code) {
400 => return error.BadRequest,
429 => return error.TooManyRequests,
- 404 => return PackageVersionResponse{ .not_found = .{} },
+ 404 => return PackageVersionResponse{ .not_found = {} },
500...599 => return error.HTTPInternalServerError,
304 => return PackageVersionResponse{
.cached = loaded_manifest.?,
@@ -203,7 +204,7 @@ pub const Registry = struct {
package_name,
newly_last_modified,
new_etag,
- @truncate(u32, @intCast(u64, @maximum(0, std.time.timestamp()))) + 300,
+ @truncate(u32, @intCast(u64, @max(0, std.time.timestamp()))) + 300,
)) |package| {
if (package_manager.options.enable.manifest_cache) {
PackageManifest.Serializer.save(&package, package_manager.getTemporaryDirectory(), package_manager.getCacheDirectory()) catch {};
@@ -459,9 +460,9 @@ pub const PackageManifest = struct {
var data: [fields.len]Data = undefined;
for (fields) |field_info, i| {
data[i] = .{
- .size = @sizeOf(field_info.field_type),
+ .size = @sizeOf(field_info.type),
.name = field_info.name,
- .alignment = if (@sizeOf(field_info.field_type) == 0) 1 else field_info.alignment,
+ .alignment = if (@sizeOf(field_info.type) == 0) 1 else field_info.alignment,
};
}
const Sort = struct {
@@ -536,8 +537,8 @@ pub const PackageManifest = struct {
}
}
- fn writeFile(this: *const PackageManifest, tmp_path: [:0]const u8, tmpdir: std.fs.Dir) !void {
- var tmpfile = try tmpdir.createFileZ(tmp_path, .{
+ fn writeFile(this: *const PackageManifest, tmp_path: [:0]const u8, tmpdir: std.fs.IterableDir) !void {
+ var tmpfile = try tmpdir.dir.createFileZ(tmp_path, .{
.truncate = true,
});
defer tmpfile.close();
@@ -545,25 +546,29 @@ pub const PackageManifest = struct {
try Serializer.write(this, @TypeOf(writer), writer);
}
- pub fn save(this: *const PackageManifest, tmpdir: std.fs.Dir, cache_dir: std.fs.Dir) !void {
+ pub fn save(this: *const PackageManifest, tmpdir: std.fs.IterableDir, cache_dir: std.fs.IterableDir) !void {
const file_id = std.hash.Wyhash.hash(0, this.name());
var dest_path_buf: [512 + 64]u8 = undefined;
var out_path_buf: ["-18446744073709551615".len + ".npm".len + 1]u8 = undefined;
var dest_path_stream = std.io.fixedBufferStream(&dest_path_buf);
var dest_path_stream_writer = dest_path_stream.writer();
- try dest_path_stream_writer.print("{x}.npm-{x}", .{ file_id, @maximum(std.time.milliTimestamp(), 0) });
+ const hex_fmt = bun.fmt.hexIntLower(file_id);
+ const hex_timestamp = @intCast(usize, @max(std.time.milliTimestamp(), 0));
+ const hex_timestamp_fmt = bun.fmt.hexIntLower(hex_timestamp);
+ try dest_path_stream_writer.print("{any}.npm-{any}", .{ hex_fmt, hex_timestamp_fmt });
try dest_path_stream_writer.writeByte(0);
var tmp_path: [:0]u8 = dest_path_buf[0 .. dest_path_stream.pos - 1 :0];
try writeFile(this, tmp_path, tmpdir);
- var out_path = std.fmt.bufPrintZ(&out_path_buf, "{x}.npm", .{file_id}) catch unreachable;
- try std.os.renameatZ(tmpdir.fd, tmp_path, cache_dir.fd, out_path);
+ var out_path = std.fmt.bufPrintZ(&out_path_buf, "{any}.npm", .{hex_fmt}) catch unreachable;
+ try std.os.renameatZ(tmpdir.dir.fd, tmp_path, cache_dir.dir.fd, out_path);
}
- pub fn load(allocator: std.mem.Allocator, cache_dir: std.fs.Dir, package_name: string) !?PackageManifest {
+ pub fn load(allocator: std.mem.Allocator, cache_dir: std.fs.IterableDir, package_name: string) !?PackageManifest {
const file_id = std.hash.Wyhash.hash(0, package_name);
var file_path_buf: [512 + 64]u8 = undefined;
- var file_path = try std.fmt.bufPrintZ(&file_path_buf, "{x}.npm", .{file_id});
- var cache_file = cache_dir.openFileZ(
+ const hex_fmt = bun.fmt.hexIntLower(file_id);
+ var file_path = try std.fmt.bufPrintZ(&file_path_buf, "{any}.npm", .{hex_fmt});
+ var cache_file = cache_dir.dir.openFileZ(
file_path,
.{ .mode = .read_only },
) catch return null;
@@ -931,13 +936,13 @@ pub const PackageManifest = struct {
string_builder.count(etag);
}
- var versioned_packages = try allocator.allocAdvanced(PackageVersion, null, release_versions_len + pre_versions_len, .exact);
- var all_semver_versions = try allocator.allocAdvanced(Semver.Version, null, release_versions_len + pre_versions_len + dist_tags_count, .exact);
- var all_extern_strings = try allocator.allocAdvanced(ExternalString, null, extern_string_count + tarball_urls_count, .exact);
- var version_extern_strings = try allocator.allocAdvanced(ExternalString, null, dependency_sum, .exact);
- var extern_strings_bin_entries = try allocator.allocAdvanced(ExternalString, null, extern_string_count_bin, .exact);
+ var versioned_packages = try allocator.alloc(PackageVersion, release_versions_len + pre_versions_len);
+ var all_semver_versions = try allocator.alloc(Semver.Version, release_versions_len + pre_versions_len + dist_tags_count);
+ var all_extern_strings = try allocator.alloc(ExternalString, extern_string_count + tarball_urls_count);
+ var version_extern_strings = try allocator.alloc(ExternalString, dependency_sum);
+ var extern_strings_bin_entries = try allocator.alloc(ExternalString, extern_string_count_bin);
var all_extern_strings_bin_entries = extern_strings_bin_entries;
- var all_tarball_url_strings = try allocator.allocAdvanced(ExternalString, null, tarball_urls_count, .exact);
+ var all_tarball_url_strings = try allocator.alloc(ExternalString, tarball_urls_count);
var tarball_url_strings = all_tarball_url_strings;
if (versioned_packages.len > 0) {
@@ -1040,8 +1045,8 @@ pub const PackageManifest = struct {
}
}
},
- .e_string => |str| {
- package_version.cpu = Architecture.apply(Architecture.none, str.data);
+ .e_string => |stri| {
+ package_version.cpu = Architecture.apply(Architecture.none, stri.data);
},
else => {},
}
@@ -1062,8 +1067,8 @@ pub const PackageManifest = struct {
}
}
},
- .e_string => |str| {
- package_version.os = OperatingSystem.apply(OperatingSystem.none, str.data);
+ .e_string => |stri| {
+ package_version.os = OperatingSystem.apply(OperatingSystem.none, stri.data);
},
else => {},
}
@@ -1127,12 +1132,12 @@ pub const PackageManifest = struct {
break :bin;
},
- .e_string => |str| {
- if (str.data.len > 0) {
+ .e_string => |stri| {
+ if (stri.data.len > 0) {
package_version.bin = Bin{
.tag = Bin.Tag.file,
.value = .{
- .file = string_builder.append(String, str.data),
+ .file = string_builder.append(String, stri.data),
},
};
break :bin;
diff --git a/src/install/resolution.zig b/src/install/resolution.zig
index baf31b2ad..d21855d7c 100644
--- a/src/install/resolution.zig
+++ b/src/install/resolution.zig
@@ -7,11 +7,11 @@ const Repository = @import("./repository.zig").Repository;
const string = @import("../string_types.zig").string;
const ExtractTarball = @import("./extract_tarball.zig");
const strings = @import("../string_immutable.zig");
-const VersionedURL = @import("./versioned_url.zig");
+const VersionedURL = @import("./versioned_url.zig").VersionedURL;
pub const Resolution = extern struct {
tag: Tag = Tag.uninitialized,
- value: Value = Value{ .uninitialized = .{} },
+ value: Value = Value{ .uninitialized = {} },
pub fn order(
lhs: *const Resolution,
@@ -93,7 +93,7 @@ pub const Resolution = extern struct {
.gitlab => Resolution.Value{
.gitlab = this.value.gitlab.clone(buf, Builder, builder),
},
- .root => Resolution.Value{ .root = .{} },
+ .root => Resolution.Value{ .root = {} },
else => unreachable,
},
};
diff --git a/src/install/resolvers/folder_resolver.zig b/src/install/resolvers/folder_resolver.zig
index a102e22db..b25623cfe 100644
--- a/src/install/resolvers/folder_resolver.zig
+++ b/src/install/resolvers/folder_resolver.zig
@@ -134,7 +134,7 @@ pub const FolderResolution = union(Tag) {
const len = try package_json.getEndPos();
body.data.reset();
- body.data.inflate(@maximum(len, 2048)) catch unreachable;
+ body.data.inflate(@max(len, 2048)) catch unreachable;
body.data.list.expandToCapacity();
const source_buf = try package_json.readAll(body.data.list.items);
diff --git a/src/install/semver.zig b/src/install/semver.zig
index f9699e214..5722b4d4b 100644
--- a/src/install/semver.zig
+++ b/src/install/semver.zig
@@ -292,7 +292,7 @@ pub const String = extern struct {
}
pub fn append(this: *Builder, comptime Type: type, slice_: string) Type {
- return @call(.{ .modifier = .always_inline }, appendWithHash, .{ this, Type, slice_, stringHash(slice_) });
+ return @call(.always_inline, appendWithHash, .{ this, Type, slice_, stringHash(slice_) });
}
pub fn appendUTF8WithoutPool(this: *Builder, comptime Type: type, slice_: string, hash: u64) Type {
@@ -1255,11 +1255,11 @@ pub const Query = struct {
// OR
next: ?*List = null,
- pub inline fn satisfies(this: *const List, version: Version) bool {
+ pub fn satisfies(this: *const List, version: Version) bool {
return this.head.satisfies(version) or (this.next orelse return false).satisfies(version);
}
- pub inline fn eql(lhs: *const List, rhs: *const List) bool {
+ pub fn eql(lhs: *const List, rhs: *const List) bool {
if (!lhs.head.eql(&rhs.head)) return false;
var lhs_next = lhs.next orelse return rhs.next == null;
@@ -1395,7 +1395,7 @@ pub const Query = struct {
return lhs_next.eql(rhs_next);
}
- pub inline fn satisfies(this: *const Query, version: Version) bool {
+ pub fn satisfies(this: *const Query, version: Version) bool {
const left = this.range.satisfies(version);
return left and (this.next orelse return true).satisfies(version);
diff --git a/src/install/versioned_url.zig b/src/install/versioned_url.zig
index c52a64d97..bf510b545 100644
--- a/src/install/versioned_url.zig
+++ b/src/install/versioned_url.zig
@@ -1,31 +1,31 @@
const Semver = @import("./semver.zig");
const String = @import("./semver.zig").String;
-const VersionedURL = @This();
+pub const VersionedURL = extern struct {
+ url: String,
+ version: Semver.Version,
-url: String,
-version: Semver.Version,
+ pub fn eql(this: VersionedURL, other: VersionedURL) bool {
+ return this.version.eql(other.version);
+ }
-pub fn eql(this: VersionedURL, other: VersionedURL) bool {
- return this.version.eql(other.version);
-}
+ pub fn order(this: VersionedURL, other: VersionedURL, lhs_buf: []const u8, rhs_buf: []const u8) @import("std").math.Order {
+ return this.version.order(other.version, lhs_buf, rhs_buf);
+ }
-pub fn order(this: VersionedURL, other: VersionedURL, lhs_buf: []const u8, rhs_buf: []const u8) @import("std").math.Order {
- return this.version.order(other.version, lhs_buf, rhs_buf);
-}
+ pub fn fmt(this: VersionedURL, buf: []const u8) Semver.Version.Formatter {
+ return this.version.fmt(buf);
+ }
-pub fn fmt(this: VersionedURL, buf: []const u8) Semver.Version.Formatter {
- return this.version.fmt(buf);
-}
+ pub fn count(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) void {
+ this.version.count(buf, comptime Builder, builder);
+ builder.count(this.url.slice(buf));
+ }
-pub fn count(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) void {
- this.version.count(buf, comptime Builder, builder);
- builder.count(this.url.slice(buf));
-}
-
-pub fn clone(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) VersionedURL {
- return VersionedURL{
- .version = this.version.clone(buf, Builder, builder),
- .url = builder.append(String, this.url.slice(buf)),
- };
-}
+ pub fn clone(this: VersionedURL, buf: []const u8, comptime Builder: type, builder: Builder) VersionedURL {
+ return VersionedURL{
+ .version = this.version.clone(buf, Builder, builder),
+ .url = builder.append(String, this.url.slice(buf)),
+ };
+ }
+};
diff --git a/src/io/io_darwin.zig b/src/io/io_darwin.zig
index 82570edd0..b9eb59815 100644
--- a/src/io/io_darwin.zig
+++ b/src/io/io_darwin.zig
@@ -860,7 +860,7 @@ fn flush_timeouts(self: *IO) ?u64 {
const timeout_ns = expires - now;
if (min_timeout) |min_ns| {
- min_timeout = @minimum(min_ns, timeout_ns);
+ min_timeout = @min(min_ns, timeout_ns);
} else {
min_timeout = timeout_ns;
}
@@ -872,7 +872,7 @@ fn flush_timeouts(self: *IO) ?u64 {
pub const Completion = struct {
next: ?*Completion,
context: ?*anyopaque,
- callback: fn (*IO, *Completion) void,
+ callback: *const fn (*IO, *Completion) void,
operation: Operation,
};
@@ -1021,7 +1021,7 @@ pub fn event(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: void,
@@ -1047,7 +1047,7 @@ pub fn nextTick(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: void,
@@ -1070,7 +1070,7 @@ pub fn accept(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: AcceptError!os.socket_t,
@@ -1125,7 +1125,7 @@ pub fn close(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: CloseError!void,
@@ -1167,7 +1167,7 @@ pub fn connect(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: IO.ConnectError!void,
@@ -1249,7 +1249,7 @@ pub fn fsync(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: FsyncError!void,
@@ -1279,7 +1279,7 @@ pub fn open(
_: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: OpenError!fd_t,
@@ -1314,7 +1314,7 @@ pub fn read(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: ReadError!usize,
@@ -1378,7 +1378,7 @@ pub fn recv(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: RecvError!usize,
@@ -1435,7 +1435,7 @@ pub fn send(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: SendError!usize,
@@ -1491,7 +1491,7 @@ pub fn timeout(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: TimeoutError!void,
@@ -1519,7 +1519,7 @@ fn timeoutInternal(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: TimeoutError!void,
@@ -1550,7 +1550,7 @@ pub fn write(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: WriteError!usize,
@@ -1605,7 +1605,7 @@ fn buffer_limit(buffer_len: usize) usize {
.macos, .ios, .watchos, .tvos => std.math.maxInt(i32),
else => std.math.maxInt(isize),
};
- return @minimum(limit, buffer_len);
+ return @min(limit, buffer_len);
}
pub var global: IO = undefined;
diff --git a/src/io/io_linux.zig b/src/io/io_linux.zig
index 99a12a763..2339731f4 100644
--- a/src/io/io_linux.zig
+++ b/src/io/io_linux.zig
@@ -1,6 +1,6 @@
const std = @import("std");
const assert = std.debug.assert;
-const Platform = @import("bun").analytics.GenerateHeader.GeneratePlatform;
+const Platform = @import("root").bun.analytics.GenerateHeader.GeneratePlatform;
const os = struct {
pub usingnamespace std.os;
pub const EPERM = 1;
@@ -522,7 +522,7 @@ pub fn init(entries_: u12, flags: u32, waker: Waker) !IO {
}
if (limit.cur < 128 * 1024) {
- entries = @minimum(256, entries);
+ entries = @min(256, entries);
}
}
@@ -709,7 +709,7 @@ pub const Completion = struct {
// This is one of the usecases for anyopaque outside of C code and as such anyopaque will
// be replaced with anyopaque eventually: https://github.com/ziglang/zig/issues/323
context: ?*anyopaque,
- callback: fn (context: ?*anyopaque, completion: *Completion, result: *const anyopaque) void,
+ callback: *const fn (context: ?*anyopaque, completion: *Completion, result: *const anyopaque) void,
fn prep(completion: *Completion, sqe: *io_uring_sqe) void {
switch (completion.operation) {
@@ -786,7 +786,7 @@ pub const Completion = struct {
fn complete(completion: *Completion) void {
switch (completion.operation) {
.accept => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: AcceptError!os.socket_t = if (completion.result < 0) switch (-completion.result) {
os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -820,7 +820,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.open => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: OpenError!linux.fd_t = if (completion.result < 0) switch (-completion.result) {
0 => unreachable,
os.EAGAIN, os.EINPROGRESS, os.EINTR => {
completion.io.enqueue(completion);
@@ -847,7 +847,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.connect => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: ConnectError!void = if (completion.result < 0) switch (-completion.result) {
os.EAGAIN, os.EINPROGRESS, os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -872,7 +872,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.fsync => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: FsyncError!void = if (completion.result < 0) switch (-completion.result) {
os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -888,7 +888,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.read => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: ReadError!usize = if (completion.result < 0) switch (-completion.result) {
os.EAGAIN, os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -908,7 +908,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.readev, .recv => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: RecvError!usize = if (completion.result < 0) switch (-completion.result) {
os.EAGAIN, os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -924,7 +924,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.writev, .send => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: SendError!usize = if (completion.result < 0) switch (-completion.result) {
os.EAGAIN, os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -946,7 +946,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.timeout => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: TimeoutError!void = if (completion.result < 0) switch (-completion.result) {
os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -958,7 +958,7 @@ pub const Completion = struct {
completion.callback(completion.context, completion, &result);
},
.write => {
- const result = if (completion.result < 0) switch (-completion.result) {
+ const result: WriteError!usize = if (completion.result < 0) switch (-completion.result) {
os.EINTR => {
completion.io.enqueue(completion);
return;
@@ -1093,7 +1093,7 @@ pub fn accept(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: AcceptError!os.socket_t,
@@ -1135,7 +1135,7 @@ pub fn close(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: CloseError!void,
@@ -1184,13 +1184,14 @@ pub const ConnectError = error{
PermissionDenied,
ProtocolNotSupported,
ConnectionTimedOut,
+ ConnectionResetByPeer,
} || Errno;
pub fn connect(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: ConnectError!void,
@@ -1242,7 +1243,7 @@ pub fn fsync(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: FsyncError!void,
@@ -1286,7 +1287,7 @@ pub fn read(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: ReadError!usize,
@@ -1327,13 +1328,14 @@ pub const RecvError = error{
SystemResources,
SocketNotConnected,
FileDescriptorNotASocket,
+ ConnectionResetByPeer,
} || Errno;
pub fn recv(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: RecvError!usize,
@@ -1373,7 +1375,7 @@ pub fn readev(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: RecvError!usize,
@@ -1423,7 +1425,7 @@ pub fn send(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: SendError!usize,
@@ -1520,7 +1522,7 @@ pub fn open(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: OpenError!linux.fd_t,
@@ -1557,7 +1559,7 @@ pub fn writev(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: SendError!usize,
@@ -1597,7 +1599,7 @@ pub fn timeout(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: TimeoutError!void,
@@ -1644,7 +1646,7 @@ pub fn write(
self: *IO,
comptime Context: type,
context: Context,
- comptime callback: fn (
+ comptime callback: *const fn (
context: Context,
completion: *Completion,
result: WriteError!usize,
@@ -1734,5 +1736,5 @@ fn buffer_limit(buffer_len: usize) usize {
.macos, .ios, .watchos, .tvos => std.math.maxInt(i32),
else => std.math.maxInt(isize),
};
- return @minimum(limit, buffer_len);
+ return @min(limit, buffer_len);
}
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 75539f235..318c67704 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -66,7 +66,7 @@ pub fn NewBaseStore(comptime Union: anytype, comptime count: usize) type {
const UsedSize = std.math.IntFittingRange(0, max + 1);
used: UsedSize = 0,
allocated: UsedSize = 0,
- allocator: Allocator,
+ allocator: Allocator = default_allocator,
ptrs: [max]*Block = undefined,
pub fn tail(this: *Overflow) *Block {
@@ -118,7 +118,8 @@ pub fn NewBaseStore(comptime Union: anytype, comptime count: usize) type {
}
pub fn reset() void {
- for (_self.overflow.slice()) |b| {
+ const blocks = _self.overflow.slice();
+ for (blocks) |b| {
b.used = 0;
}
_self.overflow.used = 0;
@@ -297,14 +298,14 @@ pub const Binding = struct {
data: B,
const Serializable = struct {
- @"type": Tag,
+ type: Tag,
object: string,
value: B,
loc: logger.Loc,
};
pub fn jsonStringify(self: *const @This(), options: anytype, writer: anytype) !void {
- return try std.json.stringify(Serializable{ .@"type" = std.meta.activeTag(self.data), .object = "binding", .value = self.data, .loc = self.loc }, options, writer);
+ return try std.json.stringify(Serializable{ .type = std.meta.activeTag(self.data), .object = "binding", .value = self.data, .loc = self.loc }, options, writer);
}
pub fn ToExpr(comptime expr_type: type, comptime func_type: anytype) type {
@@ -1232,22 +1233,22 @@ pub const E = struct {
pub inline fn toU64(self: Number) u64 {
@setRuntimeSafety(false);
- return @floatToInt(u64, @maximum(@trunc(self.value), 0));
+ return @floatToInt(u64, @max(@trunc(self.value), 0));
}
pub inline fn toUsize(self: Number) usize {
@setRuntimeSafety(false);
- return @floatToInt(usize, @maximum(@trunc(self.value), 0));
+ return @floatToInt(usize, @max(@trunc(self.value), 0));
}
pub inline fn toU32(self: Number) u32 {
@setRuntimeSafety(false);
- return @floatToInt(u32, @maximum(@trunc(self.value), 0));
+ return @floatToInt(u32, @max(@trunc(self.value), 0));
}
pub inline fn toU16(self: Number) u16 {
@setRuntimeSafety(false);
- return @floatToInt(u16, @maximum(@trunc(self.value), 0));
+ return @floatToInt(u16, @max(@trunc(self.value), 0));
}
pub fn jsonStringify(self: *const Number, opts: anytype, o: anytype) !void {
@@ -1927,14 +1928,14 @@ pub const Stmt = struct {
data: Data,
const Serializable = struct {
- @"type": Tag,
+ type: Tag,
object: string,
value: Data,
loc: logger.Loc,
};
pub fn jsonStringify(self: *const Stmt, options: anytype, writer: anytype) !void {
- return try std.json.stringify(Serializable{ .@"type" = std.meta.activeTag(self.data), .object = "stmt", .value = self.data, .loc = self.loc }, options, writer);
+ return try std.json.stringify(Serializable{ .type = std.meta.activeTag(self.data), .object = "stmt", .value = self.data, .loc = self.loc }, options, writer);
}
pub fn isTypeScript(self: *Stmt) bool {
@@ -2412,7 +2413,7 @@ pub const Expr = struct {
pub const EFlags = enum { none, ts_decorator };
const Serializable = struct {
- @"type": Tag,
+ type: Tag,
object: string,
value: Data,
loc: logger.Loc,
@@ -2537,7 +2538,7 @@ pub const Expr = struct {
}
pub fn jsonStringify(self: *const @This(), options: anytype, writer: anytype) !void {
- return try std.json.stringify(Serializable{ .@"type" = std.meta.activeTag(self.data), .object = "expr", .value = self.data, .loc = self.loc }, options, writer);
+ return try std.json.stringify(Serializable{ .type = std.meta.activeTag(self.data), .object = "expr", .value = self.data, .loc = self.loc }, options, writer);
}
pub fn extractNumericValues(left: Expr.Data, right: Expr.Data) ?[2]f64 {
@@ -3515,20 +3516,20 @@ pub const Expr = struct {
pub const PrimitiveType = enum {
unknown,
mixed,
- @"null",
- @"undefined",
+ null,
+ undefined,
boolean,
number,
- @"string",
+ string,
bigint,
pub const static = std.enums.EnumSet(PrimitiveType).init(.{
- .@"mixed" = true,
- .@"null" = true,
- .@"undefined" = true,
- .@"boolean" = true,
- .@"number" = true,
- .@"string" = true,
+ .mixed = true,
+ .null = true,
+ .undefined = true,
+ .boolean = true,
+ .number = true,
+ .string = true,
// for our purposes, bigint is dynamic
// it is technically static though
// .@"bigint" = true,
@@ -3613,11 +3614,11 @@ pub const Expr = struct {
return switch (data) {
.e_big_int => .bigint,
.e_boolean => .boolean,
- .e_null => .@"null",
+ .e_null => .null,
.e_number => .number,
- .e_string => .@"string",
- .e_undefined => .@"undefined",
- .e_template => if (data.e_template.tag == null) PrimitiveType.@"string" else PrimitiveType.unknown,
+ .e_string => .string,
+ .e_undefined => .undefined,
+ .e_template => if (data.e_template.tag == null) PrimitiveType.string else PrimitiveType.unknown,
.e_if => mergeKnownPrimitive(data.e_if.yes.data, data.e_if.no.data),
.e_binary => |binary| brk: {
switch (binary.op) {
@@ -3637,7 +3638,7 @@ pub const Expr = struct {
.bin_nullish_coalescing => {
const left = binary.left.data.knownPrimitive();
const right = binary.right.data.knownPrimitive();
- if (left == .@"null" or left == .@"undefined")
+ if (left == .null or left == .undefined)
break :brk right;
if (left != .unknown) {
@@ -3653,8 +3654,8 @@ pub const Expr = struct {
const left = binary.left.data.knownPrimitive();
const right = binary.right.data.knownPrimitive();
- if (left == .@"string" or right == .@"string")
- break :brk PrimitiveType.@"string";
+ if (left == .string or right == .string)
+ break :brk PrimitiveType.string;
if (left == .bigint or right == .bigint)
break :brk PrimitiveType.bigint;
@@ -3706,8 +3707,8 @@ pub const Expr = struct {
},
.e_unary => switch (data.e_unary.op) {
- .un_void => PrimitiveType.@"undefined",
- .un_typeof => PrimitiveType.@"string",
+ .un_void => PrimitiveType.undefined,
+ .un_typeof => PrimitiveType.string,
.un_not, .un_delete => PrimitiveType.boolean,
.un_pos => PrimitiveType.number, // Cannot be bigint because that throws an exception
.un_neg, .un_cpl => switch (data.e_unary.value.data.knownPrimitive()) {
@@ -4295,7 +4296,7 @@ pub const Op = struct {
return @intToEnum(Level, @enumToInt(self) - i);
}
- pub inline fn add(self: Level, i: anytype) Level {
+ pub inline fn addF(self: Level, i: anytype) Level {
return @intToEnum(Level, @enumToInt(self) + i);
}
};
@@ -4704,7 +4705,7 @@ pub const Scope = struct {
loc: logger.Loc,
pub fn eql(a: Member, b: Member) bool {
- return @call(.{ .modifier = .always_inline }, Ref.eql, .{ a.ref, b.ref }) and a.loc.start == b.loc.start;
+ return @call(.always_inline, Ref.eql, .{ a.ref, b.ref }) and a.loc.start == b.loc.start;
}
};
@@ -5146,7 +5147,7 @@ pub const Macro = struct {
_: js.JSStringRef,
exception: js.ExceptionRef,
) js.JSObjectRef {
- const args = if (this.data == .e_object) this.data.e_object.properties.slice() else &[_]G.Property{};
+ const args: []G.Property = if (this.data == .e_object) this.data.e_object.properties.slice() else &[_]G.Property{};
switch (args.len) {
0 => return js.JSObjectMakeArray(ctx, 0, null, exception),
@@ -5355,7 +5356,7 @@ pub const Macro = struct {
ctx: js.JSContextRef,
exception: js.ExceptionRef,
) js.JSValueRef {
- return @call(.{ .modifier = .always_inline }, toPrimitiveAllowRecursion, .{ this, ctx, exception, false });
+ return @call(.always_inline, toPrimitiveAllowRecursion, .{ this, ctx, exception, false });
}
fn toPrimitiveWithRecursion(
@@ -5363,7 +5364,7 @@ pub const Macro = struct {
ctx: js.JSContextRef,
exception: js.ExceptionRef,
) js.JSValueRef {
- return @call(.{ .modifier = .always_inline }, toPrimitiveAllowRecursion, .{ this, ctx, exception, true });
+ return @call(.always_inline, toPrimitiveAllowRecursion, .{ this, ctx, exception, true });
}
fn toPrimitiveAllowRecursion(this: *JSNode, ctx: js.JSContextRef, exception: js.ExceptionRef, comptime _: bool) js.JSValueRef {
@@ -5858,7 +5859,7 @@ pub const Macro = struct {
pub const ids: std.EnumArray(Tag, Expr.Data) = brk: {
var list = std.EnumArray(Tag, Expr.Data).initFill(Expr.Data{ .e_number = E.Number{ .value = 0.0 } });
- const fields: []const std.builtin.TypeInfo.EnumField = @typeInfo(Tag).Enum.fields;
+ const fields: []const std.builtin.Type.EnumField = @typeInfo(Tag).Enum.fields;
for (fields) |field| {
list.set(@intToEnum(Tag, field.value), Expr.Data{ .e_number = E.Number{ .value = @intToFloat(f64, field.value) } });
}
@@ -6034,7 +6035,7 @@ pub const Macro = struct {
};
pub const max_tag: u8 = brk: {
- const Enum: std.builtin.TypeInfo.Enum = @typeInfo(Tag).Enum;
+ const Enum: std.builtin.Type.Enum = @typeInfo(Tag).Enum;
var max_value: u8 = 0;
for (Enum.fields) |field| {
max_value = std.math.max(@as(u8, field.value), max_value);
@@ -6043,7 +6044,7 @@ pub const Macro = struct {
};
pub const min_tag: u8 = brk: {
- const Enum: std.builtin.TypeInfo.Enum = @typeInfo(Tag).Enum;
+ const Enum: std.builtin.Type.Enum = @typeInfo(Tag).Enum;
var min: u8 = 255;
for (Enum.fields) |field| {
min = std.math.min(@as(u8, field.value), min);
@@ -6419,14 +6420,14 @@ pub const Macro = struct {
},
// null is cooerced to "null"
.e_null => {
- self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = &E.String.@"null" } });
+ self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = &E.String.null } });
},
// undefined is cooerced to "undefined"
.e_undefined => {
- self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = &E.String.@"undefined" } });
+ self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = &E.String.undefined } });
},
.e_boolean => |boolean| {
- self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = if (boolean.value) &E.String.@"true" else &E.String.@"false" } });
+ self.args.appendAssumeCapacity(Expr{ .loc = value.loc, .data = .{ .e_string = if (boolean.value) &E.String.true else &E.String.false } });
},
// these ones are not statically analyzable so we just leave them in as-is
.e_template, .e_if, .e_identifier, .e_import_identifier, .e_index, .e_call, .e_private_identifier, .e_dot, .e_unary, .e_binary => {
@@ -6827,7 +6828,7 @@ pub const Macro = struct {
const node_type: JSNode.Tag = JSNode.Tag.names.get(str.data) orelse {
if (!str.isUTF8()) {
- self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{strings.toUTF8Alloc(self.p.allocator, str.slice16())}) catch unreachable;
+ self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{strings.toUTF8Alloc(self.p.allocator, str.slice16()) catch unreachable}) catch unreachable;
} else {
self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{str.data}) catch unreachable;
}
@@ -6849,7 +6850,9 @@ pub const Macro = struct {
const node_type: JSNode.Tag = JSNode.Tag.names.get(str.data) orelse {
if (!str.isUTF8()) {
- self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{strings.toUTF8Alloc(self.p.allocator, str.slice16())}) catch unreachable;
+ self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{
+ strings.toUTF8Alloc(self.p.allocator, str.slice16()) catch unreachable,
+ }) catch unreachable;
} else {
self.log.addErrorFmt(p.source, tag_expr.loc, p.allocator, "Tag \"{s}\" is invalid", .{str.data}) catch unreachable;
}
@@ -6917,7 +6920,7 @@ pub const Macro = struct {
js.JSType.kJSTypeNumber => {
const tag_int = @floatToInt(u8, JSC.JSValue.fromRef(value).asNumber());
if (tag_int < Tag.min_tag or tag_int > Tag.max_tag) {
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
}
return TagOrJSNode{ .tag = @intToEnum(JSNode.Tag, tag_int) };
},
@@ -6926,10 +6929,10 @@ pub const Macro = struct {
return TagOrJSNode{ .node = node.* };
}
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
},
else => {
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
},
}
}
@@ -6941,7 +6944,7 @@ pub const Macro = struct {
if (tag_int < Tag.min_tag or tag_int > Tag.max_tag) {
throwTypeError(ctx, "Node type has invalid value", writer.exception);
writer.errored = true;
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
}
return TagOrJSNode{ .tag = @intToEnum(JSNode.Tag, tag_int) };
},
@@ -6950,11 +6953,11 @@ pub const Macro = struct {
return TagOrJSNode{ .node = node.* };
}
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
},
else => {
throwTypeError(writer.ctx, "Invalid bun AST", writer.exception);
- return TagOrJSNode{ .invalid = .{} };
+ return TagOrJSNode{ .invalid = {} };
},
}
}
@@ -7401,7 +7404,7 @@ pub const Macro = struct {
}
}
}
- return JSNode{ .data = .{ .inline_inject = writer.inject.toOwnedSlice() }, .loc = writer.loc };
+ return JSNode{ .data = .{ .inline_inject = writer.inject.toOwnedSlice() catch @panic("TODO") }, .loc = writer.loc };
}
if (tag == Tag.s_import) {
@@ -7445,7 +7448,7 @@ pub const Macro = struct {
fragment.append(node) catch unreachable;
}
- return JSNode{ .data = .{ .fragment = fragment.toOwnedSlice() }, .loc = writer.loc };
+ return JSNode{ .data = .{ .fragment = fragment.toOwnedSlice() catch @panic("TODO") }, .loc = writer.loc };
}
var expr: Expr = Expr{ .loc = writer.loc, .data = .{ .e_null = E.Null{} } };
@@ -7547,7 +7550,7 @@ pub const Macro = struct {
const args_value = JSC.JSValue.fromRef(arguments[0]);
var writer = Writer{
.inject = std.ArrayList(JSNode).init(JSCBase.getAllocator(ctx)),
- .log = JavaScript.VirtualMachine.vm.log,
+ .log = JavaScript.VirtualMachine.get().log,
.ctx = ctx,
.loc = logger.Loc.Empty,
.allocator = JSCBase.getAllocator(ctx),
@@ -7581,13 +7584,13 @@ pub const Macro = struct {
},
.{
.getProperty = .{
- .rfn = getProperty,
+ .rfn = &getProperty,
},
.hasProperty = .{
- .rfn = hasProperty,
+ .rfn = &hasProperty,
},
.getPropertyNames = .{
- .rfn = getPropertyNames,
+ .rfn = &getPropertyNames,
},
},
.{},
@@ -7674,13 +7677,13 @@ pub const Macro = struct {
},
.{
.getProperty = .{
- .rfn = getProperty,
+ .rfn = &getProperty,
},
.hasProperty = .{
- .rfn = hasProperty,
+ .rfn = &hasProperty,
},
.getPropertyNames = .{
- .rfn = getPropertyNames,
+ .rfn = &getPropertyNames,
},
},
.{},
@@ -7761,8 +7764,8 @@ pub const Macro = struct {
) !Macro {
const path = resolved.path_pair.primary;
- var vm: *JavaScript.VirtualMachine = if (JavaScript.VirtualMachine.vm_loaded)
- JavaScript.VirtualMachine.vm
+ var vm: *JavaScript.VirtualMachine = if (JavaScript.VirtualMachine.isLoaded())
+ JavaScript.VirtualMachine.get()
else brk: {
var old_transform_options = resolver.opts.transform_options;
resolver.opts.transform_options.node_modules_bundle_path = null;
@@ -7787,8 +7790,6 @@ pub const Macro = struct {
return error.MacroLoadError;
}
- JavaScript.VirtualMachine.vm_loaded = true;
-
// We don't need to do anything with the result.
// We just want to make sure the promise is finished.
_ = loaded_result.result(vm.global.vm());
@@ -7837,7 +7838,13 @@ pub const Macro = struct {
if (comptime is_bindgen) return undefined;
var macro_callback = macro.vm.macros.get(id) orelse return caller;
- var result = js.JSObjectCallAsFunctionReturnValueHoldingAPILock(macro.vm.global, macro_callback, null, args_count, &args_buf);
+ var result = js.JSObjectCallAsFunctionReturnValueHoldingAPILock(
+ macro.vm.global,
+ macro_callback,
+ null,
+ args_count,
+ &args_buf,
+ );
var runner = Run{
.caller = caller,
@@ -8185,12 +8192,14 @@ pub const Macro = struct {
pub fn callWrapper(args: CallArgs) MacroError!Expr {
JSC.markBinding(@src());
call_args = args;
- Bun__startMacro(call, JSC.VirtualMachine.vm.global);
+ Bun__startMacro(&call, JSC.VirtualMachine.get().global);
return result;
}
pub fn call() callconv(.C) void {
- result = @call(.{}, Run.runAsync, call_args);
+ const call_args_copy = call_args;
+ const local_result = @call(.auto, Run.runAsync, call_args_copy);
+ result = local_result;
}
};
diff --git a/src/js_lexer.zig b/src/js_lexer.zig
index e9ec7442b..6ff8c1ec5 100644
--- a/src/js_lexer.zig
+++ b/src/js_lexer.zig
@@ -735,7 +735,7 @@ fn NewLexer_(
// Reset string literal
const base = if (comptime quote == 0) lexer.start else lexer.start + 1;
- lexer.string_literal_slice = lexer.source.contents[base..@minimum(lexer.source.contents.len, lexer.end - @as(usize, string_literal_details.suffix_len))];
+ lexer.string_literal_slice = lexer.source.contents[base..@min(lexer.source.contents.len, lexer.end - @as(usize, string_literal_details.suffix_len))];
lexer.string_literal_is_ascii = !string_literal_details.needs_slow_path;
lexer.string_literal_buffer.shrinkRetainingCapacity(0);
if (string_literal_details.needs_slow_path) {
@@ -968,7 +968,7 @@ fn NewLexer_(
self.addError(self.start, "Expected \"{s}\" but found \"{s}\" (token: {s})", .{
keyword,
self.raw(),
- self.token,
+ @tagName(self.token),
}, true);
} else {
self.addError(self.start, "Expected \"{s}\" but found \"{s}\"", .{ keyword, self.raw() }, true);
@@ -2139,7 +2139,7 @@ fn NewLexer_(
// JSX string literals do not support escaping
// They're "pre" escaped
switch (lexer.code_point) {
- 'u', 0x0C, 0, '\t', std.ascii.control_code.VT, 0x08 => {
+ 'u', 0x0C, 0, '\t', std.ascii.control_code.vt, 0x08 => {
needs_decode = true;
},
else => {},
@@ -3019,7 +3019,7 @@ fn indexOfInterestingCharacterInStringLiteral(text_: []const u8, quote: u8) ?usi
if (@reduce(.Max, any_significant) > 0) {
const bitmask = @ptrCast(*const u16, &any_significant).*;
- const first = @ctz(u16, bitmask);
+ const first = @ctz(bitmask);
std.debug.assert(first < strings.ascii_vector_size);
return first + (@ptrToInt(text.ptr) - @ptrToInt(text_.ptr));
}
diff --git a/src/js_lexer/identifier_cache.zig b/src/js_lexer/identifier_cache.zig
index 59cd9580c..93d5149c3 100644
--- a/src/js_lexer/identifier_cache.zig
+++ b/src/js_lexer/identifier_cache.zig
@@ -10,8 +10,8 @@ pub const CachedBitset = extern struct {
};
pub fn setMasks(masks: [*:0]const u8, comptime MaskType: type, masky: MaskType) void {
- const FieldInfo: std.builtin.TypeInfo.StructField = std.meta.fieldInfo(MaskType, "masks");
- masky.masks = @bitCast(masks, FieldInfo.field_type);
+ const FieldInfo: std.builtin.Type.StructField = std.meta.fieldInfo(MaskType, "masks");
+ masky.masks = @bitCast(masks, FieldInfo.type);
}
pub const id_start_meta = CachedBitset.fromFile("id_start_bitset.meta.blob");
@@ -22,8 +22,8 @@ pub const id_continue_masks = @embedFile("id_continue_bitset.blob");
pub const IDStartType = std.bit_set.StaticBitSet(id_start_meta.len);
pub const IDContinueType = std.bit_set.StaticBitSet(id_continue_meta.len);
pub const id_start = IDStartType{
- .masks = @bitCast(std.meta.fieldInfo(IDStartType, .masks).field_type, @ptrCast(*const [id_start_masks.len]u8, id_start_masks).*),
+ .masks = @bitCast(std.meta.fieldInfo(IDStartType, .masks).type, @ptrCast(*const [id_start_masks.len]u8, id_start_masks).*),
};
pub const id_continue = IDContinueType{
- .masks = @bitCast(std.meta.fieldInfo(IDContinueType, .masks).field_type, @ptrCast(*const [id_continue_masks.len]u8, id_continue_masks).*),
+ .masks = @bitCast(std.meta.fieldInfo(IDContinueType, .masks).type, @ptrCast(*const [id_continue_masks.len]u8, id_continue_masks).*),
};
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 6063f613d..1fa86041f 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -166,7 +166,7 @@ const BunJSX = struct {
};
pub fn ExpressionTransposer(
comptime Kontext: type,
- visitor: fn (ptr: *Kontext, arg: Expr, state: anytype) Expr,
+ comptime visitor: fn (ptr: *Kontext, arg: Expr, state: anytype) Expr,
) type {
return struct {
pub const Context = Kontext;
@@ -261,7 +261,7 @@ const JSXTag = struct {
// <Hello-:Button
if (strings.containsComptime(name, "-:") or (p.lexer.token != .t_dot and name[0] >= 'a' and name[0] <= 'z')) {
return JSXTag{
- .data = Data{ .tag = p.e(E.String{
+ .data = Data{ .tag = p.newExpr(E.String{
.data = name,
}, loc) },
.range = tag_range,
@@ -270,7 +270,7 @@ const JSXTag = struct {
// Otherwise, this is an identifier
// <Button>
- var tag = p.e(E.Identifier{ .ref = try p.storeNameInRef(name) }, loc);
+ var tag = p.newExpr(E.Identifier{ .ref = try p.storeNameInRef(name) }, loc);
// Parse a member expression chain
// <Button.Red>
@@ -291,7 +291,7 @@ const JSXTag = struct {
std.mem.copy(u8, _name[name.len + 1 .. _name.len], member);
name = _name;
tag_range.len = member_range.loc.start + member_range.len - tag_range.loc.start;
- tag = p.e(E.Dot{ .target = tag, .name = member, .name_loc = member_range.loc }, loc);
+ tag = p.newExpr(E.Dot{ .target = tag, .name = member, .name_loc = member_range.loc }, loc);
}
return JSXTag{ .data = Data{ .tag = tag }, .range = tag_range, .name = name };
@@ -856,7 +856,7 @@ pub const ImportScanner = struct {
}
var decls = try allocator.alloc(G.Decl, 1);
- decls[0] = G.Decl{ .binding = p.b(B.Identifier{ .ref = st.default_name.ref.? }, stmt.loc), .value = p.e(E.Function{ .func = func.func }, stmt.loc) };
+ decls[0] = G.Decl{ .binding = p.b(B.Identifier{ .ref = st.default_name.ref.? }, stmt.loc), .value = p.newExpr(E.Function{ .func = func.func }, stmt.loc) };
stmt = p.s(S.Local{
.decls = decls,
@@ -876,7 +876,7 @@ pub const ImportScanner = struct {
var decls = try allocator.alloc(G.Decl, 1);
decls[0] = G.Decl{
.binding = p.b(B.Identifier{ .ref = st.default_name.ref.? }, stmt.loc),
- .value = p.e(E.Class{
+ .value = p.newExpr(E.Class{
.class_keyword = class.class.class_keyword,
.ts_decorators = class.class.ts_decorators,
.class_name = class.class.class_name,
@@ -904,10 +904,10 @@ pub const ImportScanner = struct {
.stmt => |s2| brk2: {
switch (s2.data) {
.s_function => |func| {
- break :brk2 p.e(E.Function{ .func = func.func }, s2.loc);
+ break :brk2 p.newExpr(E.Function{ .func = func.func }, s2.loc);
},
.s_class => |class| {
- break :brk2 p.e(class.class, s2.loc);
+ break :brk2 p.newExpr(class.class, s2.loc);
},
else => unreachable,
}
@@ -952,7 +952,7 @@ pub const ImportScanner = struct {
try p.import_records_for_current_part.append(allocator, st.import_record_index);
for (st.items) |item| {
- const ref = item.name.ref orelse p.panic("Expected export from item to have a name {s}", .{st});
+ const ref = item.name.ref orelse p.panic("Expected export from item to have a name {any}", .{st});
// Note that the imported alias is not item.Alias, which is the
// exported alias. This is somewhat confusing because each
// SExportFrom statement is basically SImport + SExportClause in one.
@@ -985,16 +985,18 @@ const StaticSymbolName = struct {
pub const List = struct {
fn NewStaticSymbol(comptime basename: string) StaticSymbolName {
+ const hash_value = std.hash.Wyhash.hash(0, basename);
return comptime StaticSymbolName{
- .internal = basename ++ "_" ++ std.fmt.comptimePrint("{x}", .{std.hash.Wyhash.hash(0, basename)}),
+ .internal = basename ++ "_" ++ std.fmt.comptimePrint("{any}", .{bun.fmt.hexIntLower(hash_value)}),
.primary = basename,
.backup = "_" ++ basename ++ "$",
};
}
fn NewStaticSymbolWithBackup(comptime basename: string, comptime backup: string) StaticSymbolName {
+ const hash_value = std.hash.Wyhash.hash(0, basename);
return comptime StaticSymbolName{
- .internal = basename ++ "_" ++ std.fmt.comptimePrint("{x}", .{std.hash.Wyhash.hash(0, basename)}),
+ .internal = basename ++ "_" ++ std.fmt.comptimePrint("{any}", .{bun.fmt.hexIntLower(hash_value)}),
.primary = basename,
.backup = backup,
};
@@ -1253,7 +1255,7 @@ pub const SideEffects = enum(u1) {
} else if (!prop.flags.contains(.is_computed)) {
continue;
} else {
- prop.value = p.e(E.Number{ .value = 0.0 }, prop.value.?.loc);
+ prop.value = p.newExpr(E.Number{ .value = 0.0 }, prop.value.?.loc);
}
}
}
@@ -1384,7 +1386,7 @@ pub const SideEffects = enum(u1) {
findIdentifiers(decl.binding, &decls);
}
- local.decls = decls.toOwnedSlice();
+ local.decls = decls.toOwnedSlice() catch @panic("TODO");
return true;
},
@@ -2425,7 +2427,7 @@ pub const Parser = struct {
// var decls = try p.allocator.alloc(G.Decl, 1);
// decls[0] = Decl{ .binding = p.b(B.Identifier{
// .ref = p.import_meta_ref,
- // }, logger.Loc.Empty), .value = p.e(E.Object{}, logger.Loc.Empty) };
+ // }, logger.Loc.Empty), .value = p.newExpr(E.Object{}, logger.Loc.Empty) };
// var importMetaStatement = p.s(S.Local{
// .kind = .k_const,
// .decls = decls,
@@ -2487,7 +2489,7 @@ pub const Parser = struct {
if (uses_dirname) {
decls[0] = .{
.binding = p.b(B.Identifier{ .ref = p.dirname_ref }, logger.Loc.Empty),
- .value = p.e(
+ .value = p.newExpr(
// TODO: test UTF-8 file paths
E.String.init(p.source.path.name.dir),
logger.Loc.Empty,
@@ -2498,7 +2500,7 @@ pub const Parser = struct {
if (uses_filename) {
decls[@as(usize, @boolToInt(uses_dirname))] = .{
.binding = p.b(B.Identifier{ .ref = p.filename_ref }, logger.Loc.Empty),
- .value = p.e(
+ .value = p.newExpr(
E.String.init(p.source.path.text),
logger.Loc.Empty,
),
@@ -2681,14 +2683,14 @@ pub const Parser = struct {
},
loc,
),
- .value = p.e(
+ .value = p.newExpr(
E.Call{
// Symbol.for
- .target = p.e(
+ .target = p.newExpr(
E.Dot{
.name = "for",
.name_loc = logger.Loc.Empty,
- .target = p.e(
+ .target = p.newExpr(
E.Identifier{
.ref = p.es6_symbol_global.ref,
.can_be_removed_if_unused = true,
@@ -2715,7 +2717,7 @@ pub const Parser = struct {
declared_symbols[declared_symbols_i] = .{ .ref = automatic_namespace_ref, .is_top_level = true };
declared_symbols_i += 1;
- const automatic_identifier = p.e(E.ImportIdentifier{ .ref = automatic_namespace_ref }, loc);
+ const automatic_identifier = p.newExpr(E.ImportIdentifier{ .ref = automatic_namespace_ref }, loc);
// We do not mark this as .require becuase we are already wrapping it manually.
// unless it's bun and you're not bundling
@@ -2727,7 +2729,7 @@ pub const Parser = struct {
if (use_automatic_identifier) {
break :brk automatic_identifier;
} else if (p.options.features.dynamic_require) {
- break :brk p.e(E.Require{ .import_record_index = import_record_id }, loc);
+ break :brk p.newExpr(E.Require{ .import_record_index = import_record_id }, loc);
} else {
require_call_args_base[require_call_args_i] = automatic_identifier;
require_call_args_i += 1;
@@ -2746,7 +2748,7 @@ pub const Parser = struct {
},
loc,
),
- .value = p.e(
+ .value = p.newExpr(
E.Dot{
.target = dot_call_target,
.name = p.options.jsx.jsx,
@@ -2771,7 +2773,7 @@ pub const Parser = struct {
},
loc,
),
- .value = p.e(
+ .value = p.newExpr(
E.Dot{
.target = dot_call_target,
.name = p.options.jsx.jsx_static,
@@ -2795,7 +2797,7 @@ pub const Parser = struct {
// },
// loc,
// ),
- // .value = p.e(E.String{ .data = p.source.path.pretty }, loc),
+ // .value = p.newExpr(E.String{ .data = p.source.path.pretty }, loc),
// };
// decl_i += 1;
// }
@@ -2825,13 +2827,13 @@ pub const Parser = struct {
.import_record_index = import_record_id,
},
) catch unreachable;
- p.is_import_item.put(p.allocator, automatic_namespace_ref, .{}) catch unreachable;
+ p.is_import_item.put(p.allocator, automatic_namespace_ref, {}) catch unreachable;
import_records[import_record_i] = import_record_id;
import_record_i += 1;
}
if (jsx_classic_symbol.use_count_estimate > 0) {
- const classic_identifier = p.e(E.ImportIdentifier{ .ref = classic_namespace_ref }, loc);
+ const classic_identifier = p.newExpr(E.ImportIdentifier{ .ref = classic_namespace_ref }, loc);
const import_record_id = p.addImportRecord(.require, loc, p.options.jsx.classic_import_source);
const dot_call_target = brk: {
// var react = $aopaSD123();
@@ -2839,7 +2841,7 @@ pub const Parser = struct {
if (p.options.can_import_from_bundle or p.options.enable_bundling or !p.options.features.allow_runtime) {
break :brk classic_identifier;
} else if (p.options.features.dynamic_require) {
- break :brk p.e(E.Require{ .import_record_index = import_record_id }, loc);
+ break :brk p.newExpr(E.Require{ .import_record_index = import_record_id }, loc);
} else {
const require_call_args_start = require_call_args_i;
require_call_args_base[require_call_args_i] = classic_identifier;
@@ -2908,7 +2910,7 @@ pub const Parser = struct {
.import_record_index = import_record_id,
},
) catch unreachable;
- p.is_import_item.put(p.allocator, classic_namespace_ref, .{}) catch unreachable;
+ p.is_import_item.put(p.allocator, classic_namespace_ref, {}) catch unreachable;
import_records[import_record_i] = import_record_id;
declared_symbols[declared_symbols_i] = .{ .ref = classic_namespace_ref, .is_top_level = true };
declared_symbols_i += 1;
@@ -2943,7 +2945,7 @@ pub const Parser = struct {
.import_record_index = import_record_id,
},
) catch unreachable;
- p.is_import_item.put(p.allocator, p.jsx_refresh_runtime.ref, .{}) catch unreachable;
+ p.is_import_item.put(p.allocator, p.jsx_refresh_runtime.ref, {}) catch unreachable;
import_records[import_record_i] = import_record_id;
}
p.recordUsage(p.jsx_refresh_runtime.ref);
@@ -2979,14 +2981,14 @@ pub const Parser = struct {
},
logger.Loc.Empty,
),
- .value = p.e(
+ .value = p.newExpr(
E.Call{
// Symbol.for
- .target = p.e(
+ .target = p.newExpr(
E.Dot{
.name = "for",
.name_loc = logger.Loc.Empty,
- .target = p.e(
+ .target = p.newExpr(
E.Identifier{
.ref = p.es6_symbol_global.ref,
.can_be_removed_if_unused = true,
@@ -3089,7 +3091,7 @@ pub const Parser = struct {
.import_record_index = import_record_id,
},
) catch unreachable;
- p.is_import_item.put(p.allocator, p.jsx_refresh_runtime.ref, .{}) catch unreachable;
+ p.is_import_item.put(p.allocator, p.jsx_refresh_runtime.ref, {}) catch unreachable;
var import_records = try p.allocator.alloc(@TypeOf(import_record_id), 1);
import_records[0] = import_record_id;
declared_symbols[0] = .{ .ref = p.jsx_refresh_runtime.ref, .is_top_level = true };
@@ -3152,7 +3154,7 @@ pub const Parser = struct {
// HMRClient.activate(true)
var args_list: []Expr = if (Environment.isDebug) &Prefill.HotModuleReloading.DebugEnabledArgs else &Prefill.HotModuleReloading.DebugDisabled;
- var hmr_module_class_ident = p.e(E.Identifier{ .ref = p.runtime_imports.__HMRClient.?.ref }, logger.Loc.Empty);
+ var hmr_module_class_ident = p.newExpr(E.Identifier{ .ref = p.runtime_imports.__HMRClient.?.ref }, logger.Loc.Empty);
const imports = [_]u16{entry.key};
// TODO: remove these unnecessary allocations
p.generateImportStmt(
@@ -3162,8 +3164,8 @@ pub const Parser = struct {
p.runtime_imports,
p.s(
S.SExpr{
- .value = p.e(E.Call{
- .target = p.e(E.Dot{
+ .value = p.newExpr(E.Call{
+ .target = p.newExpr(E.Dot{
.target = hmr_module_class_ident,
.name = "activate",
.name_loc = logger.Loc.Empty,
@@ -3376,10 +3378,10 @@ pub const Prefill = struct {
pub var @"$$typeof" = E.String{ .data = "$$typeof" };
pub var @"type" = E.String{ .data = "type" };
- pub var @"ref" = E.String{ .data = "ref" };
- pub var @"props" = E.String{ .data = "props" };
- pub var @"_owner" = E.String{ .data = "_owner" };
- pub var @"REACT_ELEMENT_TYPE" = E.String{ .data = "react.element" };
+ pub var ref = E.String{ .data = "ref" };
+ pub var props = E.String{ .data = "props" };
+ pub var _owner = E.String{ .data = "_owner" };
+ pub var REACT_ELEMENT_TYPE = E.String{ .data = "react.element" };
};
pub const Data = struct {
pub var BMissing = B{ .b_missing = BMissing_ };
@@ -3395,12 +3397,12 @@ pub const Prefill = struct {
pub var LineNumber = Expr.Data{ .e_string = &Prefill.String.LineNumber };
pub var ColumnNumber = Expr.Data{ .e_string = &Prefill.String.ColumnNumber };
pub var @"$$typeof" = Expr.Data{ .e_string = &Prefill.String.@"$$typeof" };
- pub var @"key" = Expr.Data{ .e_string = &Prefill.String.@"Key" };
- pub var @"type" = Expr.Data{ .e_string = &Prefill.String.@"type" };
- pub var @"ref" = Expr.Data{ .e_string = &Prefill.String.@"ref" };
- pub var @"props" = Expr.Data{ .e_string = &Prefill.String.@"props" };
- pub var @"_owner" = Expr.Data{ .e_string = &Prefill.String.@"_owner" };
- pub var @"REACT_ELEMENT_TYPE" = Expr.Data{ .e_string = &Prefill.String.@"REACT_ELEMENT_TYPE" };
+ pub var key = Expr.Data{ .e_string = &Prefill.String.Key };
+ pub var @"type" = Expr.Data{ .e_string = &Prefill.String.type };
+ pub var ref = Expr.Data{ .e_string = &Prefill.String.ref };
+ pub var props = Expr.Data{ .e_string = &Prefill.String.props };
+ pub var _owner = Expr.Data{ .e_string = &Prefill.String._owner };
+ pub var REACT_ELEMENT_TYPE = Expr.Data{ .e_string = &Prefill.String.REACT_ELEMENT_TYPE };
pub const This = Expr.Data{ .e_this = E.This{} };
pub const Zero = Expr.Data{ .e_number = Value.Zero };
};
@@ -3816,13 +3818,13 @@ fn NewParser_(
// We don't want to spend time scanning the required files if they will
// never be used.
if (p.is_control_flow_dead) {
- return p.e(E.Null{}, arg.loc);
+ return p.newExpr(E.Null{}, arg.loc);
}
const import_record_index = p.addImportRecord(.dynamic, arg.loc, arg.data.e_string.slice(p.allocator));
p.import_records.items[import_record_index].handles_import_errors = (state.is_await_target and p.fn_or_arrow_data_visit.try_body_count != 0) or state.is_then_catch_target;
p.import_records_for_current_part.append(p.allocator, import_record_index) catch unreachable;
- return p.e(E.Import{
+ return p.newExpr(E.Import{
.expr = arg,
.import_record_index = Ref.toInt(import_record_index),
// .leading_interior_comments = arg.getString().
@@ -3835,7 +3837,7 @@ fn NewParser_(
p.log.addRangeDebug(p.source, r, "This \"import\" expression cannot be bundled because the argument is not a string literal") catch unreachable;
}
- return p.e(E.Import{
+ return p.newExpr(E.Import{
.expr = arg,
.import_record_index = Ref.None.sourceIndex(),
}, state.loc);
@@ -3848,13 +3850,13 @@ fn NewParser_(
// We don't want to spend time scanning the required files if they will
// never be used.
if (p.is_control_flow_dead) {
- return p.e(E.Null{}, arg.loc);
+ return p.newExpr(E.Null{}, arg.loc);
}
const import_record_index = p.addImportRecord(.require, arg.loc, arg.data.e_string.string(p.allocator) catch unreachable);
p.import_records.items[import_record_index].handles_import_errors = p.fn_or_arrow_data_visit.try_body_count != 0;
p.import_records_for_current_part.append(p.allocator, import_record_index) catch unreachable;
- return p.e(E.RequireOrRequireResolve{
+ return p.newExpr(E.RequireOrRequireResolve{
.import_record_index = Ref.toInt(import_record_index),
// .leading_interior_comments = arg.getString().
}, arg.loc);
@@ -3887,25 +3889,27 @@ fn NewParser_(
p.import_records_for_current_part.append(p.allocator, import_record_index) catch unreachable;
if (!p.options.transform_require_to_import) {
- return p.e(E.Require{ .import_record_index = import_record_index }, arg.loc);
+ return p.newExpr(E.Require{ .import_record_index = import_record_index }, arg.loc);
}
p.import_records.items[import_record_index].was_originally_require = true;
p.import_records.items[import_record_index].contains_import_star = true;
- const symbol_name = p.import_records.items[import_record_index].path.name.nonUniqueNameString(p.allocator);
+ const symbol_name = p.import_records.items[import_record_index].path.name.nonUniqueNameString(p.allocator) catch unreachable;
+ const hash_value = @truncate(
+ u16,
+ std.hash.Wyhash.hash(
+ 0,
+ p.import_records.items[import_record_index].path.text,
+ ),
+ );
+
const cjs_import_name = std.fmt.allocPrint(
p.allocator,
- "{s}_{x}_{d}",
+ "{s}_{any}_{d}",
.{
symbol_name,
- @truncate(
- u16,
- std.hash.Wyhash.hash(
- 0,
- p.import_records.items[import_record_index].path.text,
- ),
- ),
+ bun.fmt.hexIntLower(hash_value),
p.cjs_import_stmts.items.len,
},
) catch unreachable;
@@ -3925,7 +3929,7 @@ fn NewParser_(
) catch unreachable;
const args = p.allocator.alloc(Expr, 1) catch unreachable;
- args[0] = p.e(
+ args[0] = p.newExpr(
E.ImportIdentifier{
.ref = namespace_ref,
},
@@ -3993,7 +3997,7 @@ fn NewParser_(
for (parts_) |part, i| {
if (part.tag == .none) {
stmts_count += part.stmts.len;
- first_none_part = @minimum(i, first_none_part);
+ first_none_part = @min(i, first_none_part);
}
}
@@ -4175,7 +4179,7 @@ fn NewParser_(
}
}
- pub fn e(p: *P, t: anytype, loc: logger.Loc) Expr {
+ pub fn newExpr(p: *P, t: anytype, loc: logger.Loc) Expr {
const Type = @TypeOf(t);
comptime {
@@ -4339,7 +4343,7 @@ fn NewParser_(
}
},
else => {
- p.panic("Unexpected binding export type {s}", .{binding});
+ p.panic("Unexpected binding export type {any}", .{binding});
},
}
}
@@ -4442,7 +4446,7 @@ fn NewParser_(
// Substitute an EImportIdentifier now if this is an import item
if (p.is_import_item.contains(ref)) {
- return p.e(
+ return p.newExpr(
E.ImportIdentifier{ .ref = ref, .was_originally_identifier = opts.was_originally_identifier },
loc,
);
@@ -4456,14 +4460,14 @@ fn NewParser_(
// If this is a known enum value, inline the value of the enum
if (p.known_enum_values.get(ns_ref)) |enum_values| {
if (enum_values.get(name)) |number| {
- return p.e(E.Number{ .value = number }, loc);
+ return p.newExpr(E.Number{ .value = number }, loc);
}
}
// Otherwise, create a property access on the namespace
p.recordUsage(ns_ref);
- return p.e(E.Dot{ .target = p.e(E.Identifier{ .ref = ns_ref }, loc), .name = name, .name_loc = loc }, loc);
+ return p.newExpr(E.Dot{ .target = p.newExpr(E.Identifier{ .ref = ns_ref }, loc), .name = name, .name_loc = loc }, loc);
}
}
@@ -4471,10 +4475,10 @@ fn NewParser_(
const result = p.findSymbol(loc, original_name) catch unreachable;
var _ident = ident;
_ident.ref = result.ref;
- return p.e(_ident, loc);
+ return p.newExpr(_ident, loc);
}
- return p.e(ident, loc);
+ return p.newExpr(ident, loc);
}
pub fn generateImportStmt(
@@ -4516,7 +4520,7 @@ fn NewParser_(
.name = LocRef{ .ref = ref, .loc = logger.Loc{} },
};
declared_symbols[i] = js_ast.DeclaredSymbol{ .ref = ref, .is_top_level = true };
- try p.is_import_item.put(allocator, ref, .{});
+ try p.is_import_item.put(allocator, ref, {});
try p.named_imports.put(ref, js_ast.NamedImport{
.alias = alias_name,
.alias_loc = logger.Loc{},
@@ -5381,7 +5385,7 @@ fn NewParser_(
// Sanity-check that the scopes generated by the first and second passes match
if (order.loc.start != loc.start or order.scope.kind != kind) {
- p.panic("Expected scope ({s}, {d}) in {s}, found scope ({s}, {d})", .{ kind, loc.start, p.source.path.pretty, order.scope.kind, order.loc.start });
+ p.panic("Expected scope ({any}, {d}) in {s}, found scope ({any}, {d})", .{ kind, loc.start, p.source.path.pretty, order.scope.kind, order.loc.start });
}
p.current_scope = order.scope;
@@ -5536,7 +5540,7 @@ fn NewParser_(
.is_spread = is_spread,
.is_computed = item.flags.contains(.is_computed),
}),
- .key = item.key orelse p.e(E.Missing{}, expr.loc),
+ .key = item.key orelse p.newExpr(E.Missing{}, expr.loc),
.value = tup.binding orelse p.b(B.Missing{}, expr.loc),
.default_value = initializer,
});
@@ -6512,14 +6516,14 @@ fn NewParser_(
if (stmt.default_name) |name_loc| {
const name = p.loadNameFromRef(name_loc.ref.?);
const ref = try p.declareSymbol(.other, name_loc.loc, name);
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
try p.macro.refs.put(ref, id);
}
for (stmt.items) |item| {
const name = p.loadNameFromRef(item.name.ref.?);
const ref = try p.declareSymbol(.other, item.name.loc, name);
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
try p.macro.refs.put(ref, id);
}
@@ -6535,7 +6539,7 @@ fn NewParser_(
if (strings.eqlComptime(item.alias, "plugin")) {
const name = p.loadNameFromRef(item.name.ref.?);
const ref = try p.declareSymbol(.other, item.name.loc, name);
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
p.bun_plugin.ref = ref;
plugin_i = i;
break;
@@ -6601,7 +6605,7 @@ fn NewParser_(
const name = p.loadNameFromRef(name_loc.ref.?);
const ref = try p.declareSymbol(.import, name_loc.loc, name);
name_loc.ref = ref;
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
if (macro_remap) |*remap| {
if (remap.get("default")) |remapped_path| {
@@ -6652,7 +6656,7 @@ fn NewParser_(
const ref = try p.declareSymbol(.import, item.name.loc, name);
item.name.ref = ref;
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
p.checkForNonBMPCodePoint(item.alias_loc, item.alias);
if (macro_remap) |*remap| {
@@ -8354,8 +8358,8 @@ fn NewParser_(
// This assumes the caller has already parsed the "import" token
fn importMetaRequire(p: *P, loc: logger.Loc) Expr {
- return p.e(E.Dot{
- .target = p.e(E.ImportMeta{}, loc),
+ return p.newExpr(E.Dot{
+ .target = p.newExpr(E.ImportMeta{}, loc),
.name = "require",
.name_loc = loc,
}, loc);
@@ -8366,19 +8370,19 @@ fn NewParser_(
const kind = S.Local.Kind.k_const;
const name = p.lexer.identifier;
- const target = p.e(E.Identifier{ .ref = p.storeNameInRef(name) catch unreachable }, p.lexer.loc());
+ const target = p.newExpr(E.Identifier{ .ref = p.storeNameInRef(name) catch unreachable }, p.lexer.loc());
var value = target;
try p.lexer.expect(.t_identifier);
if (strings.eqlComptime(name, "require") and p.lexer.token == .t_open_paren) {
// "import ns = require('x')"
try p.lexer.next();
- const path = p.e(p.lexer.toEString(), p.lexer.loc());
+ const path = p.newExpr(p.lexer.toEString(), p.lexer.loc());
try p.lexer.expect(.t_string_literal);
try p.lexer.expect(.t_close_paren);
if (!opts.is_typescript_declare) {
const args = try ExprNodeList.one(p.allocator, path);
- value = p.e(E.Call{ .target = target, .close_paren_loc = p.lexer.loc(), .args = args }, loc);
+ value = p.newExpr(E.Call{ .target = target, .close_paren_loc = p.lexer.loc(), .args = args }, loc);
}
} else {
// "import Foo = Bar"
@@ -8386,7 +8390,7 @@ fn NewParser_(
var prev_value = value;
while (p.lexer.token == .t_dot) : (prev_value = value) {
try p.lexer.next();
- value = p.e(E.Dot{ .target = prev_value, .name = p.lexer.identifier, .name_loc = p.lexer.loc() }, loc);
+ value = p.newExpr(E.Dot{ .target = prev_value, .name = p.lexer.identifier, .name_loc = p.lexer.loc() }, loc);
try p.lexer.expect(.t_identifier);
}
}
@@ -8644,7 +8648,7 @@ fn NewParser_(
}
const ref = p.storeNameInRef(raw) catch unreachable;
- const expr = p.e(E.Identifier{ .ref = ref }, let_range.loc);
+ const expr = p.newExpr(E.Identifier{ .ref = ref }, let_range.loc);
return ExprOrLetStmt{ .stmt_or_expr = js_ast.StmtOrExpr{ .expr = try p.parseSuffix(expr, .lowest, null, Expr.EFlags.none) } };
}
@@ -8817,14 +8821,14 @@ fn NewParser_(
);
try p.lexer.expect(.t_identifier);
return B.Property{
- .key = p.e(E.Missing{}, p.lexer.loc()),
+ .key = p.newExpr(E.Missing{}, p.lexer.loc()),
.flags = Flags.Property.init(.{ .is_spread = true }),
.value = value,
};
},
.t_numeric_literal => {
- key = p.e(E.Number{
+ key = p.newExpr(E.Number{
.value = p.lexer.number,
}, p.lexer.loc());
// check for legacy octal literal
@@ -8834,7 +8838,7 @@ fn NewParser_(
key = try p.parseStringLiteral();
},
.t_big_integer_literal => {
- key = p.e(E.BigInt{
+ key = p.newExpr(E.BigInt{
.value = p.lexer.identifier,
}, p.lexer.loc());
// p.markSyntaxFeature(compat.BigInt, p.lexer.Range())
@@ -8856,7 +8860,7 @@ fn NewParser_(
try p.lexer.next();
- key = p.e(E.String{ .data = name }, loc);
+ key = p.newExpr(E.String{ .data = name }, loc);
if (p.lexer.token != .t_colon and p.lexer.token != .t_open_paren) {
const ref = p.storeNameInRef(name) catch unreachable;
@@ -9054,7 +9058,7 @@ fn NewParser_(
return p.s(S.Enum{
.name = name,
.arg = arg_ref,
- .values = values.toOwnedSlice(),
+ .values = try values.toOwnedSlice(),
.is_export = opts.is_export,
}, loc);
}
@@ -9372,7 +9376,7 @@ fn NewParser_(
}
}
- return stmts.toOwnedSlice();
+ return try stmts.toOwnedSlice();
}
fn markStrictModeFeature(p: *P, feature: StrictModeFeature, r: logger.Range, detail: string) !void {
@@ -9484,7 +9488,7 @@ fn NewParser_(
}
fn declareSymbol(p: *P, kind: Symbol.Kind, loc: logger.Loc, name: string) !Ref {
- return try @call(.{ .modifier = .always_inline }, declareSymbolMaybeGenerated, .{ p, kind, loc, name, false });
+ return try @call(.always_inline, declareSymbolMaybeGenerated, .{ p, kind, loc, name, false });
}
fn declareSymbolMaybeGenerated(p: *P, kind: Symbol.Kind, loc: logger.Loc, name: string, comptime is_generated: bool) !Ref {
@@ -9554,7 +9558,7 @@ fn NewParser_(
} else {
// Ensure that EImportIdentifier is created for the symbol in handleIdentifier
if (symbol.kind == .import and kind != .import) {
- try p.is_import_item.put(p.allocator, ref, .{});
+ try p.is_import_item.put(p.allocator, ref, {});
}
p.symbols.items[ref.innerIndex()].link = existing.ref;
@@ -9633,7 +9637,7 @@ fn NewParser_(
p.validateFunctionName(func, .expr);
p.popScope();
- return p.e(js_ast.E.Function{
+ return p.newExpr(js_ast.E.Function{
.func = func,
}, loc);
}
@@ -9799,7 +9803,7 @@ fn NewParser_(
var data = FnOrArrowDataParse{};
var arrow_body = try p.parseArrowBody(args, &data);
p.popScope();
- return p.e(arrow_body, async_range.loc);
+ return p.newExpr(arrow_body, async_range.loc);
}
},
// "async x => {}"
@@ -9825,7 +9829,7 @@ fn NewParser_(
};
var arrowBody = try p.parseArrowBody(args, &data);
arrowBody.is_async = true;
- return p.e(arrowBody, async_range.loc);
+ return p.newExpr(arrowBody, async_range.loc);
}
},
@@ -9851,7 +9855,7 @@ fn NewParser_(
// "async"
// "async + 1"
- return p.e(
+ return p.newExpr(
E.Identifier{ .ref = try p.storeNameInRef("async") },
async_range.loc,
);
@@ -10082,7 +10086,7 @@ fn NewParser_(
},
}
- return p.e(E.Yield{
+ return p.newExpr(E.Yield{
.value = value,
.is_star = isStar,
}, loc);
@@ -10095,7 +10099,7 @@ fn NewParser_(
switch (p.lexer.token) {
.t_numeric_literal => {
- key = p.e(E.Number{
+ key = p.newExpr(E.Number{
.value = p.lexer.number,
}, p.lexer.loc());
// p.checkForLegacyOctalLiteral()
@@ -10105,7 +10109,7 @@ fn NewParser_(
key = try p.parseStringLiteral();
},
.t_big_integer_literal => {
- key = p.e(E.BigInt{ .value = p.lexer.identifier }, p.lexer.loc());
+ key = p.newExpr(E.BigInt{ .value = p.lexer.identifier }, p.lexer.loc());
// markSyntaxFeature
try p.lexer.next();
},
@@ -10114,7 +10118,7 @@ fn NewParser_(
try p.lexer.expected(.t_identifier);
}
- key = p.e(E.PrivateIdentifier{ .ref = p.storeNameInRef(p.lexer.identifier) catch unreachable }, p.lexer.loc());
+ key = p.newExpr(E.PrivateIdentifier{ .ref = p.storeNameInRef(p.lexer.identifier) catch unreachable }, p.lexer.loc());
try p.lexer.next();
},
.t_open_bracket => {
@@ -10255,7 +10259,7 @@ fn NewParser_(
}
}
- key = p.e(E.String{ .data = name }, name_range.loc);
+ key = p.newExpr(E.String{ .data = name }, name_range.loc);
// Parse a shorthand property
const isShorthandProperty = !opts.is_class and
@@ -10281,7 +10285,7 @@ fn NewParser_(
}
const ref = p.storeNameInRef(name) catch unreachable;
- const value = p.e(E.Identifier{ .ref = ref }, key.loc);
+ const value = p.newExpr(E.Identifier{ .ref = ref }, key.loc);
// Destructuring patterns have an optional default value
var initializer: ?Expr = null;
@@ -10455,7 +10459,7 @@ fn NewParser_(
p.popScope();
func.flags.insert(.is_unique_formal_parameters);
- const value = p.e(E.Function{ .func = func }, loc);
+ const value = p.newExpr(E.Function{ .func = func }, loc);
// Enforce argument rules for accessors
switch (kind) {
@@ -10618,7 +10622,7 @@ fn NewParser_(
// Forbid decorators on class constructors
if (opts.ts_decorators.len > 0) {
- switch ((property.key orelse p.panic("Internal error: Expected property {s} to have a key.", .{property})).data) {
+ switch ((property.key orelse p.panic("Internal error: Expected property {any} to have a key.", .{property})).data) {
.e_string => |str| {
if (str.eqlComptime("constructor")) {
p.log.addError(p.source, first_decorator_loc, "TypeScript does not allow decorators on class constructors") catch unreachable;
@@ -10650,7 +10654,7 @@ fn NewParser_(
.ts_decorators = ExprNodeList.init(class_opts.ts_decorators),
.class_keyword = class_keyword,
.body_loc = body_loc,
- .properties = properties.toOwnedSlice(),
+ .properties = try properties.toOwnedSlice(),
.has_decorators = has_decorators or class_opts.ts_decorators.len > 0,
};
}
@@ -10709,7 +10713,7 @@ fn NewParser_(
p.allow_in = oldAllowIn;
- return parts.toOwnedSlice();
+ return try parts.toOwnedSlice();
}
// This assumes the caller has already checked for TStringLiteral or TNoSubstitutionTemplateLiteral
@@ -10718,7 +10722,7 @@ fn NewParser_(
var str = p.lexer.toEString();
str.prefer_template = p.lexer.token == .t_no_substitution_template_literal;
- const expr = p.e(str, loc);
+ const expr = p.newExpr(str, loc);
try p.lexer.next();
return expr;
}
@@ -10741,7 +10745,7 @@ fn NewParser_(
}
var arg = try p.parseExpr(.comma);
if (is_spread) {
- arg = p.e(E.Spread{ .value = arg }, loc);
+ arg = p.newExpr(E.Spread{ .value = arg }, loc);
}
args.append(arg) catch unreachable;
if (p.lexer.token != .t_comma) {
@@ -10767,7 +10771,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{
+ left = p.newExpr(E.Binary{
.op = .bin_comma,
.left = left,
.right = try p.parseExpr(.comma),
@@ -10808,9 +10812,9 @@ fn NewParser_(
const name_loc = p.lexer.loc();
try p.lexer.next();
const ref = p.storeNameInRef(name) catch unreachable;
- left = p.e(E.Index{
+ left = p.newExpr(E.Index{
.target = left,
- .index = p.e(
+ .index = p.newExpr(
E.PrivateIdentifier{
.ref = ref,
},
@@ -10829,7 +10833,7 @@ fn NewParser_(
const name_loc = p.lexer.loc();
try p.lexer.next();
- left = p.e(E.Dot{ .target = left, .name = name, .name_loc = name_loc, .optional_chain = old_optional_chain }, left.loc);
+ left = p.newExpr(E.Dot{ .target = left, .name = name, .name_loc = name_loc, .optional_chain = old_optional_chain }, left.loc);
}
optional_chain = old_optional_chain;
@@ -10859,7 +10863,7 @@ fn NewParser_(
p.allow_in = old_allow_in;
try p.lexer.expect(.t_close_bracket);
- left = p.e(
+ left = p.newExpr(
E.Index{ .target = left, .index = index, .optional_chain = optional_start },
left.loc,
);
@@ -10872,7 +10876,7 @@ fn NewParser_(
}
const list_loc = try p.parseCallArgs();
- left = p.e(E.Call{
+ left = p.newExpr(E.Call{
.target = left,
.args = list_loc.list,
.close_paren_loc = list_loc.loc,
@@ -10896,7 +10900,7 @@ fn NewParser_(
}
const list_loc = try p.parseCallArgs();
- left = p.e(E.Call{
+ left = p.newExpr(E.Call{
.target = left,
.args = list_loc.list,
.close_paren_loc = list_loc.loc,
@@ -10910,9 +10914,9 @@ fn NewParser_(
const name_loc = p.lexer.loc();
try p.lexer.next();
const ref = p.storeNameInRef(name) catch unreachable;
- left = p.e(E.Index{
+ left = p.newExpr(E.Index{
.target = left,
- .index = p.e(
+ .index = p.newExpr(
E.PrivateIdentifier{
.ref = ref,
},
@@ -10929,7 +10933,7 @@ fn NewParser_(
const name_loc = p.lexer.loc();
try p.lexer.next();
- left = p.e(E.Dot{
+ left = p.newExpr(E.Dot{
.target = left,
.name = name,
.name_loc = name_loc,
@@ -10951,7 +10955,7 @@ fn NewParser_(
// p.markSyntaxFeature(compat.TemplateLiteral, p.lexer.Range());
const head = p.lexer.toEString();
try p.lexer.next();
- left = p.e(E.Template{
+ left = p.newExpr(E.Template{
.tag = left,
.head = head,
}, left.loc);
@@ -10964,7 +10968,7 @@ fn NewParser_(
const head = p.lexer.toEString();
const partsGroup = try p.parseTemplateParts(true);
const tag = left;
- left = p.e(E.Template{ .tag = tag, .head = head, .parts = partsGroup }, left.loc);
+ left = p.newExpr(E.Template{ .tag = tag, .head = head, .parts = partsGroup }, left.loc);
},
.t_open_bracket => {
// When parsing a decorator, ignore EIndex expressions since they may be
@@ -10991,7 +10995,7 @@ fn NewParser_(
try p.lexer.expect(.t_close_bracket);
- left = p.e(E.Index{
+ left = p.newExpr(E.Index{
.target = left,
.index = index,
.optional_chain = old_optional_chain,
@@ -11004,7 +11008,7 @@ fn NewParser_(
}
const list_loc = try p.parseCallArgs();
- left = p.e(
+ left = p.newExpr(
E.Call{
.target = left,
.args = list_loc.list,
@@ -11047,7 +11051,7 @@ fn NewParser_(
try p.lexer.expect(.t_colon);
const no = try p.parseExpr(.comma);
- left = p.e(E.If{
+ left = p.newExpr(E.If{
.test_ = left,
.yes = yes,
.no = no,
@@ -11077,7 +11081,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Unary{ .op = .un_post_dec, .value = left }, left.loc);
+ left = p.newExpr(E.Unary{ .op = .un_post_dec, .value = left }, left.loc);
},
.t_plus_plus => {
if (p.lexer.has_newline_before or level.gte(.postfix)) {
@@ -11085,7 +11089,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Unary{ .op = .un_post_inc, .value = left }, left.loc);
+ left = p.newExpr(E.Unary{ .op = .un_post_inc, .value = left }, left.loc);
},
.t_comma => {
if (level.gte(.comma)) {
@@ -11093,7 +11097,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_comma, .left = left, .right = try p.parseExpr(.comma) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_comma, .left = left, .right = try p.parseExpr(.comma) }, left.loc);
},
.t_plus => {
if (level.gte(.add)) {
@@ -11101,7 +11105,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_add, .left = left, .right = try p.parseExpr(.add) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_add, .left = left, .right = try p.parseExpr(.add) }, left.loc);
},
.t_plus_equals => {
if (level.gte(.assign)) {
@@ -11109,7 +11113,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_add_assign, .left = left, .right = try p.parseExpr(@intToEnum(Op.Level, @enumToInt(Op.Level.assign) - 1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_add_assign, .left = left, .right = try p.parseExpr(@intToEnum(Op.Level, @enumToInt(Op.Level.assign) - 1)) }, left.loc);
},
.t_minus => {
if (level.gte(.add)) {
@@ -11117,7 +11121,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_sub, .left = left, .right = try p.parseExpr(.add) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_sub, .left = left, .right = try p.parseExpr(.add) }, left.loc);
},
.t_minus_equals => {
if (level.gte(.assign)) {
@@ -11125,7 +11129,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_sub_assign, .left = left, .right = try p.parseExpr(Op.Level.sub(Op.Level.assign, 1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_sub_assign, .left = left, .right = try p.parseExpr(Op.Level.sub(Op.Level.assign, 1)) }, left.loc);
},
.t_asterisk => {
if (level.gte(.multiply)) {
@@ -11133,7 +11137,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_mul, .left = left, .right = try p.parseExpr(.multiply) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_mul, .left = left, .right = try p.parseExpr(.multiply) }, left.loc);
},
.t_asterisk_asterisk => {
if (level.gte(.exponentiation)) {
@@ -11141,7 +11145,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_pow, .left = left, .right = try p.parseExpr(Op.Level.exponentiation.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_pow, .left = left, .right = try p.parseExpr(Op.Level.exponentiation.sub(1)) }, left.loc);
},
.t_asterisk_asterisk_equals => {
if (level.gte(.assign)) {
@@ -11149,7 +11153,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_pow_assign, .left = left, .right = try p.parseExpr(Op.Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_pow_assign, .left = left, .right = try p.parseExpr(Op.Level.assign.sub(1)) }, left.loc);
},
.t_asterisk_equals => {
if (level.gte(.assign)) {
@@ -11157,7 +11161,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_mul_assign, .left = left, .right = try p.parseExpr(Op.Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_mul_assign, .left = left, .right = try p.parseExpr(Op.Level.assign.sub(1)) }, left.loc);
},
.t_percent => {
if (level.gte(.multiply)) {
@@ -11165,7 +11169,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_rem, .left = left, .right = try p.parseExpr(Op.Level.multiply) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_rem, .left = left, .right = try p.parseExpr(Op.Level.multiply) }, left.loc);
},
.t_percent_equals => {
if (level.gte(.assign)) {
@@ -11173,7 +11177,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_rem_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_rem_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_slash => {
if (level.gte(.multiply)) {
@@ -11181,7 +11185,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_div, .left = left, .right = try p.parseExpr(Level.multiply) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_div, .left = left, .right = try p.parseExpr(Level.multiply) }, left.loc);
},
.t_slash_equals => {
if (level.gte(.assign)) {
@@ -11189,7 +11193,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_div_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_div_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_equals_equals => {
if (level.gte(.equals)) {
@@ -11197,7 +11201,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_loose_eq, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_loose_eq, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
},
.t_exclamation_equals => {
if (level.gte(.equals)) {
@@ -11205,7 +11209,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_loose_ne, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_loose_ne, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
},
.t_equals_equals_equals => {
if (level.gte(.equals)) {
@@ -11213,7 +11217,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_strict_eq, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_strict_eq, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
},
.t_exclamation_equals_equals => {
if (level.gte(.equals)) {
@@ -11221,7 +11225,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_strict_ne, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_strict_ne, .left = left, .right = try p.parseExpr(Level.equals) }, left.loc);
},
.t_less_than => {
// TypeScript allows type arguments to be specified with angle brackets
@@ -11236,35 +11240,35 @@ fn NewParser_(
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_lt, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_lt, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
.t_less_than_equals => {
if (level.gte(.compare)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_le, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_le, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
.t_greater_than => {
if (level.gte(.compare)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_gt, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_gt, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
.t_greater_than_equals => {
if (level.gte(.compare)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_ge, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_ge, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
.t_less_than_less_than => {
if (level.gte(.shift)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_shl, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_shl, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
},
.t_less_than_less_than_equals => {
if (level.gte(.assign)) {
@@ -11272,14 +11276,14 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_shl_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_shl_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_greater_than_greater_than => {
if (level.gte(.shift)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_shr, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_shr, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
},
.t_greater_than_greater_than_equals => {
if (level.gte(.assign)) {
@@ -11287,14 +11291,14 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_shr_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_shr_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_greater_than_greater_than_greater_than => {
if (level.gte(.shift)) {
return left;
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_u_shr, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_u_shr, .left = left, .right = try p.parseExpr(.shift) }, left.loc);
},
.t_greater_than_greater_than_greater_than_equals => {
if (level.gte(.assign)) {
@@ -11302,7 +11306,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_u_shr_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_u_shr_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_question_question => {
if (level.gte(.nullish_coalescing)) {
@@ -11310,7 +11314,7 @@ fn NewParser_(
}
try p.lexer.next();
const prev = left;
- left = p.e(E.Binary{ .op = .bin_nullish_coalescing, .left = prev, .right = try p.parseExpr(.nullish_coalescing) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_nullish_coalescing, .left = prev, .right = try p.parseExpr(.nullish_coalescing) }, left.loc);
},
.t_question_question_equals => {
if (level.gte(.assign)) {
@@ -11318,7 +11322,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_nullish_coalescing_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_nullish_coalescing_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_bar_bar => {
if (level.gte(.logical_or)) {
@@ -11333,10 +11337,10 @@ fn NewParser_(
try p.lexer.next();
const right = try p.parseExpr(.logical_or);
- left = p.e(E.Binary{ .op = Op.Code.bin_logical_or, .left = left, .right = right }, left.loc);
+ left = p.newExpr(E.Binary{ .op = Op.Code.bin_logical_or, .left = left, .right = right }, left.loc);
if (level.lt(.nullish_coalescing)) {
- left = try p.parseSuffix(left, Level.nullish_coalescing.add(1), null, flags);
+ left = try p.parseSuffix(left, Level.nullish_coalescing.addF(1), null, flags);
if (p.lexer.token == .t_question_question) {
try p.lexer.unexpected();
@@ -11350,7 +11354,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_logical_or_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_logical_or_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_ampersand_ampersand => {
if (level.gte(.logical_and)) {
@@ -11364,11 +11368,11 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_logical_and, .left = left, .right = try p.parseExpr(.logical_and) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_logical_and, .left = left, .right = try p.parseExpr(.logical_and) }, left.loc);
// Prevent "&&" inside "??" from the left
if (level.lt(.nullish_coalescing)) {
- left = try p.parseSuffix(left, Level.nullish_coalescing.add(1), null, flags);
+ left = try p.parseSuffix(left, Level.nullish_coalescing.addF(1), null, flags);
if (p.lexer.token == .t_question_question) {
try p.lexer.unexpected();
@@ -11382,7 +11386,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_logical_and_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_logical_and_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_bar => {
if (level.gte(.bitwise_or)) {
@@ -11390,7 +11394,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_or, .left = left, .right = try p.parseExpr(.bitwise_or) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_or, .left = left, .right = try p.parseExpr(.bitwise_or) }, left.loc);
},
.t_bar_equals => {
if (level.gte(.assign)) {
@@ -11398,7 +11402,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_or_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_or_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_ampersand => {
if (level.gte(.bitwise_and)) {
@@ -11406,7 +11410,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_and, .left = left, .right = try p.parseExpr(.bitwise_and) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_and, .left = left, .right = try p.parseExpr(.bitwise_and) }, left.loc);
},
.t_ampersand_equals => {
if (level.gte(.assign)) {
@@ -11414,7 +11418,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_and_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_and_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_caret => {
if (level.gte(.bitwise_xor)) {
@@ -11422,7 +11426,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_xor, .left = left, .right = try p.parseExpr(.bitwise_xor) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_xor, .left = left, .right = try p.parseExpr(.bitwise_xor) }, left.loc);
},
.t_caret_equals => {
if (level.gte(.assign)) {
@@ -11430,7 +11434,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_bitwise_xor_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_bitwise_xor_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_equals => {
if (level.gte(.assign)) {
@@ -11439,7 +11443,7 @@ fn NewParser_(
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_assign, .left = left, .right = try p.parseExpr(Level.assign.sub(1)) }, left.loc);
},
.t_in => {
if (level.gte(.compare) or !p.allow_in) {
@@ -11458,7 +11462,7 @@ fn NewParser_(
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_in, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_in, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
.t_instanceof => {
if (level.gte(.compare)) {
@@ -11479,7 +11483,7 @@ fn NewParser_(
}
}
try p.lexer.next();
- left = p.e(E.Binary{ .op = .bin_instanceof, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
+ left = p.newExpr(E.Binary{ .op = .bin_instanceof, .left = left, .right = try p.parseExpr(.compare) }, left.loc);
},
else => {
// Handle the TypeScript "as" operator
@@ -11554,7 +11558,7 @@ fn NewParser_(
const name_ref = p.declareSymbol(.import, this.loc, clause.original_name) catch unreachable;
clause.name = LocRef{ .loc = this.loc, .ref = name_ref };
- p.is_import_item.putAssumeCapacity(name_ref, .{});
+ p.is_import_item.putAssumeCapacity(name_ref, {});
p.macro.imports.putAssumeCapacity(js_ast.Macro.JSNode.SymbolMap.generateImportHash(import_hash_name, import_data.path), name_ref);
@@ -11590,19 +11594,19 @@ fn NewParser_(
switch (p.lexer.token) {
.t_open_paren => {
if (l < @enumToInt(Level.call) and p.fn_or_arrow_data_parse.allow_super_call) {
- return p.e(E.Super{}, loc);
+ return p.newExpr(E.Super{}, loc);
}
},
.t_dot, .t_open_bracket => {
if (p.fn_or_arrow_data_parse.allow_super_property) {
- return p.e(E.Super{}, loc);
+ return p.newExpr(E.Super{}, loc);
}
},
else => {},
}
p.log.addRangeError(p.source, superRange, "Unexpected \"super\"") catch unreachable;
- return p.e(E.Super{}, loc);
+ return p.newExpr(E.Super{}, loc);
},
.t_open_paren => {
try p.lexer.next();
@@ -11625,15 +11629,15 @@ fn NewParser_(
},
.t_false => {
try p.lexer.next();
- return p.e(E.Boolean{ .value = false }, loc);
+ return p.newExpr(E.Boolean{ .value = false }, loc);
},
.t_true => {
try p.lexer.next();
- return p.e(E.Boolean{ .value = true }, loc);
+ return p.newExpr(E.Boolean{ .value = true }, loc);
},
.t_null => {
try p.lexer.next();
- return p.e(E.Null{}, loc);
+ return p.newExpr(E.Null{}, loc);
},
.t_this => {
if (p.fn_or_arrow_data_parse.is_this_disallowed) {
@@ -11656,7 +11660,7 @@ fn NewParser_(
try p.lexer.expected(.t_in);
}
- return p.e(E.PrivateIdentifier{ .ref = try p.storeNameInRef(name) }, loc);
+ return p.newExpr(E.PrivateIdentifier{ .ref = try p.storeNameInRef(name) }, loc);
},
.t_identifier => {
const name = p.lexer.identifier;
@@ -11696,7 +11700,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Await{ .value = value }, loc);
+ return p.newExpr(E.Await{ .value = value }, loc);
}
},
else => {},
@@ -11754,7 +11758,7 @@ fn NewParser_(
defer p.popScope();
var fn_or_arrow_data = FnOrArrowDataParse{};
- const ret = p.e(try p.parseArrowBody(args, &fn_or_arrow_data), loc);
+ const ret = p.newExpr(try p.parseArrowBody(args, &fn_or_arrow_data), loc);
return ret;
}
@@ -11773,13 +11777,13 @@ fn NewParser_(
// Check if TemplateLiteral is unsupported. We don't care for this product.`
// if ()
- return p.e(E.Template{
+ return p.newExpr(E.Template{
.head = head,
.parts = parts,
}, loc);
},
.t_numeric_literal => {
- const value = p.e(E.Number{ .value = p.lexer.number }, loc);
+ const value = p.newExpr(E.Number{ .value = p.lexer.number }, loc);
// p.checkForLegacyOctalLiteral()
try p.lexer.next();
return value;
@@ -11788,7 +11792,7 @@ fn NewParser_(
const value = p.lexer.identifier;
// markSyntaxFeature bigInt
try p.lexer.next();
- return p.e(E.BigInt{ .value = value }, loc);
+ return p.newExpr(E.BigInt{ .value = value }, loc);
},
.t_slash, .t_slash_equals => {
try p.lexer.scanRegExp();
@@ -11797,7 +11801,7 @@ fn NewParser_(
const value = p.lexer.raw();
try p.lexer.next();
- return p.e(E.RegExp{ .value = value, .flags_offset = p.lexer.regex_flags_start }, loc);
+ return p.newExpr(E.RegExp{ .value = value, .flags_offset = p.lexer.regex_flags_start }, loc);
},
.t_void => {
try p.lexer.next();
@@ -11807,7 +11811,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{
+ return p.newExpr(E.Unary{
.op = .un_void,
.value = value,
}, loc);
@@ -11820,7 +11824,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{ .op = .un_typeof, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_typeof, .value = value }, loc);
},
.t_delete => {
try p.lexer.next();
@@ -11838,7 +11842,7 @@ fn NewParser_(
}
}
- return p.e(E.Unary{ .op = .un_delete, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_delete, .value = value }, loc);
},
.t_plus => {
try p.lexer.next();
@@ -11848,7 +11852,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{ .op = .un_pos, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_pos, .value = value }, loc);
},
.t_minus => {
try p.lexer.next();
@@ -11858,7 +11862,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{ .op = .un_neg, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_neg, .value = value }, loc);
},
.t_tilde => {
try p.lexer.next();
@@ -11868,7 +11872,7 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{ .op = .un_cpl, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_cpl, .value = value }, loc);
},
.t_exclamation => {
try p.lexer.next();
@@ -11878,15 +11882,15 @@ fn NewParser_(
return error.SyntaxError;
}
- return p.e(E.Unary{ .op = .un_not, .value = value }, loc);
+ return p.newExpr(E.Unary{ .op = .un_not, .value = value }, loc);
},
.t_minus_minus => {
try p.lexer.next();
- return p.e(E.Unary{ .op = .un_pre_dec, .value = try p.parseExpr(.prefix) }, loc);
+ return p.newExpr(E.Unary{ .op = .un_pre_dec, .value = try p.parseExpr(.prefix) }, loc);
},
.t_plus_plus => {
try p.lexer.next();
- return p.e(E.Unary{ .op = .un_pre_inc, .value = try p.parseExpr(.prefix) }, loc);
+ return p.newExpr(E.Unary{ .op = .un_pre_inc, .value = try p.parseExpr(.prefix) }, loc);
},
.t_function => {
return try p.parseFnExpr(loc, false, logger.Range.None);
@@ -11926,7 +11930,7 @@ fn NewParser_(
const class = try p.parseClass(classKeyword, name, ParseClassOptions{});
p.popScope();
- return p.e(class, loc);
+ return p.newExpr(class, loc);
},
.t_new => {
try p.lexer.next();
@@ -11942,7 +11946,7 @@ fn NewParser_(
const range = logger.Range{ .loc = loc, .len = p.lexer.range().end().start - loc.start };
try p.lexer.next();
- return p.e(E.NewTarget{ .range = range }, loc);
+ return p.newExpr(E.NewTarget{ .range = range }, loc);
}
const target = try p.parseExprWithFlags(.member, flags);
@@ -11967,7 +11971,7 @@ fn NewParser_(
close_parens_loc = call_args.loc;
}
- return p.e(E.New{
+ return p.newExpr(E.New{
.target = target,
.args = args,
.close_parens_loc = close_parens_loc,
@@ -11996,7 +12000,7 @@ fn NewParser_(
const dots_loc = p.lexer.loc();
try p.lexer.next();
items.append(
- p.e(E.Spread{ .value = try p.parseExprOrBindings(.comma, &self_errors) }, dots_loc),
+ p.newExpr(E.Spread{ .value = try p.parseExprOrBindings(.comma, &self_errors) }, dots_loc),
) catch unreachable;
// Commas are not allowed here when destructuring
@@ -12044,7 +12048,7 @@ fn NewParser_(
// In this case, we can't distinguish between the two yet
self_errors.mergeInto(errors.?);
}
- return p.e(E.Array{
+ return p.newExpr(E.Array{
.items = ExprNodeList.fromList(items),
.comma_after_spread = comma_after_spread.toNullable(),
.is_single_line = is_single_line,
@@ -12115,7 +12119,7 @@ fn NewParser_(
self_errors.mergeInto(errors.?);
}
- return p.e(E.Object{
+ return p.newExpr(E.Object{
.properties = G.Property.List.fromList(properties),
.comma_after_spread = if (comma_after_spread.start > 0)
comma_after_spread
@@ -12235,7 +12239,7 @@ fn NewParser_(
// do people do <API_URL>?
fn jsxRefToMemberExpression(p: *P, loc: logger.Loc, ref: Ref) Expr {
p.recordUsage(ref);
- return p.e(E.Identifier{
+ return p.newExpr(E.Identifier{
.ref = ref,
.can_be_removed_if_unused = true,
.call_can_be_unwrapped_if_unused = true,
@@ -12277,7 +12281,7 @@ fn NewParser_(
)) |rewrote| {
value = rewrote;
} else {
- value = p.e(
+ value = p.newExpr(
E.Dot{
.target = value,
.name = part,
@@ -12302,7 +12306,7 @@ fn NewParser_(
if (p.lexer.isContextualKeyword("meta")) {
try p.lexer.next();
p.has_import_meta = true;
- return p.e(E.ImportMeta{}, loc);
+ return p.newExpr(E.ImportMeta{}, loc);
} else {
try p.lexer.expectedString("\"meta\"");
}
@@ -12319,7 +12323,7 @@ fn NewParser_(
p.lexer.preserve_all_comments_before = true;
try p.lexer.expect(.t_open_paren);
- const comments = p.lexer.comments_to_preserve_before.toOwnedSlice();
+ const comments = try p.lexer.comments_to_preserve_before.toOwnedSlice();
p.lexer.preserve_all_comments_before = false;
const value = try p.parseExpr(.comma);
@@ -12348,7 +12352,7 @@ fn NewParser_(
if (value.data == .e_string and value.data.e_string.isUTF8() and value.data.e_string.isPresent()) {
const import_record_index = p.addImportRecord(.dynamic, value.loc, value.data.e_string.slice(p.allocator));
- return p.e(E.Import{
+ return p.newExpr(E.Import{
.expr = value,
.leading_interior_comments = comments,
.import_record_index = import_record_index,
@@ -12356,7 +12360,7 @@ fn NewParser_(
}
}
- return p.e(E.Import{ .expr = value, .leading_interior_comments = comments, .import_record_index = 0 }, loc);
+ return p.newExpr(E.Import{ .expr = value, .leading_interior_comments = comments, .import_record_index = 0 }, loc);
}
fn parseJSXPropValueIdentifier(p: *P, previous_string_with_backslash_loc: *logger.Loc) !Expr {
@@ -12364,7 +12368,7 @@ fn NewParser_(
try p.lexer.nextInsideJSXElement();
if (p.lexer.token == .t_string_literal) {
previous_string_with_backslash_loc.start = std.math.max(p.lexer.loc().start, p.lexer.previous_backslash_quote_in_jsx.loc.start);
- const expr = p.e(p.lexer.toEString(), previous_string_with_backslash_loc.*);
+ const expr = p.newExpr(p.lexer.toEString(), previous_string_with_backslash_loc.*);
try p.lexer.nextInsideJSXElement();
return expr;
@@ -12434,7 +12438,7 @@ fn NewParser_(
can_be_inlined = can_be_inlined and special_prop != .ref;
- const prop_name = p.e(E.String{ .data = prop_name_literal }, key_range.loc);
+ const prop_name = p.newExpr(E.String{ .data = prop_name_literal }, key_range.loc);
// Parse the value
var value: Expr = undefined;
@@ -12442,7 +12446,7 @@ fn NewParser_(
// Implicitly true value
// <button selected>
- value = p.e(E.Boolean{ .value = true }, logger.Loc{ .start = key_range.loc.start + key_range.len });
+ value = p.newExpr(E.Boolean{ .value = true }, logger.Loc{ .start = key_range.loc.start + key_range.len });
} else {
value = try p.parseJSXPropValueIdentifier(&previous_string_with_backslash_loc);
}
@@ -12475,13 +12479,13 @@ fn NewParser_(
const key = brk: {
switch (expr.data) {
.e_import_identifier => |ident| {
- break :brk p.e(E.String{ .data = p.loadNameFromRef(ident.ref) }, expr.loc);
+ break :brk p.newExpr(E.String{ .data = p.loadNameFromRef(ident.ref) }, expr.loc);
},
.e_identifier => |ident| {
- break :brk p.e(E.String{ .data = p.loadNameFromRef(ident.ref) }, expr.loc);
+ break :brk p.newExpr(E.String{ .data = p.loadNameFromRef(ident.ref) }, expr.loc);
},
.e_dot => |dot| {
- break :brk p.e(E.String{ .data = dot.name }, dot.name_loc);
+ break :brk p.newExpr(E.String{ .data = dot.name }, dot.name_loc);
},
.e_index => |index| {
if (index.index.data == .e_string) {
@@ -12505,7 +12509,7 @@ fn NewParser_(
// <div foo="foo" />
// note: template literals are not supported, operations on strings are not supported either
T.t_string_literal => {
- const key = p.e(p.lexer.toEString(), p.lexer.loc());
+ const key = p.newExpr(p.lexer.toEString(), p.lexer.loc());
try p.lexer.next();
try props.append(G.Property{ .value = key, .key = key, .kind = .normal });
},
@@ -12565,7 +12569,7 @@ fn NewParser_(
flags.insert(.can_be_inlined);
}
- return p.e(E.JSXElement{
+ return p.newExpr(E.JSXElement{
.tag = start_tag,
.properties = properties,
.key = key_prop,
@@ -12582,7 +12586,7 @@ fn NewParser_(
while (true) {
switch (p.lexer.token) {
.t_string_literal => {
- try children.append(p.e(p.lexer.toEString(), loc));
+ try children.append(p.newExpr(p.lexer.toEString(), loc));
try p.lexer.nextJSXElementChild();
},
.t_open_brace => {
@@ -12639,7 +12643,7 @@ fn NewParser_(
flags.insert(.can_be_inlined);
}
- return p.e(E.JSXElement{
+ return p.newExpr(E.JSXElement{
.tag = end_tag.data.asExpr(),
.children = ExprNodeList.fromList(children),
.properties = properties,
@@ -12724,7 +12728,7 @@ fn NewParser_(
}
if (partStmts.items.len > 0) {
- const _stmts = partStmts.toOwnedSlice();
+ const _stmts = try partStmts.toOwnedSlice();
// -- hoist_bun_plugin --
if (_stmts.len == 1 and p.options.features.hoist_bun_plugin and !p.bun_plugin.ref.isNull()) {
@@ -12772,13 +12776,13 @@ fn NewParser_(
try parts.append(js_ast.Part{
.stmts = _stmts,
.symbol_uses = p.symbol_uses,
- .declared_symbols = p.declared_symbols.toOwnedSlice(
+ .declared_symbols = try p.declared_symbols.toOwnedSlice(
p.allocator,
),
- .import_record_indices = p.import_records_for_current_part.toOwnedSlice(
+ .import_record_indices = try p.import_records_for_current_part.toOwnedSlice(
p.allocator,
),
- .scopes = p.scopes_for_current_part.toOwnedSlice(p.allocator),
+ .scopes = try p.scopes_for_current_part.toOwnedSlice(p.allocator),
.can_be_removed_if_unused = p.stmtsCanBeRemovedIfUnused(_stmts),
});
p.symbol_uses = .{};
@@ -12895,7 +12899,7 @@ fn NewParser_(
}
},
else => {
- Global.panic("Unexpected type in export default: {s}", .{s2});
+ Global.panic("Unexpected type in export default: {any}", .{s2});
},
}
},
@@ -12915,7 +12919,7 @@ fn NewParser_(
return true;
}
- fn visitStmtsAndPrependTempRefs(p: *P, stmts: *ListManaged(Stmt), opts: *PrependTempRefsOpts) !void {
+ fn visitStmtsAndPrependTempRefs(p: *P, stmts: *ListManaged(Stmt), opts: *PrependTempRefsOpts) anyerror!void {
if (only_scan_imports_and_do_not_visit) {
@compileError("only_scan_imports_and_do_not_visit must not run this.");
}
@@ -12932,7 +12936,7 @@ fn NewParser_(
if (p.fn_only_data_visit.this_capture_ref) |ref| {
try p.temp_refs_to_declare.append(p.allocator, TempRef{
.ref = ref,
- .value = p.e(E.This{}, opts.fn_body_loc orelse p.panic("Internal error: Expected opts.fn_body_loc to exist", .{})),
+ .value = p.newExpr(E.This{}, opts.fn_body_loc orelse p.panic("Internal error: Expected opts.fn_body_loc to exist", .{})),
});
}
}
@@ -12992,7 +12996,7 @@ fn NewParser_(
var stmts = ListManaged(Stmt).fromOwnedSlice(p.allocator, body.stmts);
var temp_opts = PrependTempRefsOpts{ .kind = StmtsKind.fn_body, .fn_body_loc = body.loc };
p.visitStmtsAndPrependTempRefs(&stmts, &temp_opts) catch unreachable;
- func.body = G.FnBody{ .stmts = stmts.toOwnedSlice(), .loc = body.loc };
+ func.body = G.FnBody{ .stmts = stmts.toOwnedSlice() catch @panic("TODO"), .loc = body.loc };
p.popScope();
p.popScope();
@@ -13010,7 +13014,7 @@ fn NewParser_(
// Substitute "this" if we're inside a static class property initializer
if (p.fn_only_data_visit.this_class_static_ref) |ref| {
p.recordUsage(ref);
- return p.e(E.Identifier{ .ref = ref }, loc);
+ return p.newExpr(E.Identifier{ .ref = ref }, loc);
}
// oroigianlly was !=- modepassthrough
@@ -13025,7 +13029,7 @@ fn NewParser_(
// Instead of doing this at runtime using "fn.call(module.exports)", we
// do it at compile time using expression substitution here.
p.recordUsage(p.exports_ref);
- return p.e(E.Identifier{ .ref = p.exports_ref }, loc);
+ return p.newExpr(E.Identifier{ .ref = p.exports_ref }, loc);
}
}
@@ -13095,7 +13099,7 @@ fn NewParser_(
if (!p.import_meta_ref.isNull()) {
p.recordUsage(p.import_meta_ref);
- return p.e(E.Identifier{ .ref = p.import_meta_ref }, expr.loc);
+ return p.newExpr(E.Identifier{ .ref = p.import_meta_ref }, expr.loc);
}
},
.e_spread => |exp| {
@@ -13239,13 +13243,13 @@ fn NewParser_(
var props = p.allocator.alloc(G.Property, e_.properties.len + 1) catch unreachable;
std.mem.copy(G.Property, props, e_.properties.slice());
props[props.len - 1] = G.Property{ .key = Expr{ .loc = key.loc, .data = keyExprData }, .value = key };
- args[1] = p.e(E.Object{ .properties = G.Property.List.init(props) }, expr.loc);
+ args[1] = p.newExpr(E.Object{ .properties = G.Property.List.init(props) }, expr.loc);
} else {
- args[1] = p.e(E.Object{ .properties = e_.properties }, expr.loc);
+ args[1] = p.newExpr(E.Object{ .properties = e_.properties }, expr.loc);
}
i = 2;
} else {
- args[1] = p.e(E.Null{}, expr.loc);
+ args[1] = p.newExpr(E.Null{}, expr.loc);
i = 2;
}
@@ -13256,7 +13260,7 @@ fn NewParser_(
}
// Call createElement()
- return p.e(E.Call{
+ return p.newExpr(E.Call{
.target = p.jsxRefToMemberExpression(expr.loc, p.jsx_factory.ref),
.args = ExprNodeList.init(args[0..i]),
// Enable tree shaking
@@ -13314,7 +13318,7 @@ fn NewParser_(
else => {
props.append(allocator, G.Property{
.key = children_key,
- .value = p.e(E.Array{
+ .value = p.newExpr(E.Array{
.items = e_.children,
.is_single_line = e_.children.len < 2,
}, e_.close_tag_loc),
@@ -13341,27 +13345,27 @@ fn NewParser_(
// key: void 0 === key ? null : "" + key,
break :brk switch (key_.data) {
.e_string => break :brk key_,
- .e_undefined, .e_null => p.e(E.Null{}, key_.loc),
- else => p.e(E.If{
- .test_ = p.e(E.Binary{
- .left = p.e(E.Undefined{}, key_.loc),
+ .e_undefined, .e_null => p.newExpr(E.Null{}, key_.loc),
+ else => p.newExpr(E.If{
+ .test_ = p.newExpr(E.Binary{
+ .left = p.newExpr(E.Undefined{}, key_.loc),
.op = Op.Code.bin_strict_eq,
.right = key_,
}, key_.loc),
- .yes = p.e(E.Null{}, key_.loc),
- .no = p.e(
+ .yes = p.newExpr(E.Null{}, key_.loc),
+ .no = p.newExpr(
E.Binary{
.op = Op.Code.bin_add,
- .left = p.e(&E.String.empty, key_.loc),
+ .left = p.newExpr(&E.String.empty, key_.loc),
.right = key_,
},
key_.loc,
),
}, key_.loc),
};
- } else p.e(E.Null{}, expr.loc);
+ } else p.newExpr(E.Null{}, expr.loc);
var jsx_element = p.allocator.alloc(G.Property, 6) catch unreachable;
- const props_object = p.e(
+ const props_object = p.newExpr(
E.Object{
.properties = G.Property.List.fromList(props),
.close_brace_loc = e_.close_tag_loc,
@@ -13374,7 +13378,7 @@ fn NewParser_(
if (tag.data != .e_string) {
// We assume defaultProps is supposed to _not_ have side effects
// We do not support "key" or "ref" in defaultProps.
- const defaultProps = p.e(E.Dot{
+ const defaultProps = p.newExpr(E.Dot{
.name = "defaultProps",
.name_loc = tag.loc,
.target = tag,
@@ -13382,7 +13386,7 @@ fn NewParser_(
}, tag.loc);
// props: MyComponent.defaultProps || {}
if (props.items.len == 0) {
- props_expression = p.e(E.Binary{ .op = Op.Code.bin_logical_or, .left = defaultProps, .right = props_object }, defaultProps.loc);
+ props_expression = p.newExpr(E.Binary{ .op = Op.Code.bin_logical_or, .left = defaultProps, .right = props_object }, defaultProps.loc);
} else {
var call_args = p.allocator.alloc(Expr, 2) catch unreachable;
call_args[0..2].* = .{
@@ -13405,7 +13409,7 @@ fn NewParser_(
[_]G.Property{
G.Property{
.key = Expr{ .data = Prefill.Data.@"$$typeof", .loc = tag.loc },
- .value = p.e(
+ .value = p.newExpr(
E.Identifier{
.ref = p.react_element_type.ref,
.can_be_removed_if_unused = true,
@@ -13414,33 +13418,33 @@ fn NewParser_(
),
},
G.Property{
- .key = Expr{ .data = Prefill.Data.@"type", .loc = tag.loc },
+ .key = Expr{ .data = Prefill.Data.type, .loc = tag.loc },
.value = tag,
},
G.Property{
- .key = Expr{ .data = Prefill.Data.@"key", .loc = key.loc },
+ .key = Expr{ .data = Prefill.Data.key, .loc = key.loc },
.value = key,
},
// this is a de-opt
// any usage of ref should make it impossible for this code to be reached
G.Property{
- .key = Expr{ .data = Prefill.Data.@"ref", .loc = expr.loc },
- .value = p.e(E.Null{}, expr.loc),
+ .key = Expr{ .data = Prefill.Data.ref, .loc = expr.loc },
+ .value = p.newExpr(E.Null{}, expr.loc),
},
G.Property{
- .key = Expr{ .data = Prefill.Data.@"props", .loc = expr.loc },
+ .key = Expr{ .data = Prefill.Data.props, .loc = expr.loc },
.value = props_expression,
},
G.Property{
- .key = Expr{ .data = Prefill.Data.@"_owner", .loc = key.loc },
- .value = p.e(
+ .key = Expr{ .data = Prefill.Data._owner, .loc = key.loc },
+ .value = p.newExpr(
E.Null{},
expr.loc,
),
},
};
- const output = p.e(
+ const output = p.newExpr(
E.Object{
.properties = G.Property.List.init(jsx_element),
.close_brace_loc = e_.close_tag_loc,
@@ -13458,7 +13462,7 @@ fn NewParser_(
const args = p.allocator.alloc(Expr, if (p.options.jsx.development) @as(usize, 6) else @as(usize, 2) + @as(usize, @boolToInt(e_.key != null))) catch unreachable;
args[0] = tag;
- args[1] = p.e(E.Object{
+ args[1] = p.newExpr(E.Object{
.properties = G.Property.List.fromList(props),
}, expr.loc);
@@ -13487,11 +13491,11 @@ fn NewParser_(
},
};
- args[4] = p.e(E.Undefined{}, expr.loc);
+ args[4] = p.newExpr(E.Undefined{}, expr.loc);
args[5] = Expr{ .data = Prefill.Data.This, .loc = expr.loc };
}
- return p.e(E.Call{
+ return p.newExpr(E.Call{
.target = p.jsxRefToMemberExpressionAutomatic(expr.loc, is_static_jsx),
.args = ExprNodeList.init(args),
// Enable tree shaking
@@ -13520,7 +13524,7 @@ fn NewParser_(
const name = p.symbols.items[ref.innerIndex()].original_name;
p.ignoreUsage(ref);
if (p.is_control_flow_dead) {
- return p.e(E.Undefined{}, e_.tag.?.loc);
+ return p.newExpr(E.Undefined{}, e_.tag.?.loc);
}
p.macro_call_count += 1;
const record = &p.import_records.items[import_record_id];
@@ -13563,7 +13567,7 @@ fn NewParser_(
p.recordUsage(ref);
}
- return p.e(
+ return p.newExpr(
E.ImportIdentifier{
.was_originally_identifier = false,
.ref = ref,
@@ -13666,13 +13670,13 @@ fn NewParser_(
call_args[0] = p.visitExpr(call_args[0]);
}
- return p.e(
+ return p.newExpr(
E.Call{
- .target = p.e(
+ .target = p.newExpr(
E.Dot{
.name = "isNodeType",
.name_loc = expr.loc,
- .target = p.e(BunJSX.bun_jsx_identifier, expr.loc),
+ .target = p.newExpr(BunJSX.bun_jsx_identifier, expr.loc),
.can_be_removed_if_unused = true,
.call_can_be_unwrapped_if_unused = true,
},
@@ -13755,7 +13759,7 @@ fn NewParser_(
.bin_loose_eq => {
const equality = e_.left.data.eql(e_.right.data, p.allocator);
if (equality.ok) {
- return p.e(
+ return p.newExpr(
E.Boolean{ .value = equality.equal },
expr.loc,
);
@@ -13769,7 +13773,7 @@ fn NewParser_(
.bin_strict_eq => {
const equality = e_.left.data.eql(e_.right.data, p.allocator);
if (equality.ok) {
- return p.e(E.Boolean{ .value = equality.equal }, expr.loc);
+ return p.newExpr(E.Boolean{ .value = equality.equal }, expr.loc);
}
// const after_op_loc = locAfterOp(e_.);
@@ -13779,7 +13783,7 @@ fn NewParser_(
.bin_loose_ne => {
const equality = e_.left.data.eql(e_.right.data, p.allocator);
if (equality.ok) {
- return p.e(E.Boolean{ .value = !equality.equal }, expr.loc);
+ return p.newExpr(E.Boolean{ .value = !equality.equal }, expr.loc);
}
// const after_op_loc = locAfterOp(e_.);
// TODO: warn about equality check
@@ -13787,13 +13791,13 @@ fn NewParser_(
// "x != void 0" => "x != null"
if (@as(Expr.Tag, e_.right.data) == .e_undefined) {
- e_.right = p.e(E.Null{}, e_.right.loc);
+ e_.right = p.newExpr(E.Null{}, e_.right.loc);
}
},
.bin_strict_ne => {
const equality = e_.left.data.eql(e_.right.data, p.allocator);
if (equality.ok) {
- return p.e(E.Boolean{ .value = !equality.equal }, expr.loc);
+ return p.newExpr(E.Boolean{ .value = !equality.equal }, expr.loc);
}
},
.bin_nullish_coalescing => {
@@ -13853,7 +13857,7 @@ fn NewParser_(
.bin_add => {
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- return p.e(E.Number{ .value = vals[0] + vals[1] }, expr.loc);
+ return p.newExpr(E.Number{ .value = vals[0] + vals[1] }, expr.loc);
}
}
@@ -13864,21 +13868,21 @@ fn NewParser_(
.bin_sub => {
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- return p.e(E.Number{ .value = vals[0] - vals[1] }, expr.loc);
+ return p.newExpr(E.Number{ .value = vals[0] - vals[1] }, expr.loc);
}
}
},
.bin_mul => {
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- return p.e(E.Number{ .value = vals[0] * vals[1] }, expr.loc);
+ return p.newExpr(E.Number{ .value = vals[0] * vals[1] }, expr.loc);
}
}
},
.bin_div => {
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- return p.e(E.Number{ .value = vals[0] / vals[1] }, expr.loc);
+ return p.newExpr(E.Number{ .value = vals[0] / vals[1] }, expr.loc);
}
}
},
@@ -13886,14 +13890,14 @@ fn NewParser_(
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
// is this correct?
- return p.e(E.Number{ .value = std.math.mod(f64, vals[0], vals[1]) catch 0.0 }, expr.loc);
+ return p.newExpr(E.Number{ .value = std.math.mod(f64, vals[0], vals[1]) catch 0.0 }, expr.loc);
}
}
},
.bin_pow => {
if (p.should_fold_numeric_constants) {
if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- return p.e(E.Number{ .value = std.math.pow(f64, vals[0], vals[1]) }, expr.loc);
+ return p.newExpr(E.Number{ .value = std.math.pow(f64, vals[0], vals[1]) }, expr.loc);
}
}
},
@@ -13901,7 +13905,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) << @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) << @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -13909,7 +13913,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -13917,7 +13921,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -13925,7 +13929,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -13933,7 +13937,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -13941,7 +13945,7 @@ fn NewParser_(
// TODO:
// if (p.should_fold_numeric_constants) {
// if (Expr.extractNumericValues(e_.left.data, e_.right.data)) |vals| {
- // return p.e(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
+ // return p.newExpr(E.Number{ .value = ((@floatToInt(i32, vals[0]) >> @floatToInt(u32, vals[1])) & 31) }, expr.loc);
// }
// }
},
@@ -14077,7 +14081,7 @@ fn NewParser_(
return p.valueForDefine(expr.loc, in.assign_target, is_delete_target, &define.data);
}
- return p.e(E.Undefined{}, expr.loc);
+ return p.newExpr(E.Undefined{}, expr.loc);
}
}
}
@@ -14087,7 +14091,7 @@ fn NewParser_(
const literal = target.data.e_string.slice(p.allocator);
const index = e_.index.data.e_number.toUsize();
if (literal.len > index) {
- return p.e(E.String{ .data = literal[index .. index + 1] }, expr.loc);
+ return p.newExpr(E.String{ .data = literal[index .. index + 1] }, expr.loc);
}
}
// Create an error for assigning to an import namespace when bundling. Even
@@ -14105,7 +14109,7 @@ fn NewParser_(
) catch unreachable;
}
- return p.e(e_, expr.loc);
+ return p.newExpr(e_, expr.loc);
},
.e_unary => |e_| {
switch (e_.op) {
@@ -14125,7 +14129,7 @@ fn NewParser_(
}
if (SideEffects.typeof(e_.value.data)) |typeof| {
- return p.e(E.String{ .data = typeof }, expr.loc);
+ return p.newExpr(E.String{ .data = typeof }, expr.loc);
}
},
.un_delete => {
@@ -14142,7 +14146,7 @@ fn NewParser_(
const side_effects = SideEffects.toBoolean(e_.value.data);
if (side_effects.ok) {
- return p.e(E.Boolean{ .value = !side_effects.value }, expr.loc);
+ return p.newExpr(E.Boolean{ .value = !side_effects.value }, expr.loc);
}
if (e_.value.maybeSimplifyNot(p.allocator)) |exp| {
@@ -14151,17 +14155,17 @@ fn NewParser_(
},
.un_void => {
if (p.exprCanBeRemovedIfUnused(&e_.value)) {
- return p.e(E.Undefined{}, e_.value.loc);
+ return p.newExpr(E.Undefined{}, e_.value.loc);
}
},
.un_pos => {
if (SideEffects.toNumber(e_.value.data)) |num| {
- return p.e(E.Number{ .value = num }, expr.loc);
+ return p.newExpr(E.Number{ .value = num }, expr.loc);
}
},
.un_neg => {
if (SideEffects.toNumber(e_.value.data)) |num| {
- return p.e(E.Number{ .value = -num }, expr.loc);
+ return p.newExpr(E.Number{ .value = -num }, expr.loc);
}
},
@@ -14192,7 +14196,7 @@ fn NewParser_(
if (comma.op == .bin_comma) {
return Expr.joinWithComma(
comma.left,
- p.e(
+ p.newExpr(
E.Unary{
.op = e_.op,
.value = comma.right,
@@ -14296,14 +14300,14 @@ fn NewParser_(
p.is_control_flow_dead = old;
if (side_effects.side_effects == .could_have_side_effects) {
- return Expr.joinWithComma(SideEffects.simpifyUnusedExpr(p, e_.test_) orelse p.e(E.Missing{}, e_.test_.loc), e_.yes, p.allocator);
+ return Expr.joinWithComma(SideEffects.simpifyUnusedExpr(p, e_.test_) orelse p.newExpr(E.Missing{}, e_.test_.loc), e_.yes, p.allocator);
}
// "(1 ? fn : 2)()" => "fn()"
// "(1 ? this.fn : 2)" => "this.fn"
// "(1 ? this.fn : 2)()" => "(0, this.fn)()"
if (is_call_target and e_.yes.hasValueForThisInCall()) {
- return p.e(E.Number{ .value = 0 }, e_.test_.loc).joinWithComma(e_.yes, p.allocator);
+ return p.newExpr(E.Number{ .value = 0 }, e_.test_.loc).joinWithComma(e_.yes, p.allocator);
}
return e_.yes;
@@ -14317,14 +14321,14 @@ fn NewParser_(
// "(a, false) ? b : c" => "a, c"
if (side_effects.side_effects == .could_have_side_effects) {
- return Expr.joinWithComma(SideEffects.simpifyUnusedExpr(p, e_.test_) orelse p.e(E.Missing{}, e_.test_.loc), e_.no, p.allocator);
+ return Expr.joinWithComma(SideEffects.simpifyUnusedExpr(p, e_.test_) orelse p.newExpr(E.Missing{}, e_.test_.loc), e_.no, p.allocator);
}
// "(1 ? fn : 2)()" => "fn()"
// "(1 ? this.fn : 2)" => "this.fn"
// "(1 ? this.fn : 2)()" => "(0, this.fn)()"
if (is_call_target and e_.no.hasValueForThisInCall()) {
- return p.e(E.Number{ .value = 0 }, e_.test_.loc).joinWithComma(e_.no, p.allocator);
+ return p.newExpr(E.Number{ .value = 0 }, e_.test_.loc).joinWithComma(e_.no, p.allocator);
}
return e_.no;
}
@@ -14536,11 +14540,11 @@ fn NewParser_(
// dead here. We don't want to spend time scanning the required files
// if they will never be used.
if (p.is_control_flow_dead) {
- return p.e(E.Null{}, expr.loc);
+ return p.newExpr(E.Null{}, expr.loc);
}
p.ignoreUsage(p.require_ref);
- return p.e(
+ return p.newExpr(
E.Call{
.target = p.importMetaRequire(expr.loc),
.args = e_.args,
@@ -14563,18 +14567,18 @@ fn NewParser_(
// dead here. We don't want to spend time scanning the required files
// if they will never be used.
if (p.is_control_flow_dead) {
- return p.e(E.Null{}, expr.loc);
+ return p.newExpr(E.Null{}, expr.loc);
}
if (p.options.features.dynamic_require) {
p.ignoreUsage(p.require_ref);
// require.resolve(FOO) => import.meta.resolveSync(FOO)
// require.resolve(FOO) => import.meta.resolveSync(FOO, pathsObject)
- return p.e(
+ return p.newExpr(
E.Call{
- .target = p.e(
+ .target = p.newExpr(
E.Dot{
- .target = p.e(E.ImportMeta{}, e_.target.loc),
+ .target = p.newExpr(E.ImportMeta{}, e_.target.loc),
.name = "resolveSync",
.name_loc = e_.target.data.e_dot.name_loc,
},
@@ -14610,7 +14614,7 @@ fn NewParser_(
const import_record_id = p.macro.refs.get(ref).?;
p.ignoreUsage(ref);
if (p.is_control_flow_dead) {
- return p.e(E.Undefined{}, e_.target.loc);
+ return p.newExpr(E.Undefined{}, e_.target.loc);
}
const name = p.symbols.items[ref.innerIndex()].original_name;
const record = &p.import_records.items[import_record_id];
@@ -14688,7 +14692,7 @@ fn NewParser_(
var temp_opts = PrependTempRefsOpts{ .kind = StmtsKind.fn_body };
p.visitStmtsAndPrependTempRefs(&stmts_list, &temp_opts) catch unreachable;
p.allocator.free(e_.body.stmts);
- e_.body.stmts = stmts_list.toOwnedSlice();
+ e_.body.stmts = stmts_list.toOwnedSlice() catch @panic("TODO");
p.popScope();
p.popScope();
@@ -14775,7 +14779,7 @@ fn NewParser_(
// var start = p.expr_list.items.len;
// p.expr_list.ensureUnusedCapacity(2) catch unreachable;
// p.expr_list.appendAssumeCapacity(_value);
- // p.expr_list.appendAssumeCapacity(p.e(E.String{
+ // p.expr_list.appendAssumeCapacity(p.newExpr(E.String{
// .utf8 = name,
// }, _value.loc));
@@ -15397,14 +15401,14 @@ fn NewParser_(
if (is_call_target and id.ref.eql(p.module_ref) and strings.eqlComptime(name, "require")) {
p.ignoreUsage(p.module_ref);
p.recordUsage(p.require_ref);
- return p.e(E.Identifier{ .ref = p.require_ref }, name_loc);
+ return p.newExpr(E.Identifier{ .ref = p.require_ref }, name_loc);
}
// If this is a known enum value, inline the value of the enum
if (is_typescript_enabled) {
if (p.known_enum_values.get(id.ref)) |enum_value_map| {
if (enum_value_map.get(name)) |enum_value| {
- return p.e(E.Number{ .value = enum_value }, loc);
+ return p.newExpr(E.Number{ .value = enum_value }, loc);
}
}
}
@@ -15416,7 +15420,7 @@ fn NewParser_(
if (str.is_utf16)
return null;
- return p.e(E.Number{ .value = @intToFloat(f64, str.len()) }, loc);
+ return p.newExpr(E.Number{ .value = @intToFloat(f64, str.len()) }, loc);
}
},
else => {},
@@ -15629,7 +15633,7 @@ fn NewParser_(
var items = try List(js_ast.ClauseItem).initCapacity(p.allocator, 1);
items.appendAssumeCapacity(js_ast.ClauseItem{ .alias = alias.original_name, .original_name = alias.original_name, .alias_loc = alias.loc, .name = LocRef{ .loc = alias.loc, .ref = data.namespace_ref } });
- stmts.appendAssumeCapacity(p.s(S.ExportClause{ .items = items.toOwnedSlice(p.allocator), .is_single_line = true }, stmt.loc));
+ stmts.appendAssumeCapacity(p.s(S.ExportClause{ .items = items.toOwnedSlice(p.allocator) catch @panic("TODO"), .is_single_line = true }, stmt.loc));
return;
}
},
@@ -15745,12 +15749,12 @@ fn NewParser_(
export_default_args[0] = p.@"module.exports"(s2.loc);
if (had_name) {
- export_default_args[1] = p.e(E.Identifier{ .ref = func.func.name.?.ref.? }, s2.loc);
+ export_default_args[1] = p.newExpr(E.Identifier{ .ref = func.func.name.?.ref.? }, s2.loc);
stmts.ensureUnusedCapacity(2) catch unreachable;
stmts.appendAssumeCapacity(s2);
} else {
- export_default_args[1] = p.e(E.Function{ .func = func.func }, s2.loc);
+ export_default_args[1] = p.newExpr(E.Function{ .func = func.func }, s2.loc);
}
stmts.append(p.s(S.SExpr{ .value = p.callRuntime(s2.loc, "__exportDefault", export_default_args) }, s2.loc)) catch unreachable;
@@ -15804,9 +15808,9 @@ fn NewParser_(
if (class_name_ref) |ref| {
stmts.ensureUnusedCapacity(2) catch unreachable;
stmts.appendAssumeCapacity(s2);
- export_default_args[1] = p.e(E.Identifier{ .ref = ref }, s2.loc);
+ export_default_args[1] = p.newExpr(E.Identifier{ .ref = ref }, s2.loc);
} else {
- export_default_args[1] = p.e(class.class, s2.loc);
+ export_default_args[1] = p.newExpr(class.class, s2.loc);
}
stmts.append(p.s(S.SExpr{ .value = p.callRuntime(s2.loc, "__exportDefault", export_default_args) }, s2.loc)) catch unreachable;
@@ -15980,7 +15984,7 @@ fn NewParser_(
const kind = if (std.meta.eql(p.loop_body, stmt.data)) StmtsKind.loop_body else StmtsKind.none;
var _stmts = ListManaged(Stmt).fromOwnedSlice(p.allocator, data.stmts);
p.visitStmts(&_stmts, kind) catch unreachable;
- data.stmts = _stmts.toOwnedSlice();
+ data.stmts = _stmts.toOwnedSlice() catch @panic("TODO");
p.popScope();
}
@@ -16013,7 +16017,7 @@ fn NewParser_(
data.test_ = SideEffects.simplifyBoolean(p, data.test_);
const result = SideEffects.toBoolean(data.test_.data);
if (result.ok and result.side_effects == .no_side_effects) {
- data.test_ = p.e(E.Boolean{ .value = result.value }, data.test_.loc);
+ data.test_ = p.newExpr(E.Boolean{ .value = result.value }, data.test_.loc);
}
},
.s_do_while => |data| {
@@ -16076,8 +16080,6 @@ fn NewParser_(
}
}
- // if (false) {
- // }
if (data.no == null) {
return;
}
@@ -16160,7 +16162,7 @@ fn NewParser_(
p.fn_or_arrow_data_visit.try_body_count += 1;
p.visitStmts(&_stmts, StmtsKind.none) catch unreachable;
p.fn_or_arrow_data_visit.try_body_count -= 1;
- data.body = _stmts.toOwnedSlice();
+ data.body = _stmts.toOwnedSlice() catch @panic("TODO");
}
p.popScope();
@@ -16172,7 +16174,7 @@ fn NewParser_(
}
var _stmts = ListManaged(Stmt).fromOwnedSlice(p.allocator, catch_.body);
p.visitStmts(&_stmts, StmtsKind.none) catch unreachable;
- catch_.body = _stmts.toOwnedSlice();
+ catch_.body = _stmts.toOwnedSlice() catch @panic("TODO");
}
p.popScope();
}
@@ -16182,7 +16184,7 @@ fn NewParser_(
{
var _stmts = ListManaged(Stmt).fromOwnedSlice(p.allocator, finally.stmts);
p.visitStmts(&_stmts, StmtsKind.none) catch unreachable;
- finally.stmts = _stmts.toOwnedSlice();
+ finally.stmts = _stmts.toOwnedSlice() catch @panic("TODO");
}
p.popScope();
}
@@ -16206,7 +16208,7 @@ fn NewParser_(
}
var _stmts = ListManaged(Stmt).fromOwnedSlice(p.allocator, case.body);
p.visitStmts(&_stmts, StmtsKind.none) catch unreachable;
- data.cases[i].body = _stmts.toOwnedSlice();
+ data.cases[i].body = _stmts.toOwnedSlice() catch @panic("TODO");
}
}
// TODO: duplicate case checker
@@ -16236,11 +16238,11 @@ fn NewParser_(
const enclosing_namespace_arg_ref = p.enclosing_namespace_arg_ref orelse unreachable;
stmts.ensureUnusedCapacity(3) catch unreachable;
stmts.appendAssumeCapacity(stmt.*);
- stmts.appendAssumeCapacity(Expr.assignStmt(p.e(E.Dot{
- .target = p.e(E.Identifier{ .ref = enclosing_namespace_arg_ref }, stmt.loc),
+ stmts.appendAssumeCapacity(Expr.assignStmt(p.newExpr(E.Dot{
+ .target = p.newExpr(E.Identifier{ .ref = enclosing_namespace_arg_ref }, stmt.loc),
.name = p.loadNameFromRef(data.func.name.?.ref.?),
.name_loc = data.func.name.?.loc,
- }, stmt.loc), p.e(E.Identifier{ .ref = data.func.name.?.ref.? }, data.func.name.?.loc), p.allocator));
+ }, stmt.loc), p.newExpr(E.Identifier{ .ref = data.func.name.?.ref.? }, data.func.name.?.loc), p.allocator));
} else if (!mark_as_dead) {
stmts.append(stmt.*) catch unreachable;
} else if (mark_as_dead) {
@@ -16297,11 +16299,11 @@ fn NewParser_(
// Handle exporting this class from a namespace
if (was_export_inside_namespace) {
- stmts.appendAssumeCapacity(Expr.assignStmt(p.e(E.Dot{
- .target = p.e(E.Identifier{ .ref = p.enclosing_namespace_arg_ref.? }, stmt.loc),
+ stmts.appendAssumeCapacity(Expr.assignStmt(p.newExpr(E.Dot{
+ .target = p.newExpr(E.Identifier{ .ref = p.enclosing_namespace_arg_ref.? }, stmt.loc),
.name = p.symbols.items[data.class.class_name.?.ref.?.innerIndex()].original_name,
.name_loc = data.class.class_name.?.loc,
- }, stmt.loc), p.e(E.Identifier{ .ref = data.class.class_name.?.ref.? }, data.class.class_name.?.loc), p.allocator));
+ }, stmt.loc), p.newExpr(E.Identifier{ .ref = data.class.class_name.?.ref.? }, data.class.class_name.?.loc), p.allocator));
}
return;
@@ -16365,19 +16367,19 @@ fn NewParser_(
else => {},
}
} else if (has_numeric_value) {
- enum_value.value = p.e(E.Number{ .value = next_numeric_value }, enum_value.loc);
+ enum_value.value = p.newExpr(E.Number{ .value = next_numeric_value }, enum_value.loc);
values_so_far.put(allocator, name.string(allocator) catch unreachable, next_numeric_value) catch unreachable;
next_numeric_value += 1;
} else {
- enum_value.value = p.e(E.Undefined{}, enum_value.loc);
+ enum_value.value = p.newExpr(E.Undefined{}, enum_value.loc);
}
// "Enum['Name'] = value"
- assign_target = Expr.assign(p.e(E.Index{
- .target = p.e(
+ assign_target = Expr.assign(p.newExpr(E.Index{
+ .target = p.newExpr(
E.Identifier{ .ref = data.arg },
enum_value.loc,
),
- .index = p.e(
+ .index = p.newExpr(
enum_value.name,
enum_value.loc,
),
@@ -16392,14 +16394,14 @@ fn NewParser_(
// "Enum[assignTarget] = 'Name'"
value_exprs.append(
Expr.assign(
- p.e(E.Index{
- .target = p.e(
+ p.newExpr(E.Index{
+ .target = p.newExpr(
E.Identifier{ .ref = data.arg },
enum_value.loc,
),
.index = assign_target,
}, enum_value.loc),
- p.e(enum_value.name, enum_value.loc),
+ p.newExpr(enum_value.name, enum_value.loc),
allocator,
),
) catch unreachable;
@@ -16422,7 +16424,7 @@ fn NewParser_(
data.name.loc,
data.name.ref.?,
data.arg,
- value_stmts.toOwnedSlice(),
+ try value_stmts.toOwnedSlice(),
);
return;
},
@@ -16451,7 +16453,7 @@ fn NewParser_(
p.enclosing_namespace_arg_ref = data.arg;
p.pushScopeForVisitPass(.entry, stmt.loc) catch unreachable;
p.recordDeclaredSymbol(data.arg) catch unreachable;
- p.visitStmtsAndPrependTempRefs(&prepend_list, &prepend_temp_refs) catch unreachable;
+ try p.visitStmtsAndPrependTempRefs(&prepend_list, &prepend_temp_refs);
p.popScope();
p.enclosing_namespace_arg_ref = old_enclosing_namespace_arg_ref;
@@ -16662,12 +16664,12 @@ fn NewParser_(
{
var array = expr.data.e_array;
- array.items.len = @minimum(array.items.len, @truncate(u32, bound_array.items.len));
+ array.items.len = @min(array.items.len, @truncate(u32, bound_array.items.len));
var slice = array.items.slice();
for (bound_array.items[0..array.items.len]) |item, item_i| {
const child_expr = slice[item_i];
if (item.binding.data == .b_missing) {
- slice[item_i] = p.e(E.Missing{}, expr.loc);
+ slice[item_i] = p.newExpr(E.Missing{}, expr.loc);
continue;
}
@@ -16767,7 +16769,7 @@ fn NewParser_(
}
},
else => {
- Global.panic("Unexpected binding type in namespace. This is a bug. {s}", .{binding});
+ Global.panic("Unexpected binding type in namespace. This is a bug. {any}", .{binding});
},
}
}
@@ -16795,7 +16797,7 @@ fn NewParser_(
// Make sure to only emit a variable once for a given namespace, since there
// can be multiple namespace blocks for the same namespace
if (symbol.kind == .ts_namespace or symbol.kind == .ts_enum and !p.emitted_namespace_vars.contains(name_ref)) {
- p.emitted_namespace_vars.put(allocator, name_ref, .{}) catch unreachable;
+ p.emitted_namespace_vars.put(allocator, name_ref, {}) catch unreachable;
var decls = allocator.alloc(G.Decl, 1) catch unreachable;
decls[0] = G.Decl{ .binding = p.b(B.Identifier{ .ref = name_ref }, name_loc) };
@@ -16834,10 +16836,10 @@ fn NewParser_(
const name = p.symbols.items[name_ref.innerIndex()].original_name;
arg_expr = Expr.assign(
Expr.initIdentifier(name_ref, name_loc),
- p.e(
+ p.newExpr(
E.Binary{
.op = .bin_logical_or,
- .left = p.e(
+ .left = p.newExpr(
E.Dot{
.target = Expr.initIdentifier(namespace, name_loc),
.name = name,
@@ -16846,7 +16848,7 @@ fn NewParser_(
name_loc,
),
.right = Expr.assign(
- p.e(
+ p.newExpr(
E.Dot{
.target = Expr.initIdentifier(namespace, name_loc),
.name = name,
@@ -16854,7 +16856,7 @@ fn NewParser_(
},
name_loc,
),
- p.e(E.Object{}, name_loc),
+ p.newExpr(E.Object{}, name_loc),
allocator,
),
},
@@ -16867,12 +16869,12 @@ fn NewParser_(
p.recordUsage(name_ref);
} else {
// "name || (name = {})"
- arg_expr = p.e(E.Binary{
+ arg_expr = p.newExpr(E.Binary{
.op = .bin_logical_or,
.left = Expr.initIdentifier(name_ref, name_loc),
.right = Expr.assign(
Expr.initIdentifier(name_ref, name_loc),
- p.e(
+ p.newExpr(
E.Object{},
name_loc,
),
@@ -16896,14 +16898,14 @@ fn NewParser_(
.stmts = try allocator.dupe(StmtNodeIndex, stmts_inside_closure),
},
};
- const target = p.e(
+ const target = p.newExpr(
E.Function{
.func = func,
},
stmt_loc,
);
- const call = p.e(
+ const call = p.newExpr(
E.Call{
.target = target,
.args = ExprNodeList.init(args_list),
@@ -16956,7 +16958,7 @@ fn NewParser_(
for (arg.ts_decorators.ptr[0..arg.ts_decorators.len]) |arg_decorator| {
var decorators = if (is_constructor) class.ts_decorators.listManaged(p.allocator) else prop.ts_decorators.listManaged(p.allocator);
const args = p.allocator.alloc(Expr, 2) catch unreachable;
- args[0] = p.e(E.Number{ .value = @intToFloat(f64, i) }, arg_decorator.loc);
+ args[0] = p.newExpr(E.Number{ .value = @intToFloat(f64, i) }, arg_decorator.loc);
args[1] = arg_decorator;
decorators.append(p.callRuntime(arg_decorator.loc, "__decorateParam", args)) catch unreachable;
if (is_constructor) {
@@ -16988,9 +16990,9 @@ fn NewParser_(
if (prop.ts_decorators.len > 0) {
const loc = prop.key.?.loc;
const descriptor_key = switch (prop.key.?.data) {
- .e_identifier => |k| p.e(E.Identifier{ .ref = k.ref }, loc),
- .e_number => |k| p.e(E.Number{ .value = k.value }, loc),
- .e_string => |k| p.e(E.String{ .data = k.data }, loc),
+ .e_identifier => |k| p.newExpr(E.Identifier{ .ref = k.ref }, loc),
+ .e_number => |k| p.newExpr(E.Number{ .value = k.value }, loc),
+ .e_string => |k| p.newExpr(E.String{ .data = k.data }, loc),
else => undefined,
};
@@ -16999,16 +17001,16 @@ fn NewParser_(
var target: Expr = undefined;
if (prop.flags.contains(.is_static)) {
p.recordUsage(class.class_name.?.ref.?);
- target = p.e(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
+ target = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
} else {
- target = p.e(E.Dot{ .target = p.e(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc), .name = "prototype", .name_loc = loc }, loc);
+ target = p.newExpr(E.Dot{ .target = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc), .name = "prototype", .name_loc = loc }, loc);
}
const args = p.allocator.alloc(Expr, 4) catch unreachable;
- args[0] = p.e(E.Array{ .items = prop.ts_decorators }, loc);
+ args[0] = p.newExpr(E.Array{ .items = prop.ts_decorators }, loc);
args[1] = target;
args[2] = descriptor_key;
- args[3] = p.e(E.Number{ .value = descriptor_kind }, loc);
+ args[3] = p.newExpr(E.Number{ .value = descriptor_kind }, loc);
const decorator = p.callRuntime(prop.key.?.loc, "__decorateClass", args);
const decorator_stmt = p.s(S.SExpr{ .value = decorator }, decorator.loc);
@@ -17027,18 +17029,18 @@ fn NewParser_(
var target: Expr = undefined;
if (prop.flags.contains(.is_static)) {
p.recordUsage(class.class_name.?.ref.?);
- target = p.e(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
+ target = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
} else {
- target = p.e(E.This{}, prop.key.?.loc);
+ target = p.newExpr(E.This{}, prop.key.?.loc);
}
if (prop.flags.contains(.is_computed)) {
- target = p.e(E.Index{
+ target = p.newExpr(E.Index{
.target = target,
.index = prop.key.?,
}, prop.key.?.loc);
} else {
- target = p.e(E.Dot{
+ target = p.newExpr(E.Dot{
.target = target,
.name = prop.key.?.data.e_string.data,
.name_loc = prop.key.?.loc,
@@ -17065,22 +17067,22 @@ fn NewParser_(
var constructor_stmts = ListManaged(Stmt).init(p.allocator);
if (class.extends != null) {
- const target = p.e(E.Super{}, stmt.loc);
+ const target = p.newExpr(E.Super{}, stmt.loc);
const arguments_ref = p.newSymbol(.unbound, "arguments") catch unreachable;
p.current_scope.generated.append(p.allocator, arguments_ref) catch unreachable;
- const super = p.e(E.Spread{ .value = p.e(E.Identifier{ .ref = arguments_ref }, stmt.loc) }, stmt.loc);
+ const super = p.newExpr(E.Spread{ .value = p.newExpr(E.Identifier{ .ref = arguments_ref }, stmt.loc) }, stmt.loc);
const args = ExprNodeList.one(p.allocator, super) catch unreachable;
- constructor_stmts.append(p.s(S.SExpr{ .value = p.e(E.Call{ .target = target, .args = args }, stmt.loc) }, stmt.loc)) catch unreachable;
+ constructor_stmts.append(p.s(S.SExpr{ .value = p.newExpr(E.Call{ .target = target, .args = args }, stmt.loc) }, stmt.loc)) catch unreachable;
}
constructor_stmts.appendSlice(instance_members.items) catch unreachable;
properties.insert(0, G.Property{
.flags = Flags.Property.init(.{ .is_method = true }),
- .key = p.e(E.String{ .data = "constructor" }, stmt.loc),
- .value = p.e(E.Function{ .func = G.Fn{
+ .key = p.newExpr(E.String{ .data = "constructor" }, stmt.loc),
+ .value = p.newExpr(E.Function{ .func = G.Fn{
.name = null,
.open_parens_loc = logger.Loc.Empty,
.args = &[_]Arg{},
@@ -17116,11 +17118,11 @@ fn NewParser_(
stmts.appendSliceAssumeCapacity(static_decorators.items);
if (class.ts_decorators.len > 0) {
const args = p.allocator.alloc(Expr, 2) catch unreachable;
- args[0] = p.e(E.Array{ .items = class.ts_decorators }, stmt.loc);
- args[1] = p.e(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
+ args[0] = p.newExpr(E.Array{ .items = class.ts_decorators }, stmt.loc);
+ args[1] = p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc);
stmts.appendAssumeCapacity(Expr.assignStmt(
- p.e(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc),
+ p.newExpr(E.Identifier{ .ref = class.class_name.?.ref.? }, class.class_name.?.loc),
p.callRuntime(stmt.loc, "__decorateClass", args),
p.allocator,
));
@@ -17157,7 +17159,7 @@ fn NewParser_(
// s.Kind = p.selectLocalKind(s.Kind)
},
else => {
- p.panic("Unexpected stmt in visitForLoopInit: {s}", .{stmt});
+ p.panic("Unexpected stmt in visitForLoopInit: {any}", .{stmt});
},
}
@@ -17172,7 +17174,7 @@ fn NewParser_(
const enclosing_ref = p.enclosing_namespace_arg_ref.?;
p.recordUsage(enclosing_ref);
- return p.e(E.Dot{
+ return p.newExpr(E.Dot{
.target = Expr.initIdentifier(enclosing_ref, loc),
.name = p.symbols.items[ref.innerIndex()].original_name,
.name_loc = loc,
@@ -17222,7 +17224,7 @@ fn NewParser_(
);
},
.e_string => |str| {
- return p.e(str, loc);
+ return p.newExpr(str, loc);
},
else => {},
}
@@ -17359,7 +17361,7 @@ fn NewParser_(
}
},
else => {
- p.panic("Unexpected binding {s}", .{binding});
+ p.panic("Unexpected binding {any}", .{binding});
},
}
}
@@ -17392,7 +17394,7 @@ fn NewParser_(
p.popScope();
}
- return p.stmtsToSingleStmt(stmt.loc, stmts.toOwnedSlice());
+ return p.stmtsToSingleStmt(stmt.loc, stmts.toOwnedSlice() catch @panic("TODO"));
}
// One statement could potentially expand to several statements
@@ -17605,11 +17607,11 @@ fn NewParser_(
switch (arg.binding.data) {
.b_identifier => |id| {
const name = p.symbols.items[id.ref.innerIndex()].original_name;
- const ident = p.e(E.Identifier{ .ref = id.ref }, arg.binding.loc);
+ const ident = p.newExpr(E.Identifier{ .ref = id.ref }, arg.binding.loc);
stmts.appendAssumeCapacity(
Expr.assignStmt(
- p.e(E.Dot{
- .target = p.e(E.This{}, arg.binding.loc),
+ p.newExpr(E.Dot{
+ .target = p.newExpr(E.This{}, arg.binding.loc),
.name = name,
.name_loc = arg.binding.loc,
}, arg.binding.loc),
@@ -17628,8 +17630,8 @@ fn NewParser_(
}
}
- class.properties = class_body.toOwnedSlice();
- constructor.func.body.stmts = stmts.toOwnedSlice();
+ class.properties = class_body.toOwnedSlice() catch unreachable;
+ constructor.func.body.stmts = stmts.toOwnedSlice() catch unreachable;
}
}
}
@@ -17658,10 +17660,10 @@ fn NewParser_(
fn keepStmtSymbolName(p: *P, loc: logger.Loc, ref: Ref, name: string) Stmt {
p.expr_list.ensureUnusedCapacity(2) catch unreachable;
const start = p.expr_list.items.len;
- p.expr_list.appendAssumeCapacity(p.e(E.Identifier{
+ p.expr_list.appendAssumeCapacity(p.newExpr(E.Identifier{
.ref = ref,
}, loc));
- p.expr_list.appendAssumeCapacity(p.e(E.String{ .data = name }, loc));
+ p.expr_list.appendAssumeCapacity(p.newExpr(E.String{ .data = name }, loc));
return p.s(S.SExpr{
// I believe that this is a spot we can do $RefreshReg$(name)
.value = p.callRuntime(loc, "__name", p.expr_list.items[start..p.expr_list.items.len]),
@@ -17692,8 +17694,8 @@ fn NewParser_(
}
p.recordUsage(ref);
- return p.e(E.Call{
- .target = p.e(E.Identifier{
+ return p.newExpr(E.Call{
+ .target = p.newExpr(E.Identifier{
.ref = ref,
}, loc),
.args = ExprNodeList.init(args),
@@ -17963,7 +17965,7 @@ fn NewParser_(
}
pub inline fn @"module.exports"(p: *P, loc: logger.Loc) Expr {
- return p.e(E.Dot{ .name = exports_string_name, .name_loc = loc, .target = p.e(E.Identifier{ .ref = p.module_ref }, loc) }, loc);
+ return p.newExpr(E.Dot{ .name = exports_string_name, .name_loc = loc, .target = p.newExpr(E.Identifier{ .ref = p.module_ref }, loc) }, loc);
}
// This assumes that the open parenthesis has already been parsed by the caller
@@ -18009,7 +18011,7 @@ fn NewParser_(
var item = try p.parseExprOrBindings(.comma, &errors);
if (is_spread) {
- item = p.e(E.Spread{ .value = item }, loc);
+ item = p.newExpr(E.Spread{ .value = item }, loc);
}
// Skip over types
@@ -18115,7 +18117,7 @@ fn NewParser_(
arrow.is_async = opts.is_async;
arrow.has_rest_arg = spread_range.len > 0;
p.popScope();
- return p.e(arrow, loc);
+ return p.newExpr(arrow, loc);
}
}
@@ -18133,8 +18135,8 @@ fn NewParser_(
// Are these arguments for a call to a function named "async"?
if (opts.is_async) {
p.logExprErrors(&errors);
- const async_expr = p.e(E.Identifier{ .ref = try p.storeNameInRef("async") }, loc);
- return p.e(E.Call{ .target = async_expr, .args = ExprNodeList.init(items) }, loc);
+ const async_expr = p.newExpr(E.Identifier{ .ref = try p.storeNameInRef("async") }, loc);
+ return p.newExpr(E.Call{ .target = async_expr, .args = ExprNodeList.init(items) }, loc);
}
// Is this a chain of expressions and comma operators?
@@ -18222,7 +18224,7 @@ fn NewParser_(
kept_import_equals = kept_import_equals or result.kept_import_equals;
removed_import_equals = removed_import_equals or result.removed_import_equals;
part.import_record_indices = part.import_record_indices;
- part.declared_symbols = p.declared_symbols.toOwnedSlice(allocator);
+ part.declared_symbols = try p.declared_symbols.toOwnedSlice(allocator);
part.stmts = result.stmts;
if (part.stmts.len > 0) {
if (p.module_scope.contains_direct_eval and part.declared_symbols.len > 0) {
@@ -18290,7 +18292,7 @@ fn NewParser_(
var new_stmts_list = allocator.alloc(Stmt, exports_from_count + imports_count + 1) catch unreachable;
var imports_list = new_stmts_list[0..imports_count];
- var exports_list = if (exports_from_count > 0) new_stmts_list[imports_list.len + 1 ..] else &[_]Stmt{};
+ var exports_list: []Stmt = if (exports_from_count > 0) new_stmts_list[imports_list.len + 1 ..] else &[_]Stmt{};
require_function_args[0] = G.Arg{ .binding = p.b(B.Identifier{ .ref = p.module_ref }, logger.Loc.Empty) };
require_function_args[1] = G.Arg{ .binding = p.b(B.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty) };
@@ -18317,7 +18319,7 @@ fn NewParser_(
}
}
- commonjs_wrapper.data.e_call.args.ptr[0] = p.e(
+ commonjs_wrapper.data.e_call.args.ptr[0] = p.newExpr(
E.Function{ .func = G.Fn{
.name = null,
.open_parens_loc = logger.Loc.Empty,
@@ -18336,7 +18338,7 @@ fn NewParser_(
sourcefile_name = sourcefile_name[end..];
}
}
- commonjs_wrapper.data.e_call.args.ptr[1] = p.e(E.String{ .data = sourcefile_name }, logger.Loc.Empty);
+ commonjs_wrapper.data.e_call.args.ptr[1] = p.newExpr(E.String{ .data = sourcefile_name }, logger.Loc.Empty);
new_stmts_list[imports_list.len] = p.s(
S.ExportDefault{
@@ -18459,13 +18461,13 @@ fn NewParser_(
const new_call_args_count: usize = if (p.options.features.react_fast_refresh) 3 else 2;
var call_args = try allocator.alloc(Expr, new_call_args_count + 1);
var new_call_args = call_args[0..new_call_args_count];
- var hmr_module_ident = p.e(E.Identifier{ .ref = p.hmr_module.ref }, logger.Loc.Empty);
+ var hmr_module_ident = p.newExpr(E.Identifier{ .ref = p.hmr_module.ref }, logger.Loc.Empty);
- new_call_args[0] = p.e(E.Number{ .value = @intToFloat(f64, p.options.filepath_hash_for_hmr) }, logger.Loc.Empty);
+ new_call_args[0] = p.newExpr(E.Number{ .value = @intToFloat(f64, p.options.filepath_hash_for_hmr) }, logger.Loc.Empty);
// This helps us provide better error messages
- new_call_args[1] = p.e(E.String{ .data = p.source.path.pretty }, logger.Loc.Empty);
+ new_call_args[1] = p.newExpr(E.String{ .data = p.source.path.pretty }, logger.Loc.Empty);
if (p.options.features.react_fast_refresh) {
- new_call_args[2] = p.e(E.Identifier{ .ref = p.jsx_refresh_runtime.ref }, logger.Loc.Empty);
+ new_call_args[2] = p.newExpr(E.Identifier{ .ref = p.jsx_refresh_runtime.ref }, logger.Loc.Empty);
}
var toplevel_stmts_i: u8 = 0;
@@ -18482,9 +18484,9 @@ fn NewParser_(
const hmr_import_ref = hmr_import_module_.ref;
first_decl[0] = G.Decl{
.binding = p.b(B.Identifier{ .ref = p.hmr_module.ref }, logger.Loc.Empty),
- .value = p.e(E.New{
+ .value = p.newExpr(E.New{
.args = ExprNodeList.init(new_call_args),
- .target = p.e(
+ .target = p.newExpr(
E.Identifier{
.ref = hmr_import_ref,
},
@@ -18495,8 +18497,8 @@ fn NewParser_(
};
first_decl[1] = G.Decl{
.binding = p.b(B.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty),
- .value = p.e(E.Dot{
- .target = p.e(E.Identifier{ .ref = p.hmr_module.ref }, logger.Loc.Empty),
+ .value = p.newExpr(E.Dot{
+ .target = p.newExpr(E.Identifier{ .ref = p.hmr_module.ref }, logger.Loc.Empty),
.name = "exports",
.name_loc = logger.Loc.Empty,
}, logger.Loc.Empty),
@@ -18514,7 +18516,7 @@ fn NewParser_(
var export_name_string_all = try allocator.alloc(u8, export_name_string_length);
var export_name_string_remainder = export_name_string_all;
- var hmr_module_exports_dot = p.e(
+ var hmr_module_exports_dot = p.newExpr(
E.Dot{
.target = hmr_module_ident,
.name = "exports",
@@ -18525,7 +18527,7 @@ fn NewParser_(
var exports_decls = decls[first_decl.len..];
named_exports_iter = p.named_exports.iterator();
var update_function_args = try allocator.alloc(G.Arg, 1);
- var exports_ident = p.e(E.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty);
+ var exports_ident = p.newExpr(E.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty);
update_function_args[0] = G.Arg{ .binding = p.b(B.Identifier{ .ref = p.exports_ref }, logger.Loc.Empty) };
while (named_exports_iter.next()) |named_export| {
@@ -18550,12 +18552,12 @@ fn NewParser_(
// was this originally a named import?
// preserve the identifier
S.Return{ .value = if (named_export_symbol.namespace_alias != null)
- p.e(E.ImportIdentifier{
+ p.newExpr(E.ImportIdentifier{
.ref = named_export_value.ref,
.was_originally_identifier = true,
}, logger.Loc.Empty)
else
- p.e(E.Identifier{
+ p.newExpr(E.Identifier{
.ref = named_export_value.ref,
}, logger.Loc.Empty) },
logger.Loc.Empty,
@@ -18567,7 +18569,7 @@ fn NewParser_(
.name = .{ .ref = name_ref, .loc = logger.Loc.Empty },
};
- var decl_value = p.e(
+ var decl_value = p.newExpr(
E.Dot{ .target = hmr_module_exports_dot, .name = named_export.key_ptr.*, .name_loc = logger.Loc.Empty },
logger.Loc.Empty,
);
@@ -18577,11 +18579,11 @@ fn NewParser_(
};
update_function_stmts[named_export_i] = Expr.assignStmt(
- p.e(
+ p.newExpr(
E.Identifier{ .ref = name_ref },
logger.Loc.Empty,
),
- p.e(E.Dot{
+ p.newExpr(E.Dot{
.target = exports_ident,
.name = named_export.key_ptr.*,
.name_loc = logger.Loc.Empty,
@@ -18590,8 +18592,8 @@ fn NewParser_(
);
export_properties[named_export_i] = G.Property{
- .key = p.e(E.String{ .data = named_export.key_ptr.* }, logger.Loc.Empty),
- .value = p.e(
+ .key = p.newExpr(E.String{ .data = named_export.key_ptr.* }, logger.Loc.Empty),
+ .value = p.newExpr(
E.Arrow{
.args = &[_]G.Arg{},
.body = .{
@@ -18606,16 +18608,16 @@ fn NewParser_(
named_export_i += 1;
}
var export_all_args = call_args[new_call_args.len..];
- export_all_args[0] = p.e(
+ export_all_args[0] = p.newExpr(
E.Object{ .properties = Property.List.init(export_properties[0..named_export_i]) },
logger.Loc.Empty,
);
part_stmts[part_stmts.len - 1] = p.s(
S.SExpr{
- .value = p.e(
+ .value = p.newExpr(
E.Call{
- .target = p.e(
+ .target = p.newExpr(
E.Dot{
.target = hmr_module_ident,
.name = "exportAll",
@@ -18642,7 +18644,7 @@ fn NewParser_(
const is_async = !p.top_level_await_keyword.isEmpty();
- var func = p.e(
+ var func = p.newExpr(
E.Function{
.func = .{
.body = .{ .loc = logger.Loc.Empty, .stmts = part_stmts[0 .. part_stmts_i + 1] },
@@ -18657,10 +18659,10 @@ fn NewParser_(
logger.Loc.Empty,
);
- const call_load = p.e(
+ const call_load = p.newExpr(
E.Call{
.target = Expr.assign(
- p.e(
+ p.newExpr(
E.Dot{
.name = "_load",
.target = hmr_module_ident,
@@ -18678,7 +18680,7 @@ fn NewParser_(
toplevel_stmts[toplevel_stmts_i] = p.s(
S.SExpr{
.value = if (is_async)
- p.e(E.Await{ .value = call_load }, logger.Loc.Empty)
+ p.newExpr(E.Await{ .value = call_load }, logger.Loc.Empty)
else
call_load,
},
@@ -18708,7 +18710,7 @@ fn NewParser_(
toplevel_stmts[toplevel_stmts_i] = p.s(
S.SExpr{
.value = Expr.assign(
- p.e(
+ p.newExpr(
E.Dot{
.name = "_update",
.target = hmr_module_ident,
@@ -18716,7 +18718,7 @@ fn NewParser_(
},
logger.Loc.Empty,
),
- p.e(
+ p.newExpr(
E.Function{
.func = .{
.body = .{ .loc = logger.Loc.Empty, .stmts = if (named_export_i > 0) update_function_stmts[0..named_export_i] else &.{} },
diff --git a/src/js_printer.zig b/src/js_printer.zig
index 1a817cc37..1f2237ab3 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -179,12 +179,12 @@ pub fn quoteForJSON(text: []const u8, output_: MutableString, comptime ascii_onl
try bytes.appendSlice("\\n");
i += 1;
},
- std.ascii.control_code.CR => {
+ std.ascii.control_code.cr => {
try bytes.appendSlice("\\r");
i += 1;
},
// \v
- std.ascii.control_code.VT => {
+ std.ascii.control_code.vt => {
try bytes.appendSlice("\\v");
i += 1;
},
@@ -326,12 +326,12 @@ pub fn writeJSONString(input: []const u8, comptime Writer: type, writer: Writer,
try writer.writeAll("\\n");
text = text[1..];
},
- std.ascii.control_code.CR => {
+ std.ascii.control_code.cr => {
try writer.writeAll("\\r");
text = text[1..];
},
// \v
- std.ascii.control_code.VT => {
+ std.ascii.control_code.vt => {
try writer.writeAll("\\v");
text = text[1..];
},
@@ -406,7 +406,7 @@ pub const SourceMapHandler = struct {
ctx: *anyopaque,
callback: Callback,
- const Callback = (fn (*anyopaque, chunk: SourceMap.Chunk, source: logger.Source) anyerror!void);
+ const Callback = *const fn (*anyopaque, chunk: SourceMap.Chunk, source: logger.Source) anyerror!void;
pub fn onSourceMapChunk(self: *const @This(), chunk: SourceMap.Chunk, source: logger.Source) anyerror!void {
try self.callback(self.ctx, chunk, source);
}
@@ -616,7 +616,7 @@ pub fn NewPrinter(
var remaining: usize = n;
while (remaining > 0) {
- const to_write = @minimum(remaining, bytes.len);
+ const to_write = @min(remaining, bytes.len);
try self.writeAll(bytes[0..to_write]);
remaining -= to_write;
}
@@ -677,7 +677,7 @@ pub fn NewPrinter(
var i: usize = p.options.indent * 2;
while (i > 0) {
- const amt = @minimum(i, indentation_buf.len);
+ const amt = @min(i, indentation_buf.len);
p.print(indentation_buf[0..amt]);
i -= amt;
}
@@ -1255,13 +1255,13 @@ pub fn NewPrinter(
}
},
// we never print \r un-escaped
- std.ascii.control_code.CR => {
+ std.ascii.control_code.cr => {
e.print("\\r");
},
// \v
- std.ascii.control_code.VT => {
+ std.ascii.control_code.vt => {
if (quote == '`') {
- e.print(std.ascii.control_code.VT);
+ e.print(std.ascii.control_code.vt);
} else {
e.print("\\v");
}
@@ -1542,7 +1542,7 @@ pub fn NewPrinter(
}
fn printClauseItem(p: *Printer, item: js_ast.ClauseItem) void {
- return printClauseItemAs(p, item, .@"import");
+ return printClauseItemAs(p, item, .import);
}
fn printExportClauseItem(p: *Printer, item: js_ast.ClauseItem) void {
@@ -1552,7 +1552,7 @@ pub fn NewPrinter(
fn printClauseItemAs(p: *Printer, item: js_ast.ClauseItem, comptime as: @Type(.EnumLiteral)) void {
const name = p.renamer.nameForSymbol(item.name.ref.?);
- if (comptime as == .@"import") {
+ if (comptime as == .import) {
p.printClauseAlias(item.alias);
if (!strings.eql(name, item.alias)) {
@@ -1988,7 +1988,7 @@ pub fn NewPrinter(
if (e.func.name) |sym| {
p.printSpaceBeforeIdentifier();
p.addSourceMapping(sym.loc);
- p.printSymbol(sym.ref orelse Global.panic("internal error: expected E.Function's name symbol to have a ref\n{s}", .{e.func}));
+ p.printSymbol(sym.ref orelse Global.panic("internal error: expected E.Function's name symbol to have a ref\n{any}", .{e.func}));
}
p.printFunc(e.func);
@@ -2009,7 +2009,7 @@ pub fn NewPrinter(
if (e.class_name) |name| {
p.print(" ");
p.addSourceMapping(name.loc);
- p.printSymbol(name.ref orelse Global.panic("internal error: expected E.Class's name symbol to have a ref\n{s}", .{e}));
+ p.printSymbol(name.ref orelse Global.panic("internal error: expected E.Class's name symbol to have a ref\n{any}", .{e}));
}
p.printClass(e.*);
if (wrap) {
@@ -2459,7 +2459,7 @@ pub fn NewPrinter(
}
},
else => {
- // Global.panic("Unexpected expression of type {s}", .{std.meta.activeTag(expr.data});
+ // Global.panic("Unexpected expression of type {any}", .{std.meta.activeTag(expr.data});
},
}
}
@@ -2988,7 +2988,7 @@ pub fn NewPrinter(
p.print("}");
},
else => {
- Global.panic("Unexpected binding of type {s}", .{binding});
+ Global.panic("Unexpected binding of type {any}", .{binding});
},
}
}
@@ -3017,8 +3017,8 @@ pub fn NewPrinter(
.s_function => |s| {
p.printIndent();
p.printSpaceBeforeIdentifier();
- const name = s.func.name orelse Global.panic("Internal error: expected func to have a name ref\n{s}", .{s});
- const nameRef = name.ref orelse Global.panic("Internal error: expected func to have a name\n{s}", .{s});
+ const name = s.func.name orelse Global.panic("Internal error: expected func to have a name ref\n{any}", .{s});
+ const nameRef = name.ref orelse Global.panic("Internal error: expected func to have a name\n{any}", .{s});
if (s.func.flags.contains(.is_export)) {
if (!rewrite_esm_to_cjs) {
@@ -3177,7 +3177,7 @@ pub fn NewPrinter(
if (class.class.class_name) |name| {
p.print("class ");
- p.printSymbol(name.ref orelse Global.panic("Internal error: Expected class to have a name ref\n{s}", .{class}));
+ p.printSymbol(name.ref orelse Global.panic("Internal error: Expected class to have a name ref\n{any}", .{class}));
} else {
p.print("class");
}
@@ -3199,7 +3199,7 @@ pub fn NewPrinter(
}
},
else => {
- Global.panic("Internal error: unexpected export default stmt data {s}", .{s});
+ Global.panic("Internal error: unexpected export default stmt data {any}", .{s});
},
}
},
@@ -3487,7 +3487,7 @@ pub fn NewPrinter(
// we need to handle symbol collisions for this
p.print("$eXp0rT_");
var buf: [16]u8 = undefined;
- p.print(std.fmt.bufPrint(&buf, "{}", .{std.fmt.fmtSliceHexLower(&@bitCast([4]u8, symbol_counter))}) catch unreachable);
+ p.print(std.fmt.bufPrint(&buf, "{}", .{bun.fmt.hexIntLower(symbol_counter)}) catch unreachable);
symbol_counter +|= 1;
}
@@ -3658,7 +3658,7 @@ pub fn NewPrinter(
},
.s_label => |s| {
p.printIndent();
- p.printSymbol(s.name.ref orelse Global.panic("Internal error: expected label to have a name {s}", .{s}));
+ p.printSymbol(s.name.ref orelse Global.panic("Internal error: expected label to have a name {any}", .{s}));
p.print(":");
p.printBody(s.stmt);
},
@@ -4299,7 +4299,7 @@ pub fn NewPrinter(
return;
}
- @call(.{ .modifier = .always_inline }, printModuleId, .{ p, p.import_records[import_record_index].module_id });
+ @call(.always_inline, printModuleId, .{ p, p.import_records[import_record_index].module_id });
}
pub fn printCallModuleID(p: *Printer, module_id: u32) void {
@@ -4388,7 +4388,7 @@ pub fn NewPrinter(
// for(;)
.s_empty => {},
else => {
- Global.panic("Internal error: Unexpected stmt in for loop {s}", .{initSt});
+ Global.panic("Internal error: Unexpected stmt in for loop {any}", .{initSt});
},
}
}
@@ -4788,11 +4788,11 @@ pub fn NewWriter(
}
pub inline fn prevChar(writer: *const Self) u8 {
- return @call(.{ .modifier = .always_inline }, getLastByte, .{&writer.ctx});
+ return @call(.always_inline, getLastByte, .{&writer.ctx});
}
pub inline fn prevPrevChar(writer: *const Self) u8 {
- return @call(.{ .modifier = .always_inline }, getLastLastByte, .{&writer.ctx});
+ return @call(.always_inline, getLastLastByte, .{&writer.ctx});
}
pub fn reserve(writer: *Self, count: u32) anyerror![*]u8 {
@@ -4807,7 +4807,7 @@ pub fn NewWriter(
pub const Error = error{FormatError};
pub fn writeAll(writer: *Self, bytes: anytype) Error!usize {
- const written = @maximum(writer.written, 0);
+ const written = @max(writer.written, 0);
writer.print(@TypeOf(bytes), bytes);
return @intCast(usize, writer.written) - @intCast(usize, written);
}
@@ -4992,8 +4992,8 @@ const FileWriterInternal = struct {
pub const BufferWriter = struct {
buffer: MutableString = undefined,
- written: []u8 = "",
- sentinel: [:0]u8 = "",
+ written: []u8 = &[_]u8{},
+ sentinel: [:0]const u8 = "",
append_null_byte: bool = false,
append_newline: bool = false,
approximate_newline_count: usize = 0,
@@ -5193,7 +5193,7 @@ pub fn printAst(
try printer.writer.done();
- return @intCast(usize, @maximum(printer.writer.written, 0));
+ return @intCast(usize, @max(printer.writer.written, 0));
}
pub fn printJSON(
@@ -5227,7 +5227,7 @@ pub fn printJSON(
}
try printer.writer.done();
- return @intCast(usize, @maximum(printer.writer.written, 0));
+ return @intCast(usize, @max(printer.writer.written, 0));
}
pub fn printCommonJS(
@@ -5287,7 +5287,7 @@ pub fn printCommonJS(
try printer.writer.done();
- return @intCast(usize, @maximum(printer.writer.written, 0));
+ return @intCast(usize, @max(printer.writer.written, 0));
}
pub const WriteResult = struct {
@@ -5374,7 +5374,7 @@ pub fn printCommonJSThreaded(
@atomicStore(u32, end_off_ptr, result.end_off, .SeqCst);
}
- result.len = @intCast(usize, @maximum(printer.writer.written, 0));
+ result.len = @intCast(usize, @max(printer.writer.written, 0));
return result;
}
diff --git a/src/json_parser.zig b/src/json_parser.zig
index de9203893..619590c0f 100644
--- a/src/json_parser.zig
+++ b/src/json_parser.zig
@@ -85,7 +85,7 @@ const HashMapPool = struct {
};
// This hack fixes using LLDB
-fn JSONLikeParser(opts: js_lexer.JSONOptions) type {
+fn JSONLikeParser(comptime opts: js_lexer.JSONOptions) type {
return JSONLikeParser_(
opts.is_json,
opts.allow_comments,
@@ -98,13 +98,13 @@ fn JSONLikeParser(opts: js_lexer.JSONOptions) type {
}
fn JSONLikeParser_(
- opts_is_json: bool,
- opts_allow_comments: bool,
- opts_allow_trailing_commas: bool,
- opts_ignore_leading_escape_sequences: bool,
- opts_ignore_trailing_escape_sequences: bool,
- opts_json_warn_duplicate_keys: bool,
- opts_was_originally_macro: bool,
+ comptime opts_is_json: bool,
+ comptime opts_allow_comments: bool,
+ comptime opts_allow_trailing_commas: bool,
+ comptime opts_ignore_leading_escape_sequences: bool,
+ comptime opts_ignore_trailing_escape_sequences: bool,
+ comptime opts_json_warn_duplicate_keys: bool,
+ comptime opts_was_originally_macro: bool,
) type {
const opts = js_lexer.JSONOptions{
.is_json = opts_is_json,
@@ -305,7 +305,7 @@ fn JSONLikeParser_(
if (comptime Environment.isDebug) {
std.io.getStdErr().writer().print("\nThis range: {d} - {d} \n{s}", .{
p.lexer.range().loc.start,
- p.lexer.range().end(),
+ p.lexer.range().end().start,
p.lexer.range().in(p.lexer.source.contents),
}) catch {};
@@ -467,7 +467,7 @@ pub const PackageJSONVersionChecker = struct {
// first one wins
if (key.data == .e_string and value.data == .e_string) {
if (!p.has_found_name and strings.eqlComptime(key.data.e_string.data, "name")) {
- const len = @minimum(
+ const len = @min(
value.data.e_string.data.len,
p.found_name_buf.len,
);
@@ -476,7 +476,7 @@ pub const PackageJSONVersionChecker = struct {
p.found_name = p.found_name_buf[0..len];
p.has_found_name = true;
} else if (!p.has_found_version and strings.eqlComptime(key.data.e_string.data, "version")) {
- const len = @minimum(
+ const len = @min(
value.data.e_string.data.len,
p.found_version_buf.len,
);
@@ -524,7 +524,7 @@ pub fn toAST(
comptime Type: type,
value: Type,
) anyerror!js_ast.Expr {
- const type_info: std.builtin.TypeInfo = @typeInfo(Type);
+ const type_info: std.builtin.Type = @typeInfo(Type);
switch (type_info) {
.Bool => {
@@ -592,13 +592,13 @@ pub fn toAST(
return Expr.init(js_ast.E.Array, js_ast.E.Array{ .items = exprs }, logger.Loc.Empty);
},
.Struct => |Struct| {
- const fields: []const std.builtin.TypeInfo.StructField = Struct.fields;
+ const fields: []const std.builtin.Type.StructField = Struct.fields;
var properties = try allocator.alloc(js_ast.G.Property, fields.len);
var property_i: usize = 0;
inline for (fields) |field| {
properties[property_i] = G.Property{
.key = Expr.init(E.String, E.String{ .data = field.name }, logger.Loc.Empty),
- .value = try toAST(allocator, field.field_type, @field(value, field.name)),
+ .value = try toAST(allocator, field.type, @field(value, field.name)),
};
property_i += 1;
}
@@ -644,7 +644,7 @@ pub fn toAST(
.fields = &.{
.{
.name = u_field.name,
- .field_type = @TypeOf(
+ .type = @TypeOf(
@field(value, u_field.name),
),
.is_comptime = false,
diff --git a/src/libarchive/libarchive-bindings.zig b/src/libarchive/libarchive-bindings.zig
index e1c3ef920..2f71491a5 100644
--- a/src/libarchive/libarchive-bindings.zig
+++ b/src/libarchive/libarchive-bindings.zig
@@ -11,13 +11,13 @@ const FILE = @import("std").c.FILE;
const dev_t = @import("std").c.dev_t;
pub const FileType = enum(mode_t) {
- regular = 0100000,
- link = 0120000,
- socket = 0140000,
- character_oriented_device = 0020000,
- block_oriented_device = 0060000,
- directory = 0040000,
- fifo = 0010000,
+ regular = 0o100000,
+ link = 0o120000,
+ socket = 0o140000,
+ character_oriented_device = 0o020000,
+ block_oriented_device = 0o060000,
+ directory = 0o040000,
+ fifo = 0o010000,
};
pub const SymlinkType = enum(c_int) {
@@ -140,15 +140,15 @@ pub extern fn archive_bzlib_version() [*c]const u8;
pub extern fn archive_liblz4_version() [*c]const u8;
pub extern fn archive_libzstd_version() [*c]const u8;
-pub const archive_read_callback = fn (*struct_archive, *anyopaque, [*c]*const anyopaque) callconv(.C) la_ssize_t;
-pub const archive_skip_callback = fn (*struct_archive, *anyopaque, la_int64_t) callconv(.C) la_int64_t;
-pub const archive_seek_callback = fn (*struct_archive, *anyopaque, la_int64_t, c_int) callconv(.C) la_int64_t;
-pub const archive_write_callback = fn (*struct_archive, *anyopaque, ?*const anyopaque, usize) callconv(.C) la_ssize_t;
-pub const archive_open_callback = fn (*struct_archive, *anyopaque) callconv(.C) c_int;
-pub const archive_close_callback = fn (*struct_archive, *anyopaque) callconv(.C) c_int;
-pub const archive_free_callback = fn (*struct_archive, *anyopaque) callconv(.C) c_int;
-pub const archive_switch_callback = fn (*struct_archive, *anyopaque, ?*anyopaque) callconv(.C) c_int;
-pub const archive_passphrase_callback = fn (*struct_archive, *anyopaque) callconv(.C) [*c]const u8;
+pub const archive_read_callback = *const fn (*struct_archive, *anyopaque, [*c]*const anyopaque) callconv(.C) la_ssize_t;
+pub const archive_skip_callback = *const fn (*struct_archive, *anyopaque, la_int64_t) callconv(.C) la_int64_t;
+pub const archive_seek_callback = *const fn (*struct_archive, *anyopaque, la_int64_t, c_int) callconv(.C) la_int64_t;
+pub const archive_write_callback = *const fn (*struct_archive, *anyopaque, ?*const anyopaque, usize) callconv(.C) la_ssize_t;
+pub const archive_open_callback = *const fn (*struct_archive, *anyopaque) callconv(.C) c_int;
+pub const archive_close_callback = *const fn (*struct_archive, *anyopaque) callconv(.C) c_int;
+pub const archive_free_callback = *const fn (*struct_archive, *anyopaque) callconv(.C) c_int;
+pub const archive_switch_callback = *const fn (*struct_archive, *anyopaque, ?*anyopaque) callconv(.C) c_int;
+pub const archive_passphrase_callback = *const fn (*struct_archive, *anyopaque) callconv(.C) [*c]const u8;
pub extern fn archive_read_new() *struct_archive;
pub extern fn archive_read_support_compression_all(*struct_archive) c_int;
pub extern fn archive_read_support_compression_bzip2(*struct_archive) c_int;
@@ -244,7 +244,7 @@ pub extern fn archive_read_add_passphrase(*struct_archive, [*c]const u8) c_int;
pub extern fn archive_read_set_passphrase_callback(*struct_archive, client_data: ?*anyopaque, ?archive_passphrase_callback) c_int;
pub extern fn archive_read_extract(*struct_archive, *struct_archive_entry, flags: c_int) c_int;
pub extern fn archive_read_extract2(*struct_archive, *struct_archive_entry, *struct_archive) c_int;
-pub extern fn archive_read_extract_set_progress_callback(*struct_archive, _progress_func: ?fn (?*anyopaque) callconv(.C) void, _user_data: ?*anyopaque) void;
+pub extern fn archive_read_extract_set_progress_callback(*struct_archive, _progress_func: ?*const fn (?*anyopaque) callconv(.C) void, _user_data: ?*anyopaque) void;
pub extern fn archive_read_extract_set_skip_file(*struct_archive, la_int64_t, la_int64_t) void;
pub extern fn archive_read_close(*struct_archive) c_int;
pub extern fn archive_read_free(*struct_archive) c_int;
@@ -334,8 +334,8 @@ pub extern fn archive_write_disk_new() *struct_archive;
pub extern fn archive_write_disk_set_skip_file(*struct_archive, la_int64_t, la_int64_t) c_int;
pub extern fn archive_write_disk_set_options(*struct_archive, flags: c_int) c_int;
pub extern fn archive_write_disk_set_standard_lookup(*struct_archive) c_int;
-pub extern fn archive_write_disk_set_group_lookup(*struct_archive, ?*anyopaque, ?fn (?*anyopaque, [*c]const u8, la_int64_t) callconv(.C) la_int64_t, ?fn (?*anyopaque) callconv(.C) void) c_int;
-pub extern fn archive_write_disk_set_user_lookup(*struct_archive, ?*anyopaque, ?fn (?*anyopaque, [*c]const u8, la_int64_t) callconv(.C) la_int64_t, ?fn (?*anyopaque) callconv(.C) void) c_int;
+pub extern fn archive_write_disk_set_group_lookup(*struct_archive, ?*anyopaque, ?*const fn (?*anyopaque, [*c]const u8, la_int64_t) callconv(.C) la_int64_t, ?*const fn (?*anyopaque) callconv(.C) void) c_int;
+pub extern fn archive_write_disk_set_user_lookup(*struct_archive, ?*anyopaque, ?*const fn (?*anyopaque, [*c]const u8, la_int64_t) callconv(.C) la_int64_t, ?*const fn (?*anyopaque) callconv(.C) void) c_int;
pub extern fn archive_write_disk_gid(*struct_archive, [*c]const u8, la_int64_t) la_int64_t;
pub extern fn archive_write_disk_uid(*struct_archive, [*c]const u8, la_int64_t) la_int64_t;
pub extern fn archive_read_disk_new() *struct_archive;
@@ -346,8 +346,8 @@ pub extern fn archive_read_disk_entry_from_file(*struct_archive, *struct_archive
pub extern fn archive_read_disk_gname(*struct_archive, la_int64_t) [*c]const u8;
pub extern fn archive_read_disk_uname(*struct_archive, la_int64_t) [*c]const u8;
pub extern fn archive_read_disk_set_standard_lookup(*struct_archive) c_int;
-pub extern fn archive_read_disk_set_gname_lookup(*struct_archive, ?*anyopaque, ?fn (?*anyopaque, la_int64_t) callconv(.C) [*c]const u8, ?fn (?*anyopaque) callconv(.C) void) c_int;
-pub extern fn archive_read_disk_set_uname_lookup(*struct_archive, ?*anyopaque, ?fn (?*anyopaque, la_int64_t) callconv(.C) [*c]const u8, ?fn (?*anyopaque) callconv(.C) void) c_int;
+pub extern fn archive_read_disk_set_gname_lookup(*struct_archive, ?*anyopaque, ?*const fn (?*anyopaque, la_int64_t) callconv(.C) [*c]const u8, ?*const fn (?*anyopaque) callconv(.C) void) c_int;
+pub extern fn archive_read_disk_set_uname_lookup(*struct_archive, ?*anyopaque, ?*const fn (?*anyopaque, la_int64_t) callconv(.C) [*c]const u8, ?*const fn (?*anyopaque) callconv(.C) void) c_int;
pub extern fn archive_read_disk_open(*struct_archive, [*c]const u8) c_int;
pub extern fn archive_read_disk_open_w(*struct_archive, [*c]const wchar_t) c_int;
pub extern fn archive_read_disk_descend(*struct_archive) c_int;
@@ -357,8 +357,8 @@ pub extern fn archive_read_disk_current_filesystem_is_synthetic(*struct_archive)
pub extern fn archive_read_disk_current_filesystem_is_remote(*struct_archive) c_int;
pub extern fn archive_read_disk_set_atime_restored(*struct_archive) c_int;
pub extern fn archive_read_disk_set_behavior(*struct_archive, flags: c_int) c_int;
-pub extern fn archive_read_disk_set_matching(*struct_archive, _matching: *struct_archive, _excluded_func: ?fn (*struct_archive, ?*anyopaque, *struct_archive_entry) callconv(.C) void, _client_data: ?*anyopaque) c_int;
-pub extern fn archive_read_disk_set_metadata_filter_callback(*struct_archive, _metadata_filter_func: ?fn (*struct_archive, ?*anyopaque, *struct_archive_entry) callconv(.C) c_int, _client_data: ?*anyopaque) c_int;
+pub extern fn archive_read_disk_set_matching(*struct_archive, _matching: *struct_archive, _excluded_func: ?*const fn (*struct_archive, ?*anyopaque, *struct_archive_entry) callconv(.C) void, _client_data: ?*anyopaque) c_int;
+pub extern fn archive_read_disk_set_metadata_filter_callback(*struct_archive, _metadata_filter_func: ?*const fn (*struct_archive, ?*anyopaque, *struct_archive_entry) callconv(.C) c_int, _client_data: ?*anyopaque) c_int;
pub extern fn archive_free(*struct_archive) c_int;
pub extern fn archive_filter_count(*struct_archive) c_int;
pub extern fn archive_filter_bytes(*struct_archive, c_int) la_int64_t;
diff --git a/src/libarchive/libarchive.zig b/src/libarchive/libarchive.zig
index e10d58660..df260125f 100644
--- a/src/libarchive/libarchive.zig
+++ b/src/libarchive/libarchive.zig
@@ -401,14 +401,14 @@ pub const Archive = struct {
defer stream.deinit();
_ = stream.openRead();
var archive = stream.archive;
- const dir: std.fs.Dir = brk: {
+ const dir: std.fs.IterableDir = brk: {
const cwd = std.fs.cwd();
// if the destination doesn't exist, we skip the whole thing since nothing can overwrite it.
if (std.fs.path.isAbsolute(root)) {
- break :brk std.fs.openDirAbsolute(root, .{ .iterate = true }) catch return;
+ break :brk std.fs.openIterableDirAbsolute(root, .{}) catch return;
} else {
- break :brk cwd.openDir(root, .{ .iterate = true }) catch return;
+ break :brk cwd.openIterableDir(root, .{}) catch return;
}
};
@@ -436,7 +436,7 @@ pub const Archive = struct {
const size = @intCast(usize, std.math.max(lib.archive_entry_size(entry), 0));
if (size > 0) {
- var opened = dir.openFileZ(pathname, .{ .mode = .write_only }) catch continue :loop;
+ var opened = dir.dir.openFileZ(pathname, .{ .mode = .write_only }) catch continue :loop;
var stat = try opened.stat();
if (stat.size > 0) {
@@ -470,7 +470,7 @@ pub const Archive = struct {
pub fn extractToDir(
file_buffer: []const u8,
- dir: std.fs.Dir,
+ dir_: std.fs.IterableDir,
ctx: ?*Archive.Context,
comptime FilePathAppender: type,
appender: FilePathAppender,
@@ -486,6 +486,8 @@ pub const Archive = struct {
_ = stream.openRead();
var archive = stream.archive;
var count: u32 = 0;
+ const dir = dir_.dir;
+ const dir_fd = dir.fd;
loop: while (true) {
const r = @intToEnum(Status, lib.archive_read_next_header(archive, &entry));
@@ -530,20 +532,20 @@ pub const Archive = struct {
if ((mode & 0o4) != 0)
mode |= 0o1;
- std.os.mkdiratZ(dir.fd, pathname, @intCast(u32, mode)) catch |err| {
+ std.os.mkdiratZ(dir_fd, pathname, @intCast(u32, mode)) catch |err| {
if (err == error.PathAlreadyExists or err == error.NotDir) break;
try dir.makePath(std.fs.path.dirname(slice) orelse return err);
- try std.os.mkdiratZ(dir.fd, pathname, 0o777);
+ try std.os.mkdiratZ(dir_fd, pathname, 0o777);
};
},
Kind.SymLink => {
const link_target = lib.archive_entry_symlink(entry).?;
- std.os.symlinkatZ(link_target, dir.fd, pathname) catch |err| brk: {
+ std.os.symlinkatZ(link_target, dir_fd, pathname) catch |err| brk: {
switch (err) {
error.AccessDenied, error.FileNotFound => {
dir.makePath(std.fs.path.dirname(slice) orelse return err) catch {};
- break :brk try std.os.symlinkatZ(link_target, dir.fd, pathname);
+ break :brk try std.os.symlinkatZ(link_target, dir_fd, pathname);
},
else => {
return err;
@@ -569,7 +571,7 @@ pub const Archive = struct {
};
defer if (comptime close_handles) file.close();
- const entry_size = @maximum(lib.archive_entry_size(entry), 0);
+ const entry_size = @max(lib.archive_entry_size(entry), 0);
const size = @intCast(usize, entry_size);
if (size > 0) {
if (ctx) |ctx_| {
@@ -647,16 +649,16 @@ pub const Archive = struct {
comptime close_handles: bool,
comptime log: bool,
) !u32 {
- var dir: std.fs.Dir = brk: {
+ var dir: std.fs.IterableDir = brk: {
const cwd = std.fs.cwd();
cwd.makePath(
root,
) catch {};
if (std.fs.path.isAbsolute(root)) {
- break :brk try std.fs.openDirAbsolute(root, .{ .iterate = true });
+ break :brk try std.fs.openIterableDirAbsolute(root, .{});
} else {
- break :brk try cwd.openDir(root, .{ .iterate = true });
+ break :brk try cwd.openIterableDir(root, .{});
}
};
diff --git a/src/linker.zig b/src/linker.zig
index f41fd1a3c..b9ce293cd 100644
--- a/src/linker.zig
+++ b/src/linker.zig
@@ -41,7 +41,7 @@ const JSC = @import("bun").JSC;
const PluginRunner = @import("./bundler.zig").PluginRunner;
pub const CSSResolveError = error{ResolveError};
-pub const OnImportCallback = fn (resolve_result: *const Resolver.Result, import_record: *ImportRecord, origin: URL) void;
+pub const OnImportCallback = *const fn (resolve_result: *const Resolver.Result, import_record: *ImportRecord, origin: URL) void;
pub const Linker = struct {
const HashedFileNameMap = std.AutoHashMap(u64, string);
@@ -369,7 +369,7 @@ pub const Linker = struct {
}
if (package_name.len != text.len) {
if (node_modules_bundle.getPackage(package_name)) |pkg| {
- const import_path = text[@minimum(text.len, package_name.len + 1)..];
+ const import_path = text[@min(text.len, package_name.len + 1)..];
if (node_modules_bundle.findModuleIDInPackageIgnoringExtension(pkg, import_path)) |found_module| {
import_record.is_bundled = true;
node_module_bundle_import_path = node_module_bundle_import_path orelse
@@ -386,7 +386,7 @@ pub const Linker = struct {
}
}
- var resolved_import_ = brk: {
+ var resolved_import_: anyerror!Resolver.Result = brk: {
switch (import_record.tag) {
else => {},
// for fast refresh, attempt to read the version directly from the bundle instead of resolving it
@@ -397,7 +397,7 @@ pub const Linker = struct {
const package_name = runtime[0 .. strings.indexOfChar(runtime, '/') orelse runtime.len];
if (node_modules_bundle.getPackage(package_name)) |pkg| {
- const import_path = runtime[@minimum(runtime.len, package_name.len + 1)..];
+ const import_path = runtime[@min(runtime.len, package_name.len + 1)..];
if (node_modules_bundle.findModuleInPackage(pkg, import_path)) |found_module| {
import_record.is_bundled = true;
node_module_bundle_import_path = node_module_bundle_import_path orelse
@@ -444,13 +444,14 @@ pub const Linker = struct {
.failure => |err| {
break :brk err;
},
- .pending => |*pending| {
+ .pending => |pending1| {
+ var pending = pending1;
if (!linker.resolver.opts.global_cache.canInstall()) {
break :brk error.InstallationPending;
}
pending.import_record_id = record_i;
- try result.pending_imports.append(linker.allocator, pending.*);
+ try result.pending_imports.append(linker.allocator, pending);
continue;
},
.not_found => break :brk error.ModuleNotFound,
@@ -795,9 +796,9 @@ pub const Linker = struct {
else => {},
}
if (had_resolve_errors) return error.ResolveError;
- result.ast.externals = externals.toOwnedSlice();
+ result.ast.externals = try externals.toOwnedSlice();
- if (result.ast.needs_runtime and result.ast.runtime_import_record_id == null) {
+ if (result.ast.needs_runtime and (result.ast.runtime_import_record_id == null or import_records.len == 0)) {
var new_import_records = try linker.allocator.alloc(ImportRecord, import_records.len + 1);
std.mem.copy(ImportRecord, new_import_records, import_records);
@@ -823,27 +824,39 @@ pub const Linker = struct {
// Since they definitely aren't using require, we don't have to worry about the symbol being renamed.
if (needs_require and !result.ast.uses_require_ref) {
result.ast.uses_require_ref = true;
- require_part_import_clauses[0] = js_ast.ClauseItem{
- .alias = require_alias,
- .original_name = "",
- .alias_loc = logger.Loc.Empty,
- .name = js_ast.LocRef{
- .loc = logger.Loc.Empty,
- .ref = result.ast.require_ref,
+ const PrependPart = struct {
+ stmts: [1]js_ast.Stmt,
+ import_statement: js_ast.S.Import,
+ clause_items: [1]js_ast.ClauseItem,
+ };
+ var prepend = linker.allocator.create(PrependPart) catch unreachable;
+
+ prepend.* = .{
+ .clause_items = .{
+ .{
+ .alias = require_alias,
+ .original_name = "",
+ .alias_loc = logger.Loc.Empty,
+ .name = js_ast.LocRef{
+ .loc = logger.Loc.Empty,
+ .ref = result.ast.require_ref,
+ },
+ },
+ },
+ .import_statement = .{
+ .namespace_ref = Ref.None,
+ .items = &prepend.clause_items,
+ .import_record_index = result.ast.runtime_import_record_id.?,
},
+ .stmts = undefined,
};
- require_part_import_statement = js_ast.S.Import{
- .namespace_ref = Ref.None,
- .items = std.mem.span(&require_part_import_clauses),
- .import_record_index = result.ast.runtime_import_record_id.?,
- };
- require_part_stmts[0] = js_ast.Stmt{
- .data = .{ .s_import = &require_part_import_statement },
+ prepend.stmts[0] = .{
+ .data = .{ .s_import = &prepend.import_statement },
.loc = logger.Loc.Empty,
};
- result.ast.prepend_part = js_ast.Part{ .stmts = std.mem.span(&require_part_stmts) };
+ result.ast.prepend_part = js_ast.Part{ .stmts = &prepend.stmts };
}
}
@@ -933,10 +946,9 @@ pub const Linker = struct {
if (linker.options.serve) {
var hash_buf: [64]u8 = undefined;
const modkey = try linker.getModKey(basepath, null);
-
return Fs.Path.init(try origin.joinAlloc(
linker.allocator,
- std.fmt.bufPrint(&hash_buf, "hash:{x}/", .{modkey.hash()}) catch unreachable,
+ std.fmt.bufPrint(&hash_buf, "hash:{any}/", .{bun.fmt.hexIntLower(modkey.hash())}) catch unreachable,
dirname,
basename,
absolute_pathname.ext,
diff --git a/src/linux_c.zig b/src/linux_c.zig
index 7758a9aa8..2ff96c966 100644
--- a/src/linux_c.zig
+++ b/src/linux_c.zig
@@ -1,5 +1,4 @@
const std = @import("std");
-const sysResource = @cImport(@cInclude("sys/resource.h"));
const bun = @import("bun");
pub const SystemErrno = enum(u8) {
SUCCESS = 0,
@@ -353,14 +352,6 @@ pub fn get_system_loadavg() [3]f64 {
return [3]f64{ 0, 0, 0 };
}
-pub fn get_process_priority(pid: c_uint) i32 {
- return sysResource.getpriority(sysResource.PRIO_PROCESS, pid);
-}
-
-pub fn set_process_priority(pid: c_uint, priority: c_int) i32 {
- return sysResource.setpriority(sysResource.PRIO_PROCESS, pid, priority);
-}
-
pub fn get_version(name_buffer: *[std.os.HOST_NAME_MAX]u8) []const u8 {
const uts = std.os.uname();
const result = std.mem.sliceTo(std.meta.assumeSentinel(&uts.version, 0), 0);
@@ -457,8 +448,8 @@ pub const POSIX_SPAWN_SETSIGMASK = @as(c_int, 0x08);
pub const POSIX_SPAWN_SETSCHEDPARAM = @as(c_int, 0x10);
pub const POSIX_SPAWN_SETSCHEDULER = @as(c_int, 0x20);
-const posix_spawn_file_actions_addfchdir_np_type = fn (actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int;
-const posix_spawn_file_actions_addchdir_np_type = fn (actions: *posix_spawn_file_actions_t, path: [*:0]const u8) c_int;
+const posix_spawn_file_actions_addfchdir_np_type = *const fn (actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int;
+const posix_spawn_file_actions_addchdir_np_type = *const fn (actions: *posix_spawn_file_actions_t, path: [*:0]const u8) c_int;
/// When not available, these functions will return 0.
pub fn posix_spawn_file_actions_addfchdir_np(actions: *posix_spawn_file_actions_t, filedes: std.os.fd_t) c_int {
diff --git a/src/lock.zig b/src/lock.zig
index 7e6bfccdf..66d64cff2 100644
--- a/src/lock.zig
+++ b/src/lock.zig
@@ -24,7 +24,7 @@ pub const Mutex = struct {
inline fn acquireFast(self: *Mutex, comptime strong: bool) bool {
// On x86, "lock bts" uses less i-cache & can be faster than "lock cmpxchg" below.
if (comptime is_x86) {
- return self.state.bitSet(@ctz(u32, LOCKED), .Acquire) == UNLOCKED;
+ return self.state.bitSet(@ctz(@as(u32, LOCKED)), .Acquire) == UNLOCKED;
}
const cas_fn = comptime switch (strong) {
diff --git a/src/logger.zig b/src/logger.zig
index 79ee4a9d7..e2e14ed48 100644
--- a/src/logger.zig
+++ b/src/logger.zig
@@ -73,7 +73,7 @@ pub const Loc = packed struct {
pub const toUsize = i;
pub inline fn i(self: *const Loc) usize {
- return @intCast(usize, @maximum(self.start, 0));
+ return @intCast(usize, @max(self.start, 0));
}
pub const Empty = Loc{ .start = -1 };
@@ -100,7 +100,7 @@ pub const Location = struct {
pub fn count(this: Location, builder: *StringBuilder) void {
builder.count(this.file);
builder.count(this.namespace);
- if (this.line_text) |text| builder.count(text[0..@minimum(text.len, 690)]);
+ if (this.line_text) |text| builder.count(text[0..@min(text.len, 690)]);
if (this.suggestion) |text| builder.count(text);
}
@@ -556,7 +556,7 @@ pub const Range = packed struct {
pub fn in(this: Range, buf: []const u8) []const u8 {
if (this.loc.start < 0 or this.len <= 0) return "";
const slice = buf[@intCast(usize, this.loc.start)..];
- return slice[0..@minimum(@intCast(usize, this.len), buf.len)];
+ return slice[0..@min(@intCast(usize, this.len), buf.len)];
}
pub fn isEmpty(r: *const Range) bool {
@@ -663,7 +663,7 @@ pub const Log = struct {
const msgs: []const Msg = this.msgs.items;
var errors_stack: [256]*anyopaque = undefined;
- const count = @intCast(u16, @minimum(msgs.len, errors_stack.len));
+ const count = @intCast(u16, @min(msgs.len, errors_stack.len));
switch (count) {
0 => return JSC.JSValue.jsUndefined(),
1 => {
@@ -1242,7 +1242,7 @@ pub const Source = struct {
pub fn initErrorPosition(self: *const Source, _offset: Loc) ErrorPosition {
var prev_code_point: i32 = 0;
- var offset: usize = std.math.min(if (_offset.start < 0) 0 else @intCast(usize, _offset.start), @maximum(self.contents.len, 1) - 1);
+ var offset: usize = std.math.min(if (_offset.start < 0) 0 else @intCast(usize, _offset.start), @max(self.contents.len, 1) - 1);
const contents = self.contents;
diff --git a/src/main.zig b/src/main.zig
index 8e2edccec..ba3fd97d9 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -5,19 +5,16 @@ const MainPanicHandler = panicky.NewPanicHandler(std.builtin.default_panic);
pub const io_mode = .blocking;
-pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {
- MainPanicHandler.handle_panic(msg, error_return_trace);
+pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
+ MainPanicHandler.handle_panic(msg, error_return_trace, addr);
}
const CrashReporter = @import("./crash_reporter.zig");
pub fn main() void {
- const bun = @import("bun");
const Output = bun.Output;
const Environment = bun.Environment;
- const cli = @import("cli.zig");
-
if (comptime Environment.isRelease)
CrashReporter.start() catch unreachable;
@@ -37,11 +34,12 @@ pub fn main() void {
Output.Source.set(&output_source);
defer Output.flush();
- cli.Cli.start(bun.default_allocator, stdout, stderr, MainPanicHandler);
+ bun.CLI.Cli.start(bun.default_allocator, stdout, stderr, MainPanicHandler);
}
test "panic" {
panic("woah", null);
}
-pub usingnamespace @import("./bun.zig");
+pub const build_options = @import("build_options");
+pub const bun = @import("./bun.zig");
diff --git a/src/main_wasm.zig b/src/main_wasm.zig
index d5e665141..510e92b38 100644
--- a/src/main_wasm.zig
+++ b/src/main_wasm.zig
@@ -2,7 +2,7 @@ const JSParser = @import("./js_parser/js_parser.zig");
const JSPrinter = @import("./js_printer.zig");
const JSAst = @import("./js_ast.zig");
const Api = @import("./api/schema.zig").Api;
-const Logger = @import("bun").logger
+const Logger = @import("bun").logger;
const global = @import("bun");
const default_allocator = global.default_allocator;
const std = @import("std");
diff --git a/src/mdx/mdx_parser.zig b/src/mdx/mdx_parser.zig
index dcaf11143..b44ab239a 100644
--- a/src/mdx/mdx_parser.zig
+++ b/src/mdx/mdx_parser.zig
@@ -684,7 +684,7 @@ pub const MDParser = struct {
}
// Check for ordered list item marks
- max_end = @minimum(off + 9, this.size);
+ max_end = @min(off + 9, this.size);
container.start = 0;
while (off < max_end and std.ascii.isDigit(this.charAt(off))) {
container.start = container.start * 10 + (this.charAt(off) - '0');
@@ -1785,7 +1785,7 @@ pub const MDX = struct {
pub fn parse(this: *MDX) !js_ast.Result {
try this._parse();
- return try runVisitPassAndFinish(JSParser, &this.parser, this.stmts.toOwnedSlice(this.allocator));
+ return try runVisitPassAndFinish(JSParser, &this.parser, try this.stmts.toOwnedSlice(this.allocator));
}
fn run(this: *MDX) anyerror!logger.Loc {
@@ -1797,7 +1797,7 @@ pub const MDX = struct {
var root_children = std.ArrayListUnmanaged(Expr){};
var first_loc = try run(this, &root_children);
- first_loc.start = @maximum(first_loc.start, 0);
+ first_loc.start = @max(first_loc.start, 0);
const args_loc = first_loc;
first_loc.start += 1;
const body_loc = first_loc;
diff --git a/src/memory_allocator.zig b/src/memory_allocator.zig
index 2e21bbfa1..273b2aacf 100644
--- a/src/memory_allocator.zig
+++ b/src/memory_allocator.zig
@@ -5,6 +5,27 @@ const std = @import("std");
const mimalloc = @import("./allocators/mimalloc.zig");
const FeatureFlags = @import("./feature_flags.zig");
const Environment = @import("./env.zig");
+
+fn mimalloc_free(
+ _: *anyopaque,
+ buf: []u8,
+ buf_align: u8,
+ _: usize,
+) void {
+ // mi_free_size internally just asserts the size
+ // so it's faster if we don't pass that value through
+ // but its good to have that assertion
+ if (comptime Environment.allow_assert) {
+ assert(mimalloc.mi_is_in_heap_region(buf.ptr));
+ if (mimalloc.canUseAlignedAlloc(buf.len, buf_align))
+ mimalloc.mi_free_size_aligned(buf.ptr, buf.len, buf_align)
+ else
+ mimalloc.mi_free_size(buf.ptr, buf.len);
+ } else {
+ mimalloc.mi_free(buf.ptr);
+ }
+}
+
const c = struct {
pub const malloc_size = mimalloc.mi_malloc_size;
pub const malloc_usable_size = mimalloc.mi_malloc_usable_size;
@@ -35,86 +56,46 @@ const CAllocator = struct {
const malloc_size = c.malloc_size;
pub const supports_posix_memalign = true;
- // This is copied from Rust's mimalloc integration
- const MI_MAX_ALIGN_SIZE = 16;
- inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool {
- return (alignment == @sizeOf(*anyopaque) or
- (alignment == MI_MAX_ALIGN_SIZE and size >= (MI_MAX_ALIGN_SIZE / 2)));
- }
-
fn alignedAlloc(len: usize, alignment: usize) ?[*]u8 {
if (comptime FeatureFlags.log_allocations) std.debug.print("Malloc: {d}\n", .{len});
- var ptr = if (mi_malloc_satisfies_alignment(alignment, len))
- mimalloc.mi_malloc(len)
+ var ptr: ?*anyopaque = if (mimalloc.canUseAlignedAlloc(len, alignment))
+ mimalloc.mi_malloc_aligned(len, alignment)
else
- mimalloc.mi_malloc_aligned(len, alignment);
+ mimalloc.mi_malloc(len);
- return @ptrCast([*]u8, ptr orelse null);
+ if (comptime Environment.allow_assert) {
+ const usable = mimalloc.mi_malloc_usable_size(ptr);
+ if (usable < len) {
+ std.debug.panic("mimalloc: allocated size is too small: {d} < {d}", .{ usable, len });
+ }
+ }
+
+ return if (ptr) |p| @ptrCast([*]u8, p) else null;
}
fn alignedAllocSize(ptr: [*]u8) usize {
return CAllocator.malloc_size(ptr);
}
- fn alloc(
- _: *anyopaque,
- len: usize,
- alignment: u29,
- len_align: u29,
- return_address: usize,
- ) error{OutOfMemory}![]u8 {
- _ = return_address;
- assert(len > 0);
- assert(std.math.isPowerOfTwo(alignment));
-
- var ptr = alignedAlloc(len, alignment) orelse return error.OutOfMemory;
- if (len_align == 0) {
- return ptr[0..len];
- }
- return ptr[0..mem.alignBackwardAnyAlign(mimalloc.mi_usable_size(ptr), len_align)];
+ fn alloc(_: *anyopaque, len: usize, ptr_align: u8, _: usize) ?[*]u8 {
+ return alignedAlloc(len, ptr_align);
}
- fn resize(
- _: *anyopaque,
- buf: []u8,
- buf_align: u29,
- new_len: usize,
- len_align: u29,
- return_address: usize,
- ) ?usize {
- _ = buf_align;
- _ = return_address;
+ fn resize(_: *anyopaque, buf: []u8, _: u8, new_len: usize, _: usize) bool {
if (new_len <= buf.len) {
- return mem.alignAllocLen(buf.len, new_len, len_align);
+ return true;
}
const full_len = alignedAllocSize(buf.ptr);
if (new_len <= full_len) {
- return mem.alignAllocLen(full_len, new_len, len_align);
+ return true;
}
- return null;
+ return false;
}
- fn free(
- _: *anyopaque,
- buf: []u8,
- buf_align: u29,
- return_address: usize,
- ) void {
- _ = buf_align;
- _ = return_address;
- // mi_free_size internally just asserts the size
- // so it's faster if we don't pass that value through
- // but its good to have that assertion
- if (comptime Environment.allow_assert) {
- assert(mimalloc.mi_is_in_heap_region(buf.ptr));
- mimalloc.mi_free_size_aligned(buf.ptr, buf.len, buf_align);
- } else {
- mimalloc.mi_free(buf.ptr);
- }
- }
+ const free = mimalloc_free;
};
pub const c_allocator = Allocator{
@@ -122,12 +103,11 @@ pub const c_allocator = Allocator{
.vtable = &c_allocator_vtable,
};
const c_allocator_vtable = Allocator.VTable{
- .alloc = CAllocator.alloc,
- .resize = CAllocator.resize,
- .free = CAllocator.free,
+ .alloc = &CAllocator.alloc,
+ .resize = &CAllocator.resize,
+ .free = &CAllocator.free,
};
-// This is a memory allocator which always writes zero instead of undefined
const ZAllocator = struct {
const malloc_size = c.malloc_size;
pub const supports_posix_memalign = true;
@@ -147,62 +127,45 @@ const ZAllocator = struct {
else
mimalloc.mi_zalloc_aligned(len, alignment);
- return @ptrCast([*]u8, ptr orelse return null);
+ return @ptrCast([*]u8, ptr orelse null);
}
fn alignedAllocSize(ptr: [*]u8) usize {
- return ZAllocator.malloc_size(ptr);
+ return CAllocator.malloc_size(ptr);
}
- fn alloc(
- _: *anyopaque,
- len: usize,
- alignment: u29,
- len_align: u29,
- return_address: usize,
- ) error{OutOfMemory}![]u8 {
- _ = return_address;
- assert(len > 0);
- assert(std.math.isPowerOfTwo(alignment));
-
- var ptr = alignedAlloc(len, alignment) orelse return error.OutOfMemory;
- if (len_align == 0) {
- return ptr[0..len];
- }
- return ptr[0..mem.alignBackwardAnyAlign(mimalloc.mi_usable_size(ptr), len_align)];
+ fn alloc(_: *anyopaque, len: usize, ptr_align: u8, _: usize) ?[*]u8 {
+ return alignedAlloc(len, ptr_align);
}
- fn resize(
- _: *anyopaque,
- buf: []u8,
- buf_align: u29,
- new_len: usize,
- len_align: u29,
- return_address: usize,
- ) ?usize {
- _ = buf_align;
- _ = return_address;
+ fn resize(_: *anyopaque, buf: []u8, _: u8, new_len: usize, _: usize) bool {
if (new_len <= buf.len) {
- return mem.alignAllocLen(buf.len, new_len, len_align);
+ return true;
}
const full_len = alignedAllocSize(buf.ptr);
if (new_len <= full_len) {
- return mem.alignAllocLen(full_len, new_len, len_align);
+ return true;
}
- return null;
+ return false;
}
fn free(
_: *anyopaque,
buf: []u8,
- buf_align: u29,
- return_address: usize,
+ buf_align: u8,
+ _: usize,
) void {
- _ = buf_align;
- _ = return_address;
- mimalloc.mi_free(buf.ptr);
+ // mi_free_size internally just asserts the size
+ // so it's faster if we don't pass that value through
+ // but its good to have that assertion
+ if (comptime Environment.allow_assert) {
+ assert(mimalloc.mi_is_in_heap_region(buf.ptr));
+ mimalloc.mi_free_size_aligned(buf.ptr, buf.len, buf_align);
+ } else {
+ mimalloc.mi_free(buf.ptr);
+ }
}
};
@@ -211,9 +174,9 @@ pub const z_allocator = Allocator{
.vtable = &z_allocator_vtable,
};
const z_allocator_vtable = Allocator.VTable{
- .alloc = ZAllocator.alloc,
- .resize = ZAllocator.resize,
- .free = ZAllocator.free,
+ .alloc = &ZAllocator.alloc,
+ .resize = &ZAllocator.resize,
+ .free = &ZAllocator.free,
};
const HugeAllocator = struct {
fn alloc(
@@ -282,21 +245,20 @@ const AutoSizeAllocator = struct {
len_align: u29,
return_address: usize,
) error{OutOfMemory}![]u8 {
+ _ = len_align;
if (len >= huge_threshold) {
return huge_allocator.rawAlloc(
len,
alignment,
- len_align,
return_address,
- );
+ ) orelse return error.OutOfMemory;
}
return c_allocator.rawAlloc(
len,
alignment,
- len_align,
return_address,
- );
+ ) orelse return error.OutOfMemory;
}
fn resize(
diff --git a/src/meta.zig b/src/meta.zig
index c104e378d..cd171cc29 100644
--- a/src/meta.zig
+++ b/src/meta.zig
@@ -7,7 +7,7 @@ pub fn ReturnOf(comptime function: anytype) type {
}
pub fn ReturnOfType(comptime Type: type) type {
- const typeinfo: std.builtin.TypeInfo.Fn = @typeInfo(Type);
+ const typeinfo: std.builtin.Type.Fn = @typeInfo(Type);
return typeinfo.return_type orelse void;
}
diff --git a/src/mimalloc_arena.zig b/src/mimalloc_arena.zig
index 5ce127cb4..2de5ce018 100644
--- a/src/mimalloc_arena.zig
+++ b/src/mimalloc_arena.zig
@@ -23,7 +23,14 @@ pub const GlobalArena = struct {
}
pub fn allocator(this: *GlobalArena) Allocator {
- return std.mem.Allocator.init(this, alloc, resize, free);
+ return .{
+ .ptr = this,
+ .vtable = &.{
+ .alloc = alloc,
+ .resize = resize,
+ .free = free,
+ },
+ };
}
fn alloc(
@@ -34,7 +41,7 @@ pub const GlobalArena = struct {
return_address: usize,
) error{OutOfMemory}![]u8 {
return self.arena.alloc(len, ptr_align, len_align, return_address) catch
- return self.fallback_allocator.rawAlloc(len, ptr_align, len_align, return_address);
+ return self.fallback_allocator.rawAlloc(len, ptr_align, return_address) orelse return error.OutOfMemory;
}
fn resize(
@@ -68,27 +75,6 @@ pub const GlobalArena = struct {
pub const Arena = struct {
heap: ?*mimalloc.Heap = null,
- arena_id: mimalloc.ArenaID = -1,
-
- pub fn initWithCapacity(capacity: usize) error{OutOfMemory}!Arena {
- var arena_id: mimalloc.ArenaID = -1;
-
- std.debug.assert(capacity >= 8 * 1024 * 1024); // mimalloc requires a minimum of 8MB
- // which makes this not very useful for us!
-
- if (!mimalloc.mi_manage_os_memory_ex(null, capacity, true, true, false, -1, true, &arena_id)) {
- if (!mimalloc.mi_manage_os_memory_ex(null, capacity, false, false, false, -1, true, &arena_id)) {
- return error.OutOfMemory;
- }
- }
- std.debug.assert(arena_id != -1);
-
- var heap = mimalloc.mi_heap_new_in_arena(arena_id) orelse return error.OutOfMemory;
- return Arena{
- .heap = heap,
- .arena_id = arena_id,
- };
- }
/// Internally, mimalloc calls mi_heap_get_default()
/// to get the default heap.
@@ -152,86 +138,66 @@ pub const Arena = struct {
pub fn ownsPtr(this: Arena, ptr: *const anyopaque) bool {
return mimalloc.mi_heap_check_owned(this.heap.?, ptr);
}
-
- // Copied from rust
- const MI_MAX_ALIGN_SIZE = 16;
- inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool {
- return (alignment == @sizeOf(*anyopaque) or
- (alignment == MI_MAX_ALIGN_SIZE and size >= (MI_MAX_ALIGN_SIZE / 2)));
- }
+ pub const supports_posix_memalign = true;
fn alignedAlloc(heap: *mimalloc.Heap, len: usize, alignment: usize) ?[*]u8 {
if (comptime FeatureFlags.log_allocations) std.debug.print("Malloc: {d}\n", .{len});
- var ptr = if (mi_malloc_satisfies_alignment(alignment, len))
- mimalloc.mi_heap_malloc(heap, len)
+ var ptr: ?*anyopaque = if (mimalloc.canUseAlignedAlloc(len, alignment))
+ mimalloc.mi_heap_malloc_aligned(heap, len, alignment)
else
- mimalloc.mi_heap_malloc_aligned(heap, len, alignment);
-
- return @ptrCast([*]u8, ptr orelse return null);
- }
-
- pub fn alloc(
- arena: *anyopaque,
- len: usize,
- alignment: u29,
- len_align: u29,
- return_address: usize,
- ) error{OutOfMemory}![]u8 {
- _ = return_address;
- assert(len > 0);
- assert(std.math.isPowerOfTwo(alignment));
+ mimalloc.mi_heap_malloc(heap, len);
- var ptr = alignedAlloc(@ptrCast(*mimalloc.Heap, arena), len, alignment) orelse return error.OutOfMemory;
- if (len_align == 0) {
- return ptr[0..len];
+ if (comptime Environment.allow_assert) {
+ const usable = mimalloc.mi_malloc_usable_size(ptr);
+ if (usable < len) {
+ std.debug.panic("mimalloc: allocated size is too small: {d} < {d}", .{ usable, len });
+ }
}
- // std.mem.Allocator asserts this, we do it here so we can see the metadata
- if (comptime Environment.allow_assert) {
- const size = mem.alignBackwardAnyAlign(mimalloc.mi_usable_size(ptr), len_align);
+ return if (ptr) |p|
+ @ptrCast([*]u8, p)
+ else
+ null;
+ }
- assert(size >= len);
- return ptr[0..size];
- } else {
- return ptr[0..mem.alignBackwardAnyAlign(mimalloc.mi_usable_size(ptr), len_align)];
- }
+ fn alignedAllocSize(ptr: [*]u8) usize {
+ return mimalloc.mi_malloc_usable_size(ptr);
}
- pub fn resize(
- _: *anyopaque,
- buf: []u8,
- buf_align: u29,
- new_len: usize,
- len_align: u29,
- return_address: usize,
- ) ?usize {
- _ = buf_align;
- _ = return_address;
+ fn alloc(arena: *anyopaque, len: usize, ptr_align: u8, _: usize) ?[*]u8 {
+ var this = bun.cast(*mimalloc.Heap, arena);
+ return alignedAlloc(this, len, ptr_align);
+ }
+ fn resize(_: *anyopaque, buf: []u8, _: u8, new_len: usize, _: usize) bool {
if (new_len <= buf.len) {
- return mem.alignAllocLen(buf.len, new_len, len_align);
+ return true;
}
- const full_len = mimalloc.mi_usable_size(buf.ptr);
+ const full_len = alignedAllocSize(buf.ptr);
if (new_len <= full_len) {
- return mem.alignAllocLen(full_len, new_len, len_align);
+ return true;
}
- return null;
+ return false;
}
- pub fn free(
+ fn free(
_: *anyopaque,
buf: []u8,
- buf_align: u29,
- return_address: usize,
+ buf_align: u8,
+ _: usize,
) void {
- _ = buf_align;
- _ = return_address;
+ // mi_free_size internally just asserts the size
+ // so it's faster if we don't pass that value through
+ // but its good to have that assertion
if (comptime Environment.allow_assert) {
assert(mimalloc.mi_is_in_heap_region(buf.ptr));
- mimalloc.mi_free_size_aligned(buf.ptr, buf.len, buf_align);
+ if (mimalloc.canUseAlignedAlloc(buf.len, buf_align))
+ mimalloc.mi_free_size_aligned(buf.ptr, buf.len, buf_align)
+ else
+ mimalloc.mi_free_size(buf.ptr, buf.len);
} else {
mimalloc.mi_free(buf.ptr);
}
@@ -239,7 +205,7 @@ pub const Arena = struct {
};
const c_allocator_vtable = Allocator.VTable{
- .alloc = Arena.alloc,
- .resize = Arena.resize,
- .free = Arena.free,
+ .alloc = &Arena.alloc,
+ .resize = &Arena.resize,
+ .free = &Arena.free,
};
diff --git a/src/napi/napi.zig b/src/napi/napi.zig
index e9df5cfb2..5e4afa7b0 100644
--- a/src/napi/napi.zig
+++ b/src/napi/napi.zig
@@ -65,16 +65,16 @@ pub const napi_default_method: c_int = 5;
pub const napi_default_jsproperty: c_int = 7;
pub const napi_property_attributes = c_uint;
pub const napi_valuetype = enum(c_uint) {
- @"undefined" = 0,
- @"null" = 1,
- @"boolean" = 2,
- @"number" = 3,
- @"string" = 4,
- @"symbol" = 5,
- @"object" = 6,
- @"function" = 7,
- @"external" = 8,
- @"bigint" = 9,
+ undefined = 0,
+ null = 1,
+ boolean = 2,
+ number = 3,
+ string = 4,
+ symbol = 5,
+ object = 6,
+ function = 7,
+ external = 8,
+ bigint = 9,
};
pub const napi_typedarray_type = enum(c_uint) {
int8_array = 0,
@@ -150,8 +150,8 @@ pub const napi_status = enum(c_uint) {
detachable_arraybuffer_expected = 20,
would_deadlock = 21,
};
-pub const napi_callback = ?fn (napi_env, napi_callback_info) callconv(.C) napi_value;
-pub const napi_finalize = ?fn (napi_env, ?*anyopaque, ?*anyopaque) callconv(.C) void;
+pub const napi_callback = ?*const fn (napi_env, napi_callback_info) callconv(.C) napi_value;
+pub const napi_finalize = ?*const fn (napi_env, ?*anyopaque, ?*anyopaque) callconv(.C) void;
pub const napi_property_descriptor = extern struct {
utf8name: [*c]const u8,
name: napi_value,
@@ -288,17 +288,17 @@ pub extern fn napi_create_type_error(env: napi_env, code: napi_value, msg: napi_
pub extern fn napi_create_range_error(env: napi_env, code: napi_value, msg: napi_value, result: *napi_value) napi_status;
pub export fn napi_typeof(env: napi_env, value: napi_value, result: *napi_valuetype) napi_status {
if (value.isEmpty()) {
- result.* = .@"undefined";
+ result.* = .undefined;
return .ok;
}
if (value.isUndefined()) {
- result.* = .@"undefined";
+ result.* = .undefined;
return .ok;
}
if (value.isNull()) {
- result.* = .@"null";
+ result.* = .null;
return .ok;
}
@@ -409,7 +409,7 @@ pub export fn napi_get_value_string_latin1(env: napi_env, value: napi_value, buf
result.* = @intCast(@TypeOf(result.*), wrote);
return .ok;
}
- const to_copy = @minimum(zig_str.len, buf_.len);
+ const to_copy = @min(zig_str.len, buf_.len);
@memcpy(buf, zig_str.slice().ptr, to_copy);
buf[to_copy] = 0;
// if zero terminated, report the length of the string without the null
@@ -476,7 +476,7 @@ pub export fn napi_get_value_string_utf8(env: napi_env, value: napi_value, buf_p
return .ok;
}
- const to_copy = @minimum(zig_str.len, buf_.len);
+ const to_copy = @min(zig_str.len, buf_.len);
@memcpy(buf, zig_str.slice().ptr, to_copy);
buf[to_copy] = 0;
if (result_ptr) |result| {
@@ -531,7 +531,7 @@ pub export fn napi_get_value_string_utf16(env: napi_env, value: napi_value, buf_
return .ok;
}
- const to_copy = @minimum(zig_str.len, buf_.len) * 2;
+ const to_copy = @min(zig_str.len, buf_.len) * 2;
@memcpy(std.mem.sliceAsBytes(buf_).ptr, std.mem.sliceAsBytes(zig_str.utf16SliceAligned()).ptr, to_copy);
buf[to_copy] = 0;
// if zero terminated, report the length of the string without the null
@@ -723,7 +723,7 @@ pub export fn napi_is_arraybuffer(_: napi_env, value: napi_value, result: *bool)
pub export fn napi_create_arraybuffer(env: napi_env, byte_length: usize, data: [*]const u8, result: *napi_value) napi_status {
var typed_array = JSC.C.JSObjectMakeTypedArray(env.ref(), .kJSTypedArrayTypeArrayBuffer, byte_length, TODO_EXCEPTION);
var array_buffer = JSValue.c(typed_array).asArrayBuffer(env) orelse return .generic_failure;
- @memcpy(array_buffer.ptr, data, @minimum(array_buffer.len, @truncate(u32, byte_length)));
+ @memcpy(array_buffer.ptr, data, @min(array_buffer.len, @truncate(u32, byte_length)));
result.* = JSValue.c(typed_array);
return .ok;
}
@@ -904,7 +904,7 @@ const WorkPoolTask = @import("../work_pool.zig").Task;
/// must be globally allocated
pub const napi_async_work = struct {
- task: WorkPoolTask = .{ .callback = runFromThreadPool },
+ task: WorkPoolTask = .{ .callback = &runFromThreadPool },
concurrent_task: JSC.ConcurrentTask = .{},
completion_task: ?*anyopaque = null,
event_loop: *JSC.EventLoop,
@@ -998,9 +998,9 @@ pub const napi_threadsafe_function_release_mode = enum(c_uint) {
pub const napi_tsfn_nonblocking = 0;
pub const napi_tsfn_blocking = 1;
pub const napi_threadsafe_function_call_mode = c_uint;
-pub const napi_async_execute_callback = ?fn (napi_env, ?*anyopaque) callconv(.C) void;
-pub const napi_async_complete_callback = ?fn (napi_env, napi_status, ?*anyopaque) callconv(.C) void;
-pub const napi_threadsafe_function_call_js = fn (napi_env, napi_value, ?*anyopaque, ?*anyopaque) callconv(.C) void;
+pub const napi_async_execute_callback = ?*const fn (napi_env, ?*anyopaque) callconv(.C) void;
+pub const napi_async_complete_callback = ?*const fn (napi_env, napi_status, ?*anyopaque) callconv(.C) void;
+pub const napi_threadsafe_function_call_js = ?*const fn (napi_env, napi_value, ?*anyopaque, ?*anyopaque) callconv(.C) void;
pub const napi_node_version = extern struct {
major: u32,
minor: u32,
@@ -1016,9 +1016,9 @@ pub const napi_node_version = extern struct {
};
pub const struct_napi_async_cleanup_hook_handle__ = opaque {};
pub const napi_async_cleanup_hook_handle = ?*struct_napi_async_cleanup_hook_handle__;
-pub const napi_async_cleanup_hook = ?fn (napi_async_cleanup_hook_handle, ?*anyopaque) callconv(.C) void;
+pub const napi_async_cleanup_hook = *const fn (napi_async_cleanup_hook_handle, ?*anyopaque) callconv(.C) void;
-pub const napi_addon_register_func = ?fn (napi_env, napi_value) callconv(.C) napi_value;
+pub const napi_addon_register_func = *const fn (napi_env, napi_value) callconv(.C) napi_value;
pub const struct_napi_module = extern struct {
nm_version: c_int,
nm_flags: c_uint,
@@ -1140,14 +1140,14 @@ pub extern fn napi_fatal_exception(env: napi_env, err: napi_value) napi_status;
// We use a linked list here because we assume removing these is relatively rare
// and array reallocations are relatively expensive.
-pub export fn napi_add_env_cleanup_hook(env: napi_env, fun: ?fn (?*anyopaque) callconv(.C) void, arg: ?*anyopaque) napi_status {
+pub export fn napi_add_env_cleanup_hook(env: napi_env, fun: ?*const fn (?*anyopaque) callconv(.C) void, arg: ?*anyopaque) napi_status {
if (fun == null)
return .ok;
env.bunVM().rareData().pushCleanupHook(env, arg, fun.?);
return .ok;
}
-pub export fn napi_remove_env_cleanup_hook(env: napi_env, fun: ?fn (?*anyopaque) callconv(.C) void, arg: ?*anyopaque) napi_status {
+pub export fn napi_remove_env_cleanup_hook(env: napi_env, fun: ?*const fn (?*anyopaque) callconv(.C) void, arg: ?*anyopaque) napi_status {
if (env.bunVM().rare_data == null or fun == null)
return .ok;
@@ -1360,7 +1360,7 @@ pub export fn napi_create_threadsafe_function(
thread_finalize_data: ?*anyopaque,
thread_finalize_cb: napi_finalize,
context: ?*anyopaque,
- call_js_cb: ?napi_threadsafe_function_call_js,
+ call_js_cb: napi_threadsafe_function_call_js,
result: *napi_threadsafe_function,
) napi_status {
// TODO: don't do this
@@ -1532,97 +1532,97 @@ pub fn fixDeadCodeElimination() void {
std.mem.doNotOptimizeAway(&@import("../bun.js/node/buffer.zig").BufferVectorized.fill);
}
-comptime {
- if (!JSC.is_bindgen) {
- _ = napi_get_undefined;
- _ = napi_get_null;
- _ = napi_get_boolean;
- _ = napi_create_object;
- _ = napi_create_array;
- _ = napi_create_array_with_length;
- _ = napi_create_double;
- _ = napi_create_int32;
- _ = napi_create_uint32;
- _ = napi_create_int64;
- _ = napi_create_string_latin1;
- _ = napi_create_string_utf8;
- _ = napi_create_string_utf16;
- _ = napi_create_symbol;
- _ = napi_create_error;
- _ = napi_typeof;
- _ = napi_get_value_double;
- _ = napi_get_value_int32;
- _ = napi_get_value_uint32;
- _ = napi_get_value_int64;
- _ = napi_get_value_bool;
- _ = napi_get_value_string_latin1;
- _ = napi_get_value_string_utf8;
- _ = napi_get_value_string_utf16;
- _ = napi_coerce_to_bool;
- _ = napi_coerce_to_number;
- _ = napi_coerce_to_object;
- _ = napi_get_prototype;
-
- _ = napi_set_element;
- _ = napi_has_element;
- _ = napi_get_element;
- _ = napi_is_array;
- _ = napi_get_array_length;
- _ = napi_strict_equals;
- _ = napi_call_function;
- _ = napi_new_instance;
- _ = napi_instanceof;
- _ = napi_open_handle_scope;
- _ = napi_close_handle_scope;
- _ = napi_is_error;
- _ = napi_is_arraybuffer;
- _ = napi_create_arraybuffer;
- _ = napi_create_external_arraybuffer;
- _ = napi_get_arraybuffer_info;
- _ = napi_is_typedarray;
- _ = napi_create_typedarray;
- _ = napi_get_typedarray_info;
- _ = napi_is_dataview;
- _ = napi_get_dataview_info;
- _ = napi_get_version;
- _ = napi_create_promise;
- _ = napi_resolve_deferred;
- _ = napi_reject_deferred;
- _ = napi_is_promise;
- _ = napi_run_script;
- _ = napi_create_date;
- _ = napi_is_date;
- _ = napi_get_date_value;
- _ = napi_create_bigint_int64;
- _ = napi_create_bigint_uint64;
- _ = napi_get_value_bigint_int64;
- _ = napi_get_value_bigint_uint64;
- _ = napi_fatal_error;
- _ = napi_create_buffer;
- _ = napi_create_external_buffer;
- _ = napi_create_buffer_copy;
- _ = napi_is_buffer;
- _ = napi_get_buffer_info;
- _ = napi_create_async_work;
- _ = napi_delete_async_work;
- _ = napi_queue_async_work;
- _ = napi_cancel_async_work;
- _ = napi_get_node_version;
- _ = napi_get_uv_event_loop;
- _ = napi_add_env_cleanup_hook;
- _ = napi_remove_env_cleanup_hook;
- _ = napi_create_threadsafe_function;
- _ = napi_get_threadsafe_function_context;
- _ = napi_call_threadsafe_function;
- _ = napi_acquire_threadsafe_function;
- _ = napi_release_threadsafe_function;
- _ = napi_unref_threadsafe_function;
- _ = napi_ref_threadsafe_function;
- _ = napi_add_async_cleanup_hook;
- _ = napi_remove_async_cleanup_hook;
- _ = @import("../bun.js/node/buffer.zig").BufferVectorized.fill;
- _ = napi_add_finalizer;
- _ = napi_create_external;
- _ = napi_get_value_external;
- }
-}
+// comptime {
+// if (!JSC.is_bindgen) {
+// _ = napi_get_undefined;
+// _ = napi_get_null;
+// _ = napi_get_boolean;
+// _ = napi_create_object;
+// _ = napi_create_array;
+// _ = napi_create_array_with_length;
+// _ = napi_create_double;
+// _ = napi_create_int32;
+// _ = napi_create_uint32;
+// _ = napi_create_int64;
+// _ = napi_create_string_latin1;
+// _ = napi_create_string_utf8;
+// _ = napi_create_string_utf16;
+// _ = napi_create_symbol;
+// _ = napi_create_error;
+// _ = napi_typeof;
+// _ = napi_get_value_double;
+// _ = napi_get_value_int32;
+// _ = napi_get_value_uint32;
+// _ = napi_get_value_int64;
+// _ = napi_get_value_bool;
+// _ = napi_get_value_string_latin1;
+// _ = napi_get_value_string_utf8;
+// _ = napi_get_value_string_utf16;
+// _ = napi_coerce_to_bool;
+// _ = napi_coerce_to_number;
+// _ = napi_coerce_to_object;
+// _ = napi_get_prototype;
+
+// _ = napi_set_element;
+// _ = napi_has_element;
+// _ = napi_get_element;
+// _ = napi_is_array;
+// _ = napi_get_array_length;
+// _ = napi_strict_equals;
+// _ = napi_call_function;
+// _ = napi_new_instance;
+// _ = napi_instanceof;
+// _ = napi_open_handle_scope;
+// _ = napi_close_handle_scope;
+// _ = napi_is_error;
+// _ = napi_is_arraybuffer;
+// _ = napi_create_arraybuffer;
+// _ = napi_create_external_arraybuffer;
+// _ = napi_get_arraybuffer_info;
+// _ = napi_is_typedarray;
+// _ = napi_create_typedarray;
+// _ = napi_get_typedarray_info;
+// _ = napi_is_dataview;
+// _ = napi_get_dataview_info;
+// _ = napi_get_version;
+// _ = napi_create_promise;
+// _ = napi_resolve_deferred;
+// _ = napi_reject_deferred;
+// _ = napi_is_promise;
+// _ = napi_run_script;
+// _ = napi_create_date;
+// _ = napi_is_date;
+// _ = napi_get_date_value;
+// _ = napi_create_bigint_int64;
+// _ = napi_create_bigint_uint64;
+// _ = napi_get_value_bigint_int64;
+// _ = napi_get_value_bigint_uint64;
+// _ = napi_fatal_error;
+// _ = napi_create_buffer;
+// _ = napi_create_external_buffer;
+// _ = napi_create_buffer_copy;
+// _ = napi_is_buffer;
+// _ = napi_get_buffer_info;
+// _ = napi_create_async_work;
+// _ = napi_delete_async_work;
+// _ = napi_queue_async_work;
+// _ = napi_cancel_async_work;
+// _ = napi_get_node_version;
+// _ = napi_get_uv_event_loop;
+// _ = napi_add_env_cleanup_hook;
+// _ = napi_remove_env_cleanup_hook;
+// _ = napi_create_threadsafe_function;
+// _ = napi_get_threadsafe_function_context;
+// _ = napi_call_threadsafe_function;
+// _ = napi_acquire_threadsafe_function;
+// _ = napi_release_threadsafe_function;
+// _ = napi_unref_threadsafe_function;
+// _ = napi_ref_threadsafe_function;
+// _ = napi_add_async_cleanup_hook;
+// _ = napi_remove_async_cleanup_hook;
+// _ = @import("../bun.js/node/buffer.zig").BufferVectorized.fill;
+// _ = napi_add_finalizer;
+// _ = napi_create_external;
+// _ = napi_get_value_external;
+// }
+// }
diff --git a/src/network_thread.zig b/src/network_thread.zig
index 5590dafa8..74e478e61 100644
--- a/src/network_thread.zig
+++ b/src/network_thread.zig
@@ -203,7 +203,7 @@ pub const AddressListCache = std.HashMap(u64, CachedAddressList, IdentityContext
pub var address_list_cached: AddressListCache = undefined;
pub fn getAddressList(allocator: std.mem.Allocator, name: []const u8, port: u16) !*std.net.AddressList {
// const hash = CachedAddressList.hash(name, port);
- // const now = @intCast(u64, @maximum(0, std.time.milliTimestamp()));
+ // const now = @intCast(u64, @max(0, std.time.milliTimestamp()));
// if (address_list_cached.getPtr(hash)) |cached| {
// if (cached.expire_after > now) {
// return cached;
diff --git a/src/node_fallbacks.zig b/src/node_fallbacks.zig
index e8e879fd4..b3753de68 100644
--- a/src/node_fallbacks.zig
+++ b/src/node_fallbacks.zig
@@ -319,117 +319,117 @@ pub const FallbackModule = struct {
code: string,
package_json: *const PackageJSON,
- pub const @"assert" = FallbackModule{
+ pub const assert = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(assert_import_path, "node", "assert"),
.code = assert_code,
.package_json = &assert_package_json,
};
- pub const @"buffer" = FallbackModule{
+ pub const buffer = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(buffer_import_path, "node", "buffer"),
.code = buffer_code,
.package_json = &buffer_package_json,
};
- pub const @"console" = FallbackModule{
+ pub const console = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(console_import_path, "node", "console"),
.code = console_code,
.package_json = &console_package_json,
};
- pub const @"constants" = FallbackModule{
+ pub const constants = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(constants_import_path, "node", "constants"),
.code = constants_code,
.package_json = &constants_package_json,
};
- pub const @"crypto" = FallbackModule{
+ pub const crypto = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(crypto_import_path, "node", "crypto"),
.code = crypto_code,
.package_json = &crypto_package_json,
};
- pub const @"domain" = FallbackModule{
+ pub const domain = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(domain_import_path, "node", "domain"),
.code = domain_code,
.package_json = &domain_package_json,
};
- pub const @"events" = FallbackModule{
+ pub const events = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(events_import_path, "node", "events"),
.code = events_code,
.package_json = &events_package_json,
};
- pub const @"http" = FallbackModule{
+ pub const http = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(http_import_path, "node", "http"),
.code = http_code,
.package_json = &http_package_json,
};
- pub const @"https" = FallbackModule{
+ pub const https = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(https_import_path, "node", "https"),
.code = https_code,
.package_json = &https_package_json,
};
- pub const @"net" = FallbackModule{
+ pub const net = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(net_import_path, "node", "net"),
.code = net_code,
.package_json = &net_package_json,
};
- pub const @"os" = FallbackModule{
+ pub const os = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(os_import_path, "node", "os"),
.code = os_code,
.package_json = &os_package_json,
};
- pub const @"path" = FallbackModule{
+ pub const path = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(path_import_path, "node", "path"),
.code = path_code,
.package_json = &path_package_json,
};
- pub const @"process" = FallbackModule{
+ pub const process = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(process_import_path, "node", "process"),
.code = process_code,
.package_json = &process_package_json,
};
- pub const @"punycode" = FallbackModule{
+ pub const punycode = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(punycode_import_path, "node", "punycode"),
.code = punycode_code,
.package_json = &punycode_package_json,
};
- pub const @"querystring" = FallbackModule{
+ pub const querystring = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(querystring_import_path, "node", "querystring"),
.code = querystring_code,
.package_json = &querystring_package_json,
};
- pub const @"stream" = FallbackModule{
+ pub const stream = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(stream_import_path, "node", "stream"),
.code = stream_code,
.package_json = &stream_package_json,
};
- pub const @"string_decoder" = FallbackModule{
+ pub const string_decoder = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(string_decoder_import_path, "node", "string_decoder"),
.code = string_decoder_code,
.package_json = &string_decoder_package_json,
};
- pub const @"sys" = FallbackModule{
+ pub const sys = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(sys_import_path, "node", "sys"),
.code = sys_code,
.package_json = &sys_package_json,
};
- pub const @"timers" = FallbackModule{
+ pub const timers = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(timers_import_path, "node", "timers"),
.code = timers_code,
.package_json = &timers_package_json,
};
- pub const @"tty" = FallbackModule{
+ pub const tty = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(tty_import_path, "node", "tty"),
.code = tty_code,
.package_json = &tty_package_json,
};
- pub const @"url" = FallbackModule{
+ pub const url = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(url_import_path, "node", "url"),
.code = url_code,
.package_json = &url_package_json,
};
- pub const @"util" = FallbackModule{
+ pub const util = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(util_import_path, "node", "util"),
.code = util_code,
.package_json = &util_package_json,
};
- pub const @"zlib" = FallbackModule{
+ pub const zlib = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(zlib_import_path, "node", "zlib"),
.code = zlib_code,
.package_json = &zlib_package_json,
diff --git a/src/node_module_bundle.zig b/src/node_module_bundle.zig
index ccf7877e7..5a052da18 100644
--- a/src/node_module_bundle.zig
+++ b/src/node_module_bundle.zig
@@ -172,11 +172,12 @@ pub const NodeModuleBundle = struct {
to: *const Api.JavascriptBundledModule,
allocator: std.mem.Allocator,
) !string {
+ const fmt = bun.fmt.hexIntLower(this.bundle.packages[to.package_id].hash);
return try std.fmt.allocPrint(
allocator,
- "{x}/{s}",
+ "{any}/{s}",
.{
- this.bundle.packages[to.package_id].hash,
+ fmt,
this.str(to.path),
123,
},
diff --git a/src/options.zig b/src/options.zig
index cc0f5d9e4..024ff188a 100644
--- a/src/options.zig
+++ b/src/options.zig
@@ -79,9 +79,9 @@ pub fn stringHashMapFromArrays(comptime t: type, allocator: std.mem.Allocator, k
}
pub const ExternalModules = struct {
- node_modules: std.BufSet,
- abs_paths: std.BufSet,
- patterns: []const WildcardPattern,
+ node_modules: std.BufSet = undefined,
+ abs_paths: std.BufSet = undefined,
+ patterns: []const WildcardPattern = undefined,
pub const WildcardPattern = struct {
prefix: string,
suffix: string,
@@ -169,7 +169,7 @@ pub const ExternalModules = struct {
}
}
- result.patterns = patterns.toOwnedSlice();
+ result.patterns = patterns.toOwnedSlice() catch @panic("TODO");
return result;
}
@@ -1160,7 +1160,7 @@ pub const SourceMapOption = enum {
pub fn toAPI(source_map: ?SourceMapOption) Api.SourceMapMode {
return switch (source_map orelse .none) {
.external => .external,
- .@"inline" => .@"inline_into_file",
+ .@"inline" => .inline_into_file,
else => ._none,
};
}
@@ -1168,7 +1168,7 @@ pub const SourceMapOption = enum {
pub const map = ComptimeStringMap(SourceMapOption, .{
.{ "none", .none },
.{ "inline", .@"inline" },
- .{ "external", .@"external" },
+ .{ "external", .external },
});
};
@@ -1416,7 +1416,7 @@ pub const BundleOptions = struct {
opts.node_modules_bundle = node_mods;
const pretty_path = fs.relativeTo(transform.node_modules_bundle_path.?);
opts.node_modules_bundle_url = try std.fmt.allocPrint(allocator, "{s}{s}", .{
- opts.origin,
+ opts.origin.href,
pretty_path,
});
} else if (transform.node_modules_bundle_path) |bundle_path| {
@@ -1547,7 +1547,7 @@ pub const BundleOptions = struct {
if (!disabled_static) {
var _dirs = [_]string{chosen_dir};
opts.routes.static_dir = try fs.absAlloc(allocator, &_dirs);
- opts.routes.static_dir_handle = std.fs.openDirAbsolute(opts.routes.static_dir, .{ .iterate = true }) catch |err| brk: {
+ const static_dir = std.fs.openIterableDirAbsolute(opts.routes.static_dir, .{}) catch |err| brk: {
switch (err) {
error.FileNotFound => {
opts.routes.static_dir_enabled = false;
@@ -1570,6 +1570,9 @@ pub const BundleOptions = struct {
break :brk null;
};
+ if (static_dir) |handle| {
+ opts.routes.static_dir_handle = handle.dir;
+ }
opts.routes.static_dir_enabled = opts.routes.static_dir_handle != null;
}
@@ -1669,13 +1672,13 @@ pub const BundleOptions = struct {
};
pub fn openOutputDir(output_dir: string) !std.fs.Dir {
- return std.fs.cwd().openDir(output_dir, std.fs.Dir.OpenDirOptions{ .iterate = true }) catch brk: {
+ return std.fs.cwd().openDir(output_dir, .{}) catch brk: {
std.fs.cwd().makeDir(output_dir) catch |err| {
Output.printErrorln("error: Unable to mkdir \"{s}\": \"{s}\"", .{ output_dir, @errorName(err) });
Global.crash();
};
- var handle = std.fs.cwd().openDir(output_dir, std.fs.Dir.OpenDirOptions{ .iterate = true }) catch |err2| {
+ var handle = std.fs.cwd().openDir(output_dir, .{}) catch |err2| {
Output.printErrorln("error: Unable to open \"{s}\": \"{s}\"", .{ output_dir, @errorName(err2) });
Global.crash();
};
@@ -1875,8 +1878,8 @@ pub const TransformResult = struct {
return TransformResult{
.outbase = outbase,
.output_files = output_files,
- .errors = errors.toOwnedSlice(),
- .warnings = warnings.toOwnedSlice(),
+ .errors = try errors.toOwnedSlice(),
+ .warnings = try warnings.toOwnedSlice(),
};
}
};
@@ -2080,7 +2083,7 @@ pub const Framework = struct {
from_bundle: bool = false,
resolved_dir: string = "",
- override_modules: Api.StringMap = Api.StringMap{},
+ override_modules: Api.StringMap,
override_modules_hashes: []u64 = &[_]u64{},
client_css_in_js: Api.CssInJsBehavior = .auto_onimportcss,
@@ -2199,7 +2202,7 @@ pub const RouteConfig = struct {
// I think it's fine to hardcode as .json for now, but if I personally were writing a framework
// I would consider using a custom binary format to minimize request size
// maybe like CBOR
- extensions: []const string = &[_][]const string{},
+ extensions: []const string = &[_]string{},
routes_enabled: bool = false,
static_dir: string = "",
diff --git a/src/output.zig b/src/output.zig
index a5b25acca..da723e225 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -243,7 +243,7 @@ pub fn flush() void {
}
inline fn printElapsedToWithCtx(elapsed: f64, comptime printerFn: anytype, comptime has_ctx: bool, ctx: anytype) void {
- switch (elapsed) {
+ switch (@floatToInt(i64, @round(elapsed))) {
0...1500 => {
const fmt = "<r><d>[<b>{d:>.2}ms<r><d>]<r>";
const args = .{elapsed};
@@ -279,12 +279,12 @@ pub fn printElapsedStdout(elapsed: f64) void {
}
pub fn printStartEnd(start: i128, end: i128) void {
- const elapsed = @divTrunc(end - start, @as(i128, std.time.ns_per_ms));
+ const elapsed = @divTrunc(@truncate(i64, end - start), @as(i64, std.time.ns_per_ms));
printElapsed(@intToFloat(f64, elapsed));
}
pub fn printStartEndStdout(start: i128, end: i128) void {
- const elapsed = @divTrunc(end - start, @as(i128, std.time.ns_per_ms));
+ const elapsed = @divTrunc(@truncate(i64, end - start), @as(i64, std.time.ns_per_ms));
printElapsedStdout(@intToFloat(f64, elapsed));
}
@@ -350,11 +350,11 @@ pub fn print(comptime fmt: string, args: anytype) void {
/// BUN_DEBUG_foo=1
/// To enable all logs, set the environment variable
/// BUN_DEBUG_ALL=1
-const _log_fn = fn (comptime fmt: string, args: anytype) callconv(.Inline) void;
+const _log_fn = fn (comptime fmt: string, args: anytype) void;
pub fn scoped(comptime tag: @Type(.EnumLiteral), comptime disabled: bool) _log_fn {
if (comptime !Environment.isDebug) {
return struct {
- pub inline fn log(comptime _: string, _: anytype) void {}
+ pub fn log(comptime _: string, _: anytype) void {}
}.log;
}
@@ -373,7 +373,7 @@ pub fn scoped(comptime tag: @Type(.EnumLiteral), comptime disabled: bool) _log_f
/// BUN_DEBUG_foo=1
/// To enable all logs, set the environment variable
/// BUN_DEBUG_ALL=1
- pub inline fn log(comptime fmt: string, args: anytype) void {
+ pub fn log(comptime fmt: string, args: anytype) void {
if (!evaluated_disable) {
evaluated_disable = true;
if (bun.getenvZ("BUN_DEBUG_ALL") != null or
@@ -643,7 +643,7 @@ pub const DebugTimer = struct {
var _opts = opts;
_opts.precision = 3;
std.fmt.formatFloatDecimal(
- @floatCast(f64, @intToFloat(f128, timer.read()) / std.time.ns_per_ms),
+ @floatCast(f64, @intToFloat(f64, timer.read()) / std.time.ns_per_ms),
_opts,
writer_,
) catch unreachable;
diff --git a/src/panic_handler.zig b/src/panic_handler.zig
index 1c3a76e53..ff17ed7d1 100644
--- a/src/panic_handler.zig
+++ b/src/panic_handler.zig
@@ -14,7 +14,7 @@ const Features = @import("./analytics/analytics_thread.zig").Features;
const HTTP = @import("bun").HTTP.AsyncHTTP;
const Report = @import("./report.zig");
-pub fn NewPanicHandler(comptime panic_func: fn handle_panic(msg: []const u8, error_return_type: ?*std.builtin.StackTrace) noreturn) type {
+pub fn NewPanicHandler(comptime panic_func: fn ([]const u8, ?*std.builtin.StackTrace, ?usize) noreturn) type {
return struct {
panic_count: usize = 0,
skip_next_panic: bool = false,
@@ -28,7 +28,7 @@ pub fn NewPanicHandler(comptime panic_func: fn handle_panic(msg: []const u8, err
.log = log,
};
}
- pub inline fn handle_panic(msg: []const u8, error_return_type: ?*std.builtin.StackTrace) noreturn {
+ pub inline fn handle_panic(msg: []const u8, error_return_type: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
// This exists to ensure we flush all buffered output before panicking.
Output.flush();
@@ -37,7 +37,7 @@ pub fn NewPanicHandler(comptime panic_func: fn handle_panic(msg: []const u8, err
Output.disableBuffering();
// // We want to always inline the panic handler so it doesn't show up in the stacktrace.
- @call(.{ .modifier = .always_inline }, panic_func, .{ msg, error_return_type });
+ @call(.always_inline, panic_func, .{ msg, error_return_type, addr });
}
};
}
diff --git a/src/ref_count.zig b/src/ref_count.zig
index 589176c1d..2cc5c09fd 100644
--- a/src/ref_count.zig
+++ b/src/ref_count.zig
@@ -1,6 +1,6 @@
const std = @import("std");
-pub fn RefCount(comptime Type: type, comptime deinit_on_zero: bool) type {
+pub fn RefCount(comptime TypeName: type, comptime deinit_on_zero: bool) type {
return struct {
const AllocatorType = if (deinit_on_zero) std.mem.Allocator else void;
@@ -75,6 +75,6 @@ pub fn RefCount(comptime Type: type, comptime deinit_on_zero: bool) type {
}
}
- pub const Type = Type;
+ pub const Type = TypeName;
};
}
diff --git a/src/report.zig b/src/report.zig
index 83afc9447..c8c1304b6 100644
--- a/src/report.zig
+++ b/src/report.zig
@@ -28,7 +28,8 @@ pub const CrashReportWriter = struct {
pub fn printFrame(_: ?*anyopaque, frame: CrashReporter.StackFrame) void {
const function_name = if (frame.function_name.len > 0) frame.function_name else "[function ?]";
const filename = if (frame.filename.len > 0) frame.function_name else "[file ?]";
- crash_report_writer.print("[0x{X}] - <b>{s}<r> {s}:{d}\n", .{ frame.pc, function_name, filename, frame.line_number });
+ const fmt = bun.fmt.hexIntUpper(frame.pc);
+ crash_report_writer.print("[0x{any}] - <b>{s}<r> {s}:{d}\n", .{ fmt, function_name, filename, frame.line_number });
}
pub fn dump() void {
@@ -68,7 +69,7 @@ pub const CrashReportWriter = struct {
const file_path = std.fmt.bufPrintZ(
&crash_reporter_path,
"{s}/.bun-crash/v{s}-{d}.crash",
- .{ base_dir, Global.package_json_version, @intCast(u64, @maximum(std.time.milliTimestamp(), 0)) },
+ .{ base_dir, Global.package_json_version, @intCast(u64, @max(std.time.milliTimestamp(), 0)) },
) catch return;
std.fs.cwd().makeDir(std.fs.path.dirname(std.mem.span(file_path)).?) catch {};
@@ -191,7 +192,7 @@ pub fn fatal(err_: ?anyerror, msg_: ?string) void {
if (msg_) |msg| {
const msg_ptr = @ptrToInt(msg.ptr);
if (msg_ptr > 0) {
- const len = @maximum(@minimum(msg.len, 1024), 0);
+ const len = @max(@min(msg.len, 1024), 0);
if (len > 0) {
if (Output.isEmojiEnabled()) {
@@ -270,7 +271,7 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
crash_report_writer.print(
"\n<r><red>{s}<d> at 0x{any}\n\n",
- .{ @errorName(name), std.fmt.fmtSliceHexUpper(std.mem.asBytes(&addr)) },
+ .{ @errorName(name), bun.fmt.hexIntUpper(addr) },
);
printMetadata();
if (comptime !@import("bun").JSC.is_bindgen) {
@@ -295,7 +296,7 @@ pub noinline fn handleCrash(signal: i32, addr: usize) void {
}
}
- std.c._exit(128 + @truncate(u8, @intCast(u8, @maximum(signal, 0))));
+ std.c._exit(128 + @truncate(u8, @intCast(u8, @max(signal, 0))));
}
pub noinline fn globalError(err: anyerror) noreturn {
@@ -530,7 +531,7 @@ pub noinline fn globalError(err: anyerror) noreturn {
var debug_info = std.debug.getSelfDebugInfo() catch break :print_stacktrace;
var trace = @errorReturnTrace() orelse break :print_stacktrace;
Output.disableBuffering();
- std.debug.writeStackTrace(trace.*, Output.errorWriter(), default_allocator, debug_info, std.debug.detectTTYConfig()) catch break :print_stacktrace;
+ std.debug.writeStackTrace(trace.*, Output.errorWriter(), default_allocator, debug_info, std.debug.detectTTYConfig(std.io.getStdErr())) catch break :print_stacktrace;
}
Global.exit(1);
@@ -554,7 +555,7 @@ pub noinline fn globalError(err: anyerror) noreturn {
var debug_info = std.debug.getSelfDebugInfo() catch break :print_stacktrace;
var trace = @errorReturnTrace() orelse break :print_stacktrace;
Output.disableBuffering();
- std.debug.writeStackTrace(trace.*, Output.errorWriter(), default_allocator, debug_info, std.debug.detectTTYConfig()) catch break :print_stacktrace;
+ std.debug.writeStackTrace(trace.*, Output.errorWriter(), default_allocator, debug_info, std.debug.detectTTYConfig(std.io.getStdErr())) catch break :print_stacktrace;
}
Global.exit(1);
diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig
index fcb158579..b71616ea1 100644
--- a/src/resolver/package_json.zig
+++ b/src/resolver/package_json.zig
@@ -419,7 +419,8 @@ pub const PackageJSON = struct {
}
if (router.expr.asProperty("extensions")) |extensions_expr| {
- if (extensions_expr.expr.asArray()) |*array| {
+ if (extensions_expr.expr.asArray()) |array_const| {
+ var array = array_const;
var valid_count: usize = 0;
while (array.next()) |expr| {
@@ -774,7 +775,8 @@ pub const PackageJSON = struct {
}
if (json.get("cpu")) |os_field| {
var first = true;
- if (os_field.asArray()) |*array| {
+ if (os_field.asArray()) |array_const| {
+ var array = array_const;
while (array.next()) |item| {
if (item.asString(bun.default_allocator)) |str| {
if (first) {
@@ -789,7 +791,8 @@ pub const PackageJSON = struct {
if (json.get("os")) |os_field| {
var first = true;
- if (os_field.asArray()) |*array| {
+ var tmp = os_field.asArray();
+ if (tmp) |*array| {
while (array.next()) |item| {
if (item.asString(bun.default_allocator)) |str| {
if (first) {
@@ -964,7 +967,7 @@ pub const ExportsMap = struct {
const root = visitor.visit(json);
- if (root.data == .@"null") {
+ if (root.data == .null) {
return null;
}
@@ -985,7 +988,7 @@ pub const ExportsMap = struct {
switch (expr.data) {
.e_null => {
- return Entry{ .first_token = js_lexer.rangeOfIdentifier(this.source, expr.loc), .data = .{ .@"null" = void{} } };
+ return Entry{ .first_token = js_lexer.rangeOfIdentifier(this.source, expr.loc), .data = .{ .null = void{} } };
},
.e_string => |str| {
return Entry{
@@ -1111,14 +1114,14 @@ pub const ExportsMap = struct {
pub const Data = union(Tag) {
invalid: void,
- @"null": void,
+ null: void,
boolean: bool,
- @"string": string,
+ string: string,
array: []const Entry,
map: Map,
pub const Tag = enum {
- @"null",
+ null,
string,
boolean,
array,
@@ -1332,7 +1335,7 @@ pub const ESModule = struct {
}
package.name = specifier[0 .. at + offset];
- parseSubpath(&package.subpath, specifier[@minimum(package.name.len + package.version.len + 1, specifier.len)..], subpath_buf);
+ parseSubpath(&package.subpath, specifier[@min(package.name.len + package.version.len + 1, specifier.len)..], subpath_buf);
} else {
parseSubpath(&package.subpath, specifier[package.name.len..], subpath_buf);
}
@@ -1451,7 +1454,7 @@ pub const ESModule = struct {
}
if (strings.eqlComptime(subpath, ".")) {
- var main_export = ExportsMap.Entry{ .data = .{ .@"null" = void{} }, .first_token = logger.Range.None };
+ var main_export = ExportsMap.Entry{ .data = .{ .null = void{} }, .first_token = logger.Range.None };
if (switch (exports.data) {
.string,
.array,
@@ -1466,7 +1469,7 @@ pub const ESModule = struct {
}
}
- if (main_export.data != .@"null") {
+ if (main_export.data != .null) {
const result = r.resolveTarget(package_url, main_export, "", false, false);
if (result.status != .Null and result.status != .Undefined) {
return result;
@@ -1804,7 +1807,7 @@ pub const ESModule = struct {
return Resolution{ .path = "", .status = last_exception, .debug = last_debug };
},
- .@"null" => {
+ .null => {
if (r.debug_logs) |log| {
log.addNoteFmt("The path \"{s}\" is null", .{subpath});
}
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig
index a6ccfb0c7..605c16e6a 100644
--- a/src/resolver/resolve_path.zig
+++ b/src/resolver/resolve_path.zig
@@ -40,7 +40,7 @@ inline fn @"is ../"(slice: []const u8) bool {
pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u8, comptime isPathSeparator: IsSeparatorFunc) []const u8 {
var min_length: usize = std.math.maxInt(usize);
for (input) |str| {
- min_length = @minimum(str.len, min_length);
+ min_length = @min(str.len, min_length);
}
var index: usize = 0;
@@ -59,7 +59,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (input[0][index] != input[1][index]) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -69,7 +69,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(3, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -79,7 +79,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(4, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -89,7 +89,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(5, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -99,7 +99,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(6, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -109,7 +109,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(7, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -119,7 +119,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
if (nqlAtIndex(8, index, input)) {
break;
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -132,7 +132,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
break;
}
}
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{input[0][index]})) {
+ if (@call(.always_inline, isPathSeparator, .{input[0][index]})) {
last_common_separator = index;
}
}
@@ -154,7 +154,7 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u
// and say, "do one of you have a path separator after what we thought was the end?"
for (input) |str| {
if (str.len > index + 1) {
- if (@call(.{ .modifier = .always_inline }, isPathSeparator, .{str[index]})) {
+ if (@call(.always_inline, isPathSeparator, .{str[index]})) {
return str[0 .. index + 2];
}
}
@@ -192,7 +192,7 @@ pub fn relativeToCommonPath(
const common_path = if (has_leading_separator) _common_path[1..] else _common_path;
- const shortest = @minimum(normalized_from.len, normalized_to.len);
+ const shortest = @min(normalized_from.len, normalized_to.len);
var last_common_separator = strings.lastIndexOfChar(_common_path, separator) orelse 0;
@@ -804,7 +804,7 @@ pub fn isSepWin32(char: u8) bool {
}
pub fn isSepAny(char: u8) bool {
- return @call(.{ .modifier = .always_inline }, isSepPosix, .{char}) or @call(.{ .modifier = .always_inline }, isSepWin32, .{char});
+ return @call(.always_inline, isSepPosix, .{char}) or @call(.always_inline, isSepWin32, .{char});
}
pub fn lastIndexOfSeparatorWindows(slice: []const u8) ?usize {
@@ -1256,7 +1256,3 @@ test "longestCommonPath" {
_ = t.expect("/app/", longestCommonPath(&more), @src());
_ = t.expect("/app/public/", longestCommonPath(more[0..2]), @src());
}
-
-test "" {
- @import("std").testing.refAllDecls(@This());
-}
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index 7f3e5b135..773fe3805 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -214,7 +214,7 @@ pub const Result = struct {
try log.addMsg(Msg{
.kind = .err,
.data = logger.rangeData(_source, r, std.fmt.allocPrint(m.notes.allocator, fmt, args)),
- .notes = m.toOwnedSlice(),
+ .notes = try m.toOwnedSlice(),
});
}
};
@@ -240,7 +240,7 @@ pub const DirEntryResolveQueueItem = struct {
};
threadlocal var _dir_entry_paths_to_resolve: [256]DirEntryResolveQueueItem = undefined;
-threadlocal var _open_dirs: [256]std.fs.Dir = undefined;
+threadlocal var _open_dirs: [256]std.fs.IterableDir = undefined;
threadlocal var resolve_without_remapping_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
threadlocal var index_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
threadlocal var dir_info_uncached_filename_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
@@ -396,7 +396,7 @@ const Timer = @import("../system_timer.zig").Timer;
pub const AnyResolveWatcher = struct {
context: *anyopaque,
- callback: fn (*anyopaque, dir_path: string, dir_fd: StoredFileDescriptorType) void = undefined,
+ callback: *const (fn (*anyopaque, dir_path: string, dir_fd: StoredFileDescriptorType) void) = undefined,
pub fn watch(this: @This(), dir_path: string, fd: StoredFileDescriptorType) void {
return this.callback(this.context, dir_path, fd);
@@ -549,9 +549,9 @@ pub const Resolver = struct {
pub fn flushDebugLogs(r: *ThisResolver, flush_mode: DebugLogs.FlushMode) !void {
if (r.debug_logs) |*debug| {
if (flush_mode == DebugLogs.FlushMode.fail) {
- try r.log.addRangeDebugWithNotes(null, logger.Range{ .loc = logger.Loc{} }, debug.what, debug.notes.toOwnedSlice());
+ try r.log.addRangeDebugWithNotes(null, logger.Range{ .loc = logger.Loc{} }, debug.what, try debug.notes.toOwnedSlice());
} else if (@enumToInt(r.log.level) <= @enumToInt(logger.Log.Level.verbose)) {
- try r.log.addVerboseWithNotes(null, logger.Loc.Empty, debug.what, debug.notes.toOwnedSlice());
+ try r.log.addVerboseWithNotes(null, logger.Loc.Empty, debug.what, try debug.notes.toOwnedSlice());
}
}
}
@@ -803,7 +803,8 @@ pub const Resolver = struct {
// defer r.mutex.unlock();
errdefer (r.flushDebugLogs(.fail) catch {});
- switch (r.resolveWithoutSymlinks(source_dir, import_path, kind, global_cache)) {
+ var tmp = r.resolveWithoutSymlinks(source_dir, import_path, kind, global_cache);
+ switch (tmp) {
.success => |*result| {
if (!strings.eqlComptime(result.path_pair.primary.namespace, "node"))
r.finalizeResult(result, kind) catch |err| return .{ .failure = err };
@@ -1277,7 +1278,7 @@ pub const Resolver = struct {
r: *ThisResolver,
result: *const Result,
) ?*const PackageJSON {
- return @call(.{ .modifier = .always_inline }, packageJSONForResolvedNodeModuleWithIgnoreMissingName, .{ r, result, true });
+ return @call(.always_inline, packageJSONForResolvedNodeModuleWithIgnoreMissingName, .{ r, result, true });
}
// This is a fallback, hopefully not called often. It should be relatively quick because everything should be in the cache.
@@ -1682,9 +1683,10 @@ pub const Resolver = struct {
// directory path accidentally being interpreted as URL escapes.
const esm_resolution = esmodule.resolve("/", esm.subpath, exports_map.root);
- if (r.handleESMResolution(esm_resolution, abs_package_path, kind, package_json, esm.subpath)) |*result| {
- result.is_node_module = true;
- return .{ .success = result.* };
+ if (r.handleESMResolution(esm_resolution, abs_package_path, kind, package_json, esm.subpath)) |result| {
+ var result_copy = result;
+ result_copy.is_node_module = true;
+ return .{ .success = result_copy };
}
return .{ .not_found = {} };
@@ -1697,7 +1699,8 @@ pub const Resolver = struct {
debug.addNoteFmt("Checking for a package in the directory \"{s}\"", .{abs_path});
}
- if (r.loadAsFileOrDirectory(abs_path, kind)) |*res| {
+ var tmp = r.loadAsFileOrDirectory(abs_path, kind);
+ if (tmp) |*res| {
res.is_node_module = true;
return .{ .success = res.* };
}
@@ -1729,7 +1732,7 @@ pub const Resolver = struct {
var dir_entries_option: *Fs.FileSystem.RealFS.EntriesOption = undefined;
var needs_iter: bool = true;
- var open_dir = std.fs.openDirAbsolute(dir_path, .{ .iterate = true }) catch |err| {
+ var open_dir = std.fs.cwd().openIterableDir(dir_path, .{}) catch |err| {
switch (err) {
error.FileNotFound => unreachable,
else => {
@@ -1754,8 +1757,8 @@ pub const Resolver = struct {
}) catch unreachable;
if (FeatureFlags.store_file_descriptors) {
- Fs.FileSystem.setMaxFd(open_dir.fd);
- dir_entries_option.entries.fd = open_dir.fd;
+ Fs.FileSystem.setMaxFd(open_dir.dir.fd);
+ dir_entries_option.entries.fd = open_dir.dir.fd;
}
var dir_iterator = open_dir.iterate();
while (dir_iterator.next() catch null) |_value| {
@@ -1777,7 +1780,7 @@ pub const Resolver = struct {
// to check for a parent package.json
null,
allocators.NotFound,
- open_dir.fd,
+ open_dir.dir.fd,
package_id,
);
return dir_info_ptr;
@@ -2011,10 +2014,11 @@ pub const Resolver = struct {
// If this was resolved against an expansion key ending in a "/"
// instead of a "*", we need to try CommonJS-style implicit
// extension and/or directory detection.
- if (r.loadAsFileOrDirectory(abs_esm_path, kind)) |*res| {
- res.is_node_module = true;
- res.package_json = res.package_json orelse package_json;
- return res.*;
+ if (r.loadAsFileOrDirectory(abs_esm_path, kind)) |res| {
+ var res_copy = res;
+ res_copy.is_node_module = true;
+ res_copy.package_json = res.package_json orelse package_json;
+ return res_copy;
}
esm_resolution.status = .ModuleNotFound;
return null;
@@ -2238,9 +2242,9 @@ pub const Resolver = struct {
// Anything
if (open_dir_count > 0 and r.fs.fs.needToCloseFiles()) {
- var open_dirs: []std.fs.Dir = _open_dirs[0..open_dir_count];
+ var open_dirs: []std.fs.IterableDir = _open_dirs[0..open_dir_count];
for (open_dirs) |*open_dir| {
- open_dir.close();
+ open_dir.dir.close();
}
}
}
@@ -2265,7 +2269,7 @@ pub const Resolver = struct {
defer top_parent = queue_top.result;
queue_slice.len -= 1;
- var _open_dir: anyerror!std.fs.Dir = undefined;
+ var _open_dir: anyerror!std.fs.IterableDir = undefined;
if (queue_top.fd == 0) {
// This saves us N copies of .toPosixPath
@@ -2274,17 +2278,16 @@ pub const Resolver = struct {
path.ptr[queue_top.unsafe_path.len] = 0;
defer path.ptr[queue_top.unsafe_path.len] = prev_char;
var sentinel = path.ptr[0..queue_top.unsafe_path.len :0];
- _open_dir = std.fs.openDirAbsoluteZ(
+ _open_dir = std.fs.openIterableDirAbsoluteZ(
sentinel,
.{
- .iterate = true,
.no_follow = !follow_symlinks,
},
);
// }
}
- const open_dir = if (queue_top.fd != 0) std.fs.Dir{ .fd = queue_top.fd } else (_open_dir catch |err| {
+ const open_dir = if (queue_top.fd != 0) std.fs.IterableDir{ .dir = .{ .fd = queue_top.fd } } else (_open_dir catch |err| {
switch (err) {
error.EACCESS => {},
@@ -2329,7 +2332,7 @@ pub const Resolver = struct {
});
if (queue_top.fd == 0) {
- Fs.FileSystem.setMaxFd(open_dir.fd);
+ Fs.FileSystem.setMaxFd(open_dir.dir.fd);
// these objects mostly just wrap the file descriptor, so it's fine to keep it.
_open_dirs[open_dir_count] = open_dir;
open_dir_count += 1;
@@ -2379,8 +2382,8 @@ pub const Resolver = struct {
});
if (FeatureFlags.store_file_descriptors) {
- Fs.FileSystem.setMaxFd(open_dir.fd);
- dir_entries_option.entries.fd = open_dir.fd;
+ Fs.FileSystem.setMaxFd(open_dir.dir.fd);
+ dir_entries_option.entries.fd = open_dir.dir.fd;
}
var dir_iterator = open_dir.iterate();
while (try dir_iterator.next()) |_value| {
@@ -2400,7 +2403,7 @@ pub const Resolver = struct {
cached_dir_entry_result.index,
r.dir_cache.atIndex(top_parent.index),
top_parent.index,
- open_dir.fd,
+ open_dir.dir.fd,
null,
);
@@ -3058,9 +3061,10 @@ pub const Resolver = struct {
}
// Look for an "index" file with known extensions
- if (r.loadAsIndexWithBrowserRemapping(dir_info, path, extension_order)) |*res| {
- res.package_json = res.package_json orelse package_json;
- return res.*;
+ if (r.loadAsIndexWithBrowserRemapping(dir_info, path, extension_order)) |res| {
+ var res_copy = res;
+ res_copy.package_json = res.package_json orelse package_json;
+ return res_copy;
}
return null;
@@ -3297,7 +3301,7 @@ pub const Resolver = struct {
}
const this_dir = std.fs.Dir{ .fd = fd };
- var file = this_dir.openDirZ("node_modules/.bin", .{}) catch break :append_bin_dir;
+ var file = this_dir.openDirZ("node_modules/.bin", .{}, true) catch break :append_bin_dir;
defer file.close();
var bin_path = std.os.getFdPath(file.fd, &node_bin_path) catch break :append_bin_dir;
bin_folders_lock.lock();
@@ -3322,7 +3326,7 @@ pub const Resolver = struct {
}
const this_dir = std.fs.Dir{ .fd = fd };
- var file = this_dir.openDirZ(".bin", .{}) catch break :append_bin_dir;
+ var file = this_dir.openDirZ(".bin", .{}, false) catch break :append_bin_dir;
defer file.close();
var bin_path = std.os.getFdPath(file.fd, &node_bin_path) catch break :append_bin_dir;
bin_folders_lock.lock();
diff --git a/src/router.zig b/src/router.zig
index aaa4f20fc..7f6aba82c 100644
--- a/src/router.zig
+++ b/src/router.zig
@@ -527,8 +527,8 @@ pub const TinyPtr = packed struct {
std.debug.assert(end < right);
}
- const length = @maximum(end, right) - right;
- const offset = @maximum(@ptrToInt(in.ptr), @ptrToInt(parent.ptr)) - @ptrToInt(parent.ptr);
+ const length = @max(end, right) - right;
+ const offset = @max(@ptrToInt(in.ptr), @ptrToInt(parent.ptr)) - @ptrToInt(parent.ptr);
return TinyPtr{ .offset = @truncate(u16, offset), .len = @truncate(u16, length) };
}
};
@@ -585,7 +585,7 @@ pub const Route = struct {
pub fn sortByNameString(_: @This(), lhs: string, rhs: string) bool {
const math = std.math;
- const n = @minimum(lhs.len, rhs.len);
+ const n = @min(lhs.len, rhs.len);
var i: usize = 0;
while (i < n) : (i += 1) {
switch (math.order(sort_table[lhs[i]], sort_table[rhs[i]])) {
@@ -609,7 +609,7 @@ pub const Route = struct {
.eq => switch (a.kind) {
// static + dynamic are sorted alphabetically
.static, .dynamic => @call(
- .{ .modifier = .always_inline },
+ .always_inline,
sortByNameString,
.{
ctx,
@@ -620,7 +620,7 @@ pub const Route = struct {
// catch all and optional catch all must appear below dynamic
.catch_all, .optional_catch_all => switch (std.math.order(a.param_count, b.param_count)) {
.eq => @call(
- .{ .modifier = .always_inline },
+ .always_inline,
sortByNameString,
.{
ctx,
@@ -910,14 +910,14 @@ pub const MockServer = struct {
fn makeTest(cwd_path: string, data: anytype) !void {
Output.initTest();
std.debug.assert(cwd_path.len > 1 and !strings.eql(cwd_path, "/") and !strings.endsWith(cwd_path, "bun"));
- const bun_tests_dir = try std.fs.cwd().makeOpenPath("bun-test-scratch", .{ .iterate = true });
+ const bun_tests_dir = try std.fs.cwd().makeOpenPathIterable("bun-test-scratch", .{});
bun_tests_dir.deleteTree(cwd_path) catch {};
- const cwd = try bun_tests_dir.makeOpenPath(cwd_path, .{ .iterate = true });
+ const cwd = try bun_tests_dir.makeOpenPathIterable(cwd_path, .{});
try cwd.setAsCwd();
const Data = @TypeOf(data);
- const fields: []const std.builtin.TypeInfo.StructField = comptime std.meta.fields(Data);
+ const fields: []const std.builtin.Type.StructField = comptime std.meta.fields(Data);
inline for (fields) |field| {
@setEvalBranchQuota(9999);
const value = @field(data, field.name);
@@ -1250,7 +1250,7 @@ const Pattern = struct {
return null;
};
offset = pattern.len;
- kind = @maximum(@enumToInt(@as(Pattern.Tag, pattern.value)), kind);
+ kind = @max(@enumToInt(@as(Pattern.Tag, pattern.value)), kind);
count += @intCast(u16, @boolToInt(@enumToInt(@as(Pattern.Tag, pattern.value)) > @enumToInt(Pattern.Tag.static)));
}
@@ -1295,7 +1295,7 @@ const Pattern = struct {
if (input.len == 0 or input.len <= @as(usize, offset)) return Pattern{
.value = .{ .static = HashedString.empty },
- .len = @truncate(RoutePathInt, @minimum(input.len, @as(usize, offset))),
+ .len = @truncate(RoutePathInt, @min(input.len, @as(usize, offset))),
};
var i: RoutePathInt = offset;
@@ -1308,7 +1308,7 @@ const Pattern = struct {
while (i <= end) : (i += 1) {
switch (input[i]) {
'/' => {
- return Pattern{ .len = @minimum(i + 1, end), .value = .{ .static = initHashedString(input[offset..i]) } };
+ return Pattern{ .len = @min(i + 1, end), .value = .{ .static = initHashedString(input[offset..i]) } };
},
'[' => {
if (i > offset) {
@@ -1375,7 +1375,7 @@ const Pattern = struct {
if (@enumToInt(tag) > @enumToInt(Tag.dynamic) and i <= end) return error.CatchAllMustBeAtTheEnd;
return Pattern{
- .len = @minimum(i + 1, end),
+ .len = @min(i + 1, end),
.value = switch (tag) {
.dynamic => .{
.dynamic = param,
diff --git a/src/runtime.zig b/src/runtime.zig
index fcec8549b..c942afb13 100644
--- a/src/runtime.zig
+++ b/src/runtime.zig
@@ -15,6 +15,7 @@ const Fs = @import("./fs.zig");
const Schema = @import("./api/schema.zig");
const Ref = @import("ast/base.zig").Ref;
const JSAst = @import("./js_ast.zig");
+const content = @import("root").content;
// packages/bun-cli-*/bun
const BUN_ROOT = "../../";
@@ -31,27 +32,22 @@ fn embedDebugFallback(comptime msg: []const u8, comptime code: []const u8) []con
return code;
}
pub const ErrorCSS = struct {
- const ErrorCSSPath = "packages/bun-error/dist/bun-error.css";
- const ErrorCSSPathDev = "packages/bun-error/bun-error.css";
-
- pub const ProdSourceContent = @embedFile("../" ++ ErrorCSSPath);
-
pub inline fn sourceContent() string {
if (comptime Environment.isDebug) {
var out_buffer: [bun.MAX_PATH_BYTES]u8 = undefined;
var dirname = std.fs.selfExeDirPath(&out_buffer) catch unreachable;
- var paths = [_]string{ dirname, BUN_ROOT, ErrorCSSPathDev };
+ var paths = [_]string{ dirname, BUN_ROOT, content.error_css_path };
const file = std.fs.cwd().openFile(
resolve_path.joinAbsString(dirname, std.mem.span(&paths), .auto),
.{ .mode = .read_only },
) catch return embedDebugFallback(
"Missing packages/bun-error/bun-error.css. Please run \"make bun_error\"",
- ProdSourceContent,
+ content.error_css,
);
defer file.close();
return file.readToEndAlloc(default_allocator, (file.stat() catch unreachable).size) catch unreachable;
} else {
- return ProdSourceContent;
+ return content.error_css;
}
}
};
@@ -59,26 +55,22 @@ pub const ErrorCSS = struct {
pub const ReactRefresh = @embedFile("./react-refresh.js");
pub const ErrorJS = struct {
- const ErrorJSPath = "packages/bun-error/dist/index.js";
-
- pub const ProdSourceContent = @embedFile("../" ++ ErrorJSPath);
-
pub inline fn sourceContent() string {
if (comptime Environment.isDebug) {
var out_buffer: [bun.MAX_PATH_BYTES]u8 = undefined;
var dirname = std.fs.selfExeDirPath(&out_buffer) catch unreachable;
- var paths = [_]string{ dirname, BUN_ROOT, ErrorJSPath };
+ var paths = [_]string{ dirname, BUN_ROOT, content.error_js_path };
const file = std.fs.cwd().openFile(
resolve_path.joinAbsString(dirname, std.mem.span(&paths), .auto),
.{ .mode = .read_only },
) catch return embedDebugFallback(
- "Missing " ++ ErrorJSPath ++ ". Please run \"make bun_error\"",
- ProdSourceContent,
+ "Missing " ++ content.error_js_path ++ ". Please run \"make bun_error\"",
+ content.error_js,
);
defer file.close();
return file.readToEndAlloc(default_allocator, (file.stat() catch unreachable).size) catch unreachable;
} else {
- return ProdSourceContent;
+ return content.error_js;
}
}
};
@@ -124,8 +116,9 @@ pub const Fallback = struct {
};
pub inline fn scriptContent() string {
+ if (true) return;
if (comptime Environment.isDebug) {
- var dirpath = std.fs.path.dirname(@src().file).?;
+ var dirpath = comptime bun.Environment.base_path ++ std.fs.path.dirname(@src().file).?;
var env = std.process.getEnvMap(default_allocator) catch unreachable;
const dir = std.mem.replaceOwned(
@@ -173,6 +166,7 @@ pub const Fallback = struct {
fallback: string,
entry_point: string,
};
+ if (true) return;
try writer.print(HTMLTemplate, PrintArgs{
.blob = Base64FallbackMessage{ .msg = msg, .allocator = allocator },
.preload = preload,
@@ -194,6 +188,7 @@ pub const Fallback = struct {
fallback: string,
bun_error_page_css: string,
};
+ if (true) return;
try writer.print(HTMLBackendTemplate, PrintArgs{
.blob = Base64FallbackMessage{ .msg = msg, .allocator = allocator },
.bun_error_css = ErrorCSS.sourceContent(),
@@ -212,7 +207,7 @@ pub const Runtime = struct {
pub inline fn sourceContentWithoutRefresh() string {
if (comptime Environment.isDebug) {
- var dirpath = std.fs.path.dirname(@src().file).?;
+ var dirpath = comptime bun.Environment.base_path ++ std.fs.path.dirname(@src().file).?;
var env = std.process.getEnvMap(default_allocator) catch unreachable;
const dir = std.mem.replaceOwned(
@@ -249,7 +244,7 @@ pub const Runtime = struct {
pub inline fn sourceContentWithRefresh() string {
if (comptime Environment.isDebug) {
- var dirpath = std.fs.path.dirname(@src().file).?;
+ var dirpath = comptime bun.Environment.base_path ++ std.fs.path.dirname(@src().file).?;
var env = std.process.getEnvMap(default_allocator) catch unreachable;
const dir = std.mem.replaceOwned(
diff --git a/src/sha.zig b/src/sha.zig
index db5a2e79f..80d5f6b36 100644
--- a/src/sha.zig
+++ b/src/sha.zig
@@ -36,13 +36,13 @@ fn NewEVP(
comptime MDName: []const u8,
) type {
return struct {
- ctx: BoringSSL.EVP_MD_CTX,
+ ctx: BoringSSL.EVP_MD_CTX = undefined,
pub const Digest = [digest_size]u8;
pub const digest: comptime_int = digest_size;
pub fn init() @This() {
- const md = @call(.{}, @field(BoringSSL, MDName), .{});
+ const md = @call(.auto, @field(BoringSSL, MDName), .{});
var this: @This() = .{
.ctx = undefined,
};
@@ -55,7 +55,7 @@ fn NewEVP(
}
pub fn hash(bytes: []const u8, out: *Digest, engine: *BoringSSL.ENGINE) void {
- const md = @call(.{}, @field(BoringSSL, MDName), .{});
+ const md = @call(.auto, @field(BoringSSL, MDName), .{});
std.debug.assert(BoringSSL.EVP_Digest(bytes.ptr, bytes.len, out, null, md, engine) == 1);
}
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index e2d95c1ac..58c781762 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -542,7 +542,7 @@ pub fn decodeVLQ(encoded: []const u8, start: usize) VLQResult {
var vlq: u32 = 0;
// hint to the compiler what the maximum value is
- const encoded_ = encoded[start..][0..@minimum(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
+ const encoded_ = encoded[start..][0..@min(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
// inlining helps for the 1 or 2 byte case, hurts a little for larger
comptime var i: usize = 0;
@@ -616,7 +616,7 @@ pub const LineOffsetTable = struct {
pub fn generate(allocator: std.mem.Allocator, contents: []const u8, approximate_line_count: i32) List {
var list = List{};
// Preallocate the top-level table using the approximate line count from the lexer
- list.ensureUnusedCapacity(allocator, @intCast(usize, @maximum(approximate_line_count, 1))) catch unreachable;
+ list.ensureUnusedCapacity(allocator, @intCast(usize, @max(approximate_line_count, 1))) catch unreachable;
var column: i32 = 0;
var byte_offset_to_first_non_ascii: u32 = 0;
var column_byte_offset: u32 = 0;
@@ -675,7 +675,7 @@ pub const LineOffsetTable = struct {
}
} else {
switch (c) {
- (@maximum('\r', '\n') + 1)...127 => {
+ (@max('\r', '\n') + 1)...127 => {
// skip ahead to the next newline or non-ascii character
if (strings.indexOfNewlineOrNonASCIICheckStart(remaining, @as(u32, len_), false)) |j| {
column += @intCast(i32, j);
@@ -701,7 +701,7 @@ pub const LineOffsetTable = struct {
continue;
}
- var owned = columns_for_non_ascii.toOwnedSlice();
+ var owned = columns_for_non_ascii.toOwnedSlice() catch unreachable;
if (stack_fallback.fixed_buffer_allocator.ownsSlice(std.mem.sliceAsBytes(owned))) {
owned = allocator.dupe(i32, owned) catch unreachable;
}
@@ -744,7 +744,7 @@ pub const LineOffsetTable = struct {
}
}
{
- var owned = columns_for_non_ascii.toOwnedSlice();
+ var owned = columns_for_non_ascii.toOwnedSlice() catch unreachable;
if (stack_fallback.fixed_buffer_allocator.ownsSlice(std.mem.sliceAsBytes(owned))) {
owned = allocator.dupe(i32, owned) catch unreachable;
}
@@ -1093,7 +1093,7 @@ pub const Chunk = struct {
b.prev_loc = loc;
const list = b.line_offset_tables;
const original_line = LineOffsetTable.findLine(list, loc);
- const line = list.get(@intCast(usize, @maximum(original_line, 0)));
+ const line = list.get(@intCast(usize, @max(original_line, 0)));
// Use the line to compute the column
var original_column = loc.start - @intCast(i32, line.byte_offset_to_start_of_line);
diff --git a/src/sourcemap/vlq_bench.zig b/src/sourcemap/vlq_bench.zig
index e6ea2724f..2116025f9 100644
--- a/src/sourcemap/vlq_bench.zig
+++ b/src/sourcemap/vlq_bench.zig
@@ -106,7 +106,7 @@ const SourceMap = struct {
var vlq: u32 = 0;
// hint to the compiler what the maximum value is
- const encoded_ = encoded[start..][0..@minimum(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
+ const encoded_ = encoded[start..][0..@min(encoded.len - start, comptime (vlq_max_in_bytes + 1))];
// inlining helps for the 1 or 2 byte case, hurts a little for larger
comptime var i: usize = 0;
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index f3a7cdf5e..e3e72726f 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -200,7 +200,7 @@ pub inline fn indexOf(self: string, str: string) ?usize {
// var start: usize = end - n;
// while (end < buf.len) {
// start = end - n;
-// const last_end = @minimum(end + k - 1, buf.len);
+// const last_end = @min(end + k - 1, buf.len);
// const last_start = last_end - n;
// // Look for the first character in the delimter
@@ -216,7 +216,7 @@ pub inline fn indexOf(self: string, str: string) ?usize {
// }
// }
// }
-// end = @minimum(end + n, buf.len);
+// end = @min(end + n, buf.len);
// }
// if (start < buf.len) return std.mem.indexOfPos(T, buf, start_index, delimiter);
// return null; // Not found
@@ -321,7 +321,8 @@ pub fn copyLowercase(in: string, out: []u8) string {
for (in_slice) |c, i| {
switch (c) {
'A'...'Z' => {
- @memcpy(out_slice.ptr, in_slice.ptr, i);
+ // @memcpy(out_slice.ptr, in_slice.ptr, i);
+ std.mem.copy(u8, out_slice, in_slice);
out_slice[i] = std.ascii.toLower(c);
const end = i + 1;
if (end >= out_slice.len) break :begin;
@@ -333,7 +334,8 @@ pub fn copyLowercase(in: string, out: []u8) string {
}
}
- @memcpy(out_slice.ptr, in_slice.ptr, in_slice.len);
+ // @memcpy(out_slice.ptr, in_slice.ptr, in_slice.len);
+ std.mem.copy(u8, out_slice, in_slice);
break :begin;
}
@@ -518,7 +520,7 @@ pub fn startsWith(self: string, str: string) bool {
}
pub inline fn endsWith(self: string, str: string) bool {
- return str.len == 0 or @call(.{ .modifier = .always_inline }, std.mem.endsWith, .{ u8, self, str });
+ return str.len == 0 or @call(.always_inline, std.mem.endsWith, .{ u8, self, str });
}
pub inline fn endsWithComptime(self: string, comptime str: anytype) bool {
@@ -599,7 +601,7 @@ pub fn countChar(self: string, char: u8) usize {
while (remaining.len >= 16) {
const vec: AsciiVector = remaining[0..ascii_vector_size].*;
- const cmp = @popCount(std.meta.Int(.unsigned, ascii_vector_size), @bitCast(@Vector(ascii_vector_size, u1), vec == splatted));
+ const cmp = @popCount(@bitCast(@Vector(ascii_vector_size, u1), vec == splatted));
total += @as(usize, @reduce(.Add, cmp));
remaining = remaining[ascii_vector_size..];
}
@@ -668,11 +670,7 @@ pub fn hasPrefixComptime(self: string, comptime alt: anytype) bool {
return self.len >= alt.len and eqlComptimeCheckLenWithType(u8, self[0..alt.len], alt, false);
}
-/// Check if two strings are equal with one of the strings being a comptime-known value
-///
-/// strings.eqlComptime(input, "hello world");
-/// strings.eqlComptime(input, "hai");
-pub inline fn eqlComptimeCheckLenWithType(comptime Type: type, a: []const Type, comptime b: anytype, comptime check_len: bool) bool {
+inline fn eqlComptimeCheckLenWithKnownType(comptime Type: type, a: []const Type, comptime b: []const Type, comptime check_len: bool) bool {
@setEvalBranchQuota(9999);
if (comptime check_len) {
if (comptime b.len == 0) {
@@ -724,6 +722,18 @@ pub inline fn eqlComptimeCheckLenWithType(comptime Type: type, a: []const Type,
return true;
}
+/// Check if two strings are equal with one of the strings being a comptime-known value
+///
+/// strings.eqlComptime(input, "hello world");
+/// strings.eqlComptime(input, "hai");
+pub inline fn eqlComptimeCheckLenWithType(comptime Type: type, a: []const Type, comptime b: anytype, comptime check_len: bool) bool {
+ if (@typeInfo(@TypeOf(b)) != .Pointer) {
+ return eqlComptimeCheckLenWithKnownType(comptime Type, a, &b, comptime check_len);
+ } else {
+ return eqlComptimeCheckLenWithKnownType(comptime Type, a, b, comptime check_len);
+ }
+}
+
pub fn eqlCaseInsensitiveASCII(a: string, comptime b: anytype, comptime check_len: bool) bool {
if (comptime check_len) {
if (comptime b.len == 0) {
@@ -866,7 +876,7 @@ pub inline fn copyU8IntoU16(output_: []u16, input_: []const u8) void {
var input_ptr = input.ptr;
var output_ptr = output.ptr;
- const last_input_ptr = input_ptr + @minimum(input.len, output.len);
+ const last_input_ptr = input_ptr + @min(input.len, output.len);
while (last_input_ptr != input_ptr) {
output_ptr[0] = input_ptr[0];
@@ -950,7 +960,7 @@ pub inline fn copyU16IntoU8(output_: []u8, comptime InputType: type, input_: Inp
var input_ptr = input.ptr;
var output_ptr = output.ptr;
- const last_input_ptr = input_ptr + @minimum(input.len, output.len);
+ const last_input_ptr = input_ptr + @min(input.len, output.len);
while (last_input_ptr != input_ptr) {
output_ptr[0] = @truncate(u8, input_ptr[0]);
@@ -1044,7 +1054,7 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa
}
}
- remaining = remaining[@maximum(replacement.len, 1)..];
+ remaining = remaining[@max(replacement.len, 1)..];
const new_len = strings.u16Len(replacement.code_point);
try output.ensureUnusedCapacity(new_len);
output.items.len += @as(usize, new_len);
@@ -1079,7 +1089,7 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa
}
}
- remaining = remaining[@maximum(replacement.len, 1)..];
+ remaining = remaining[@max(replacement.len, 1)..];
const new_len = j + @as(usize, strings.u16Len(replacement.code_point));
try output.ensureUnusedCapacity(new_len);
output.items.len += new_len;
@@ -1214,7 +1224,8 @@ pub fn allocateLatin1IntoUTF8(allocator: std.mem.Allocator, comptime Type: type,
}
var list = try std.ArrayList(u8).initCapacity(allocator, latin1_.len);
- return (try allocateLatin1IntoUTF8WithList(list, 0, Type, latin1_)).toOwnedSlice();
+ var foo = try allocateLatin1IntoUTF8WithList(list, 0, Type, latin1_);
+ return try foo.toOwnedSlice();
}
pub fn allocateLatin1IntoUTF8WithList(list_: std.ArrayList(u8), offset_into_list: usize, comptime Type: type, latin1_: Type) !std.ArrayList(u8) {
@@ -1244,7 +1255,7 @@ pub fn allocateLatin1IntoUTF8WithList(list_: std.ArrayList(u8), offset_into_list
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(latin1[first_set_byte] >= 127);
}
@@ -1266,7 +1277,7 @@ pub fn allocateLatin1IntoUTF8WithList(list_: std.ArrayList(u8), offset_into_list
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(latin1[first_set_byte] >= 127);
}
@@ -1295,7 +1306,7 @@ pub fn allocateLatin1IntoUTF8WithList(list_: std.ArrayList(u8), offset_into_list
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(latin1[first_set_byte] >= 127);
}
@@ -1457,7 +1468,7 @@ pub fn copyLatin1IntoUTF8(buf_: []u8, comptime Type: type, latin1_: Type) Encode
pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_: Type, comptime stop: bool) EncodeIntoResult {
if (comptime bun.FeatureFlags.latin1_is_now_ascii) {
- const to_copy = @truncate(u32, @minimum(buf_.len, latin1_.len));
+ const to_copy = @truncate(u32, @min(buf_.len, latin1_.len));
@memcpy(buf_.ptr, latin1_.ptr, to_copy);
return .{ .written = to_copy, .read = to_copy };
}
@@ -1469,7 +1480,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
while (buf.len > 0 and latin1.len > 0) {
inner: {
- var remaining_runs = @minimum(buf.len, latin1.len) / ascii_vector_size;
+ var remaining_runs = @min(buf.len, latin1.len) / ascii_vector_size;
while (remaining_runs > 0) : (remaining_runs -= 1) {
const vec: AsciiVector = latin1[0..ascii_vector_size].*;
@@ -1489,7 +1500,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
buf[0..size].* = @bitCast([size]u8, bytes);
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(latin1[first_set_byte] >= 127);
}
@@ -1511,7 +1522,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
buf[0..size].* = @bitCast([size]u8, bytes);
assert(mask > 0);
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(latin1[first_set_byte] >= 127);
}
@@ -1532,7 +1543,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
{
const Int = u64;
const size = @sizeOf(Int);
- while (@minimum(buf.len, latin1.len) >= size) {
+ while (@min(buf.len, latin1.len) >= size) {
const bytes = @bitCast(Int, latin1[0..size].*);
buf[0..size].* = @bitCast([size]u8, bytes);
@@ -1541,7 +1552,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime stop) return .{ .written = std.math.maxInt(u32), .read = std.math.maxInt(u32) };
if (comptime Environment.allow_assert) {
@@ -1560,7 +1571,7 @@ pub fn copyLatin1IntoUTF8StopOnNonASCII(buf_: []u8, comptime Type: type, latin1_
}
{
- const end = latin1.ptr + @minimum(buf.len, latin1.len);
+ const end = latin1.ptr + @min(buf.len, latin1.len);
assert(@ptrToInt(latin1.ptr + 8) > @ptrToInt(end));
const start_ptr = @ptrToInt(buf.ptr);
const start_ptr_latin1 = @ptrToInt(latin1.ptr);
@@ -1620,7 +1631,7 @@ pub fn elementLengthLatin1IntoUTF8(comptime Type: type, latin1_: Type) usize {
@bitCast(Int, latin1[size .. 2 * size].*) & 0x8080808080808080,
};
- const non_ascii_count = ((@popCount(Int, bytes[0]) / 8) + (@popCount(Int, bytes[1]) / 8));
+ const non_ascii_count = ((@popCount(bytes[0]) / 8) + (@popCount(bytes[1]) / 8));
total_non_ascii_count += non_ascii_count;
}
@@ -1630,7 +1641,7 @@ pub fn elementLengthLatin1IntoUTF8(comptime Type: type, latin1_: Type) usize {
if (latin1.len >= 8) {
const bytes = @bitCast(u64, latin1[0..8].*) & 0x8080808080808080;
- total_non_ascii_count += @popCount(u64, bytes) / 8;
+ total_non_ascii_count += @popCount(bytes) / 8;
latin1 = latin1[8..];
}
@@ -1771,6 +1782,7 @@ pub fn escapeHTMLForLatin1Input(allocator: std.mem.Allocator, latin1: []const u8
return Escaped(u8){ .allocated = output };
}
};
+ @setEvalBranchQuota(5000);
switch (latin1.len) {
0 => return Escaped(u8){ .static = "" },
1 => return switch (latin1[0]) {
@@ -2025,7 +2037,7 @@ pub fn escapeHTMLForLatin1Input(allocator: std.mem.Allocator, latin1: []const u8
return Escaped(u8){ .original = void{} };
}
- return Escaped(u8){ .allocated = buf.toOwnedSlice() };
+ return Escaped(u8){ .allocated = try buf.toOwnedSlice() };
},
}
}
@@ -2328,7 +2340,7 @@ pub fn escapeHTMLForUTF16Input(allocator: std.mem.Allocator, utf16: []const u16)
return Escaped(u16){ .original = {} };
}
- return Escaped(u16){ .allocated = buf.toOwnedSlice() };
+ return Escaped(u16){ .allocated = try buf.toOwnedSlice() };
},
}
}
@@ -2459,12 +2471,12 @@ pub fn copyUTF16IntoUTF8WithBuffer(buf: []u8, comptime Type: type, utf16: Type,
}
while (firstNonASCII16(Type, utf16_remaining)) |i| {
- const end = @minimum(i, remaining.len);
+ const end = @min(i, remaining.len);
if (end > 0) copyU16IntoU8(remaining, Type, utf16_remaining[0..end]);
remaining = remaining[end..];
utf16_remaining = utf16_remaining[end..];
- if (@minimum(utf16_remaining.len, remaining.len) == 0)
+ if (@min(utf16_remaining.len, remaining.len) == 0)
break;
const replacement = utf16Codepoint(Type, utf16_remaining);
@@ -2481,7 +2493,7 @@ pub fn copyUTF16IntoUTF8WithBuffer(buf: []u8, comptime Type: type, utf16: Type,
}
if (remaining.len > 0 and !ended_on_non_ascii and utf16_remaining.len > 0) {
- const len = @minimum(remaining.len, utf16_remaining.len);
+ const len = @min(remaining.len, utf16_remaining.len);
copyU16IntoU8(remaining[0..len], Type, utf16_remaining[0..len]);
utf16_remaining = utf16_remaining[len..];
remaining = remaining[len..];
@@ -2531,7 +2543,7 @@ pub fn elementLengthUTF8IntoUTF16(comptime Type: type, utf8: Type) usize {
const replacement = utf16Codepoint(Type, utf8_remaining);
count += replacement.len;
- utf8_remaining = utf8_remaining[@minimum(replacement.utf8Width(), utf8_remaining.len)..];
+ utf8_remaining = utf8_remaining[@min(replacement.utf8Width(), utf8_remaining.len)..];
}
return count + utf8_remaining.len;
@@ -2581,9 +2593,7 @@ pub fn utf16EqlString(text: []const u16, str: string) bool {
// WTF-8 instead. See https://simonsapin.github.io/wtf-8/ for more info.
pub fn encodeWTF8Rune(p: *[4]u8, r: i32) u3 {
return @call(
- .{
- .modifier = .always_inline,
- },
+ .always_inline,
encodeWTF8RuneT,
.{
p,
@@ -2805,7 +2815,7 @@ pub fn firstNonASCIIWithType(comptime Type: type, slice: Type) ?u32 {
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(remaining[first_set_byte] > 127);
var j: usize = 0;
@@ -2823,7 +2833,7 @@ pub fn firstNonASCIIWithType(comptime Type: type, slice: Type) ?u32 {
const mask = bytes & 0x8080808080808080;
if (mask > 0) {
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(remaining[first_set_byte] > 127);
var j: usize = 0;
@@ -2868,7 +2878,7 @@ pub fn firstNonASCIIWithType(comptime Type: type, slice: Type) ?u32 {
if (mask > 0) {
remaining.len -= @ptrToInt(remaining.ptr) - @ptrToInt(remaining_start);
- const first_set_byte = @ctz(Int, mask) / 8;
+ const first_set_byte = @ctz(mask) / 8;
if (comptime Environment.allow_assert) {
assert(remaining[first_set_byte] > 127);
var j: usize = 0;
@@ -2924,8 +2934,8 @@ pub fn indexOfNewlineOrNonASCIICheckStart(slice_: []const u8, offset: u32, compt
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '\n')));
if (@reduce(.Max, cmp) > 0) {
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
+ const bitmask = @bitCast(AsciiVectorInt, cmp);
+ const first = @ctz(bitmask);
return @as(u32, first) + @intCast(u32, slice.len - remaining.len) + offset;
}
@@ -2963,8 +2973,8 @@ pub fn indexOfNeedsEscape(slice: []const u8) ?u32 {
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '"')));
if (@reduce(.Max, cmp) > 0) {
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
+ const bitmask = @bitCast(AsciiVectorInt, cmp);
+ const first = @ctz(bitmask);
return @as(u32, first) + @truncate(u32, @ptrToInt(remaining.ptr) - @ptrToInt(slice.ptr));
}
@@ -3005,8 +3015,8 @@ pub fn indexOfChar(slice: []const u8, char: u8) ?u32 {
const cmp = vec == @splat(ascii_vector_size, char);
if (@reduce(.Max, @bitCast(AsciiVectorU1, cmp)) > 0) {
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
+ const bitmask = @bitCast(AsciiVectorInt, cmp);
+ const first = @ctz(bitmask);
return @intCast(u32, @as(u32, first) + @intCast(u32, slice.len - remaining.len));
}
remaining = remaining[ascii_vector_size..];
@@ -3070,8 +3080,8 @@ pub fn indexOfNotChar(slice: []const u8, char: u8) ?u32 {
const vec: AsciiVector = remaining[0..ascii_vector_size].*;
const cmp = @splat(ascii_vector_size, char) != vec;
if (@reduce(.Max, @bitCast(AsciiVectorU1, cmp)) > 0) {
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
+ const bitmask = @bitCast(AsciiVectorInt, cmp);
+ const first = @ctz(bitmask);
return @as(u32, first) + @intCast(u32, slice.len - remaining.len);
}
@@ -3272,8 +3282,8 @@ pub fn firstNonASCII16CheckMin(comptime Slice: type, slice: Slice, comptime chec
// it removes a loop, but probably is slower in the end
const cmp = @bitCast(AsciiVectorU16U1, vec > max_u16_ascii) |
@bitCast(AsciiVectorU16U1, vec < min_u16_ascii);
- const bitmask: u16 = @ptrCast(*const u16, &cmp).*;
- const first = @ctz(u16, bitmask);
+ const bitmask: u8 = @bitCast(u8, cmp);
+ const first = @ctz(bitmask);
return @intCast(u32, @as(u32, first) +
@intCast(u32, slice.len - remaining.len));
@@ -3283,8 +3293,8 @@ pub fn firstNonASCII16CheckMin(comptime Slice: type, slice: Slice, comptime chec
remaining.len -= (@ptrToInt(remaining.ptr) - @ptrToInt(remaining_start)) / 2;
const cmp = vec > max_u16_ascii;
- const bitmask = @ptrCast(*const u16, &cmp).*;
- const first = @ctz(u16, bitmask);
+ const bitmask: u8 = @bitCast(u8, cmp);
+ const first = @ctz(bitmask);
return @intCast(u32, @as(u32, first) +
@intCast(u32, slice.len - remaining.len));
@@ -3331,8 +3341,8 @@ pub fn @"nextUTF16NonASCIIOr$`\\"(
@bitCast(AsciiVectorU16U1, (vec == @splat(ascii_u16_vector_size, @as(u16, '`')))) |
@bitCast(AsciiVectorU16U1, (vec == @splat(ascii_u16_vector_size, @as(u16, '\\'))));
- const bitmask = @ptrCast(*const u8, &cmp).*;
- const first = @ctz(u8, bitmask);
+ const bitmask = @bitCast(u8, cmp);
+ const first = @ctz(bitmask);
if (first < ascii_u16_vector_size) {
return @intCast(u32, @as(u32, first) +
@intCast(u32, slice.len - remaining.len));
@@ -3453,7 +3463,7 @@ pub fn formatLatin1(slice_: []const u8, writer: anytype) !void {
try writer.writeAll(slice[0..i]);
slice = slice[i..];
}
- const result = strings.copyLatin1IntoUTF8(&chunk, @TypeOf(slice), slice[0..@minimum(chunk.len, slice.len)]);
+ const result = strings.copyLatin1IntoUTF8(&chunk, @TypeOf(slice), slice[0..@min(chunk.len, slice.len)]);
if (result.read == 0 or result.written == 0)
break;
try writer.writeAll(chunk[0..result.written]);
@@ -3607,7 +3617,7 @@ pub fn sortDesc(in: []string) void {
}
pub fn isASCIIHexDigit(c: u8) bool {
- return std.ascii.isDigit(c) or std.ascii.isXDigit(c);
+ return std.ascii.isHex(c);
}
pub fn toASCIIHexValue(character: u8) u8 {
@@ -3689,7 +3699,7 @@ pub fn NewCodePointIterator(comptime CodePointType: type, comptime zeroValue: co
const cp_len = utf8ByteSequenceLength(bytes[next_]);
it.next_width = cp_len;
- it.i = @minimum(next_, bytes.len);
+ it.i = @min(next_, bytes.len);
const slice = bytes[prev..][0..cp_len];
it.width = @intCast(u3, slice.len);
@@ -3821,7 +3831,7 @@ pub fn moveAllSlices(comptime Type: type, container: *Type, from: string, to: st
const fields_we_care_about = comptime brk: {
var count: usize = 0;
for (std.meta.fields(Type)) |field| {
- if (std.meta.trait.isSlice(field.field_type) and std.meta.Child(field.field_type) == u8) {
+ if (std.meta.trait.isSlice(field.type) and std.meta.Child(field.type) == u8) {
count += 1;
}
}
@@ -3829,7 +3839,7 @@ pub fn moveAllSlices(comptime Type: type, container: *Type, from: string, to: st
var fields: [count][]const u8 = undefined;
count = 0;
for (std.meta.fields(Type)) |field| {
- if (std.meta.trait.isSlice(field.field_type) and std.meta.Child(field.field_type) == u8) {
+ if (std.meta.trait.isSlice(field.type) and std.meta.Child(field.type) == u8) {
fields[count] = field.name;
count += 1;
}
diff --git a/src/string_joiner.zig b/src/string_joiner.zig
index 8359b58bb..d6440008a 100644
--- a/src/string_joiner.zig
+++ b/src/string_joiner.zig
@@ -40,7 +40,7 @@ pub fn done(this: *Joiner, allocator: std.mem.Allocator) ![]u8 {
const to_join = join.data.slice[join.data.offset..];
@memcpy(remaining.ptr, to_join.ptr, to_join.len);
- remaining = remaining[@minimum(remaining.len, to_join.len)..];
+ remaining = remaining[@min(remaining.len, to_join.len)..];
var prev = join;
el_ = join.next;
diff --git a/src/string_mutable.zig b/src/string_mutable.zig
index 2a130672a..765aa6c09 100644
--- a/src/string_mutable.zig
+++ b/src/string_mutable.zig
@@ -132,7 +132,7 @@ pub const MutableString = struct {
has_needed_gap = true;
}
- return mutable.list.toOwnedSlice(allocator);
+ return try mutable.list.toOwnedSlice(allocator);
}
return str;
@@ -198,7 +198,7 @@ pub const MutableString = struct {
}
pub fn toOwnedSlice(self: *MutableString) string {
- return self.list.toOwnedSlice(self.allocator);
+ return self.list.toOwnedSlice(self.allocator) catch @panic("TODO");
}
pub fn toOwnedSliceLeaky(self: *MutableString) []u8 {
@@ -218,7 +218,7 @@ pub const MutableString = struct {
pub fn toOwnedSliceLength(self: *MutableString, length: usize) string {
self.list.shrinkAndFree(self.allocator, length);
- return self.list.toOwnedSlice(self.allocator);
+ return self.list.toOwnedSlice(self.allocator) catch @panic("TODO");
}
// pub fn deleteAt(self: *MutableString, i: usize) {
diff --git a/src/string_types.zig b/src/string_types.zig
index fb49e5f27..e1e3dbf26 100644
--- a/src/string_types.zig
+++ b/src/string_types.zig
@@ -103,7 +103,7 @@ pub const HashedString = struct {
pub fn Eql(this: HashedString, comptime Other: type, other: Other) bool {
switch (comptime Other) {
HashedString, *HashedString, *const HashedString => {
- return ((@maximum(this.hash, other.hash) > 0 and this.hash == other.hash) or (this.ptr == other.ptr)) and this.len == other.len;
+ return ((@max(this.hash, other.hash) > 0 and this.hash == other.hash) or (this.ptr == other.ptr)) and this.len == other.len;
},
else => {
return @as(usize, this.len) == other.len and @truncate(u32, std.hash.Wyhash.hash(0, other[0..other.len])) == this.hash;
diff --git a/src/sync.zig b/src/sync.zig
index 22c99a05b..0fad16736 100644
--- a/src/sync.zig
+++ b/src/sync.zig
@@ -1,5 +1,6 @@
const std = @import("std");
const system = std.system;
+const bun = @import("bun");
// https://gist.github.com/kprotty/0d2dc3da4840341d6ff361b27bdac7dc
pub const ThreadPool = struct {
@@ -61,7 +62,7 @@ pub const ThreadPool = struct {
fn runFn(runnable: *Runnable) void {
const run_node = @fieldParentPtr(RunNode, "data", runnable);
const closure = @fieldParentPtr(@This(), "run_node", run_node);
- _ = @call(.{}, func, closure.func_args);
+ _ = @call(.auto, func, closure.func_args);
closure.allocator.destroy(closure);
}
};
@@ -352,7 +353,7 @@ pub const ThreadPool = struct {
const List = std.TailQueue(Runnable);
const RunNode = List.Node;
const Runnable = struct {
- runFn: fn (*Runnable) void,
+ runFn: *const (fn (*Runnable) void),
};
};
@@ -610,7 +611,7 @@ pub const RwLock = if (@import("builtin").os.tag != .windows and @import("builti
.netbsd => extern struct {
ptr_magic: c_uint = 0x99990009,
ptr_interlock: switch (@import("builtin").target.cpu.arch) {
- .aarch64, .sparc, .x86_64, .i386 => u8,
+ .aarch64, .sparc, .x86_64 => u8,
.arm, .powerpc => c_int,
else => unreachable,
} = 0,
@@ -657,8 +658,8 @@ else
const IS_WRITING: usize = 1;
const WRITER: usize = 1 << 1;
const READER: usize = 1 << (1 + std.meta.bitCount(Count));
- const WRITER_MASK: usize = std.math.maxInt(Count) << @ctz(usize, WRITER);
- const READER_MASK: usize = std.math.maxInt(Count) << @ctz(usize, READER);
+ const WRITER_MASK: usize = std.math.maxInt(Count) << @ctz(WRITER);
+ const READER_MASK: usize = std.math.maxInt(Count) << @ctz(READER);
const Count = std.meta.Int(.unsigned, @divFloor(std.meta.bitCount(usize) - 1, 2));
pub fn init() RwLock {
diff --git a/src/tagged_pointer.zig b/src/tagged_pointer.zig
index b17963a6d..b30be8a56 100644
--- a/src/tagged_pointer.zig
+++ b/src/tagged_pointer.zig
@@ -5,8 +5,6 @@ const Output = bun.Output;
const Global = bun.Global;
const Environment = bun.Environment;
const strings = bun.strings;
-const MutableString = bun.MutableString;
-const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
const typeBaseName = @import("./meta.zig").typeBaseName;
@@ -54,8 +52,8 @@ pub const TaggedPointer = packed struct {
pub fn TaggedPointerUnion(comptime Types: anytype) type {
const TagType: type = tag_break: {
if (std.meta.trait.isIndexable(@TypeOf(Types))) {
- var enumFields: [Types.len]std.builtin.TypeInfo.EnumField = undefined;
- var decls = [_]std.builtin.TypeInfo.Declaration{};
+ var enumFields: [Types.len]std.builtin.Type.EnumField = undefined;
+ var decls = [_]std.builtin.Type.Declaration{};
inline for (Types) |field, i| {
enumFields[i] = .{
@@ -66,7 +64,6 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
break :tag_break @Type(.{
.Enum = .{
- .layout = .Auto,
.tag_type = TagSize,
.fields = &enumFields,
.decls = &decls,
@@ -74,9 +71,9 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
},
});
} else {
- const Fields: []const std.builtin.TypeInfo.StructField = std.meta.fields(@TypeOf(Types));
- var enumFields: [Fields.len]std.builtin.TypeInfo.EnumField = undefined;
- var decls = [_]std.builtin.TypeInfo.Declaration{};
+ const Fields: []const std.builtin.Type.StructField = std.meta.fields(@TypeOf(Types));
+ var enumFields: [Fields.len]std.builtin.Type.EnumField = undefined;
+ var decls = [_]std.builtin.Type.Declaration{};
inline for (Fields) |field, i| {
enumFields[i] = .{
@@ -87,7 +84,6 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
break :tag_break @Type(.{
.Enum = .{
- .layout = .Auto,
.tag_type = TagSize,
.fields = &enumFields,
.decls = &decls,
diff --git a/src/tcc.zig b/src/tcc.zig
index 67c7f0a3d..10a69954c 100644
--- a/src/tcc.zig
+++ b/src/tcc.zig
@@ -1,5 +1,5 @@
pub const TCCState = opaque {};
-pub const TCCErrorFunc = ?fn (?*anyopaque, [*c]const u8) callconv(.C) void;
+pub const TCCErrorFunc = ?*const fn (?*anyopaque, [*c]const u8) callconv(.C) void;
pub extern fn tcc_new() ?*TCCState;
pub extern fn tcc_delete(s: *TCCState) void;
pub extern fn tcc_set_lib_path(s: *TCCState, path: [*c]const u8) void;
@@ -16,12 +16,12 @@ pub extern fn tcc_compile_string(s: *TCCState, buf: [*c]const u8) c_int;
pub extern fn tcc_set_output_type(s: *TCCState, output_type: c_int) c_int;
pub extern fn tcc_add_library_path(s: *TCCState, pathname: [*c]const u8) c_int;
pub extern fn tcc_add_library(s: *TCCState, libraryname: [*c]const u8) c_int;
-pub extern fn tcc_add_symbol(s: *TCCState, name: [*c]const u8, val: ?*const anyopaque) c_int;
+pub extern fn tcc_add_symbol(s: *TCCState, name: [*:0]const u8, val: *const anyopaque) c_int;
pub extern fn tcc_output_file(s: *TCCState, filename: [*c]const u8) c_int;
pub extern fn tcc_run(s: *TCCState, argc: c_int, argv: [*c][*c]u8) c_int;
pub extern fn tcc_relocate(s1: *TCCState, ptr: ?*anyopaque) c_int;
pub extern fn tcc_get_symbol(s: *TCCState, name: [*c]const u8) ?*anyopaque;
-pub extern fn tcc_list_symbols(s: *TCCState, ctx: ?*anyopaque, symbol_cb: ?fn (?*anyopaque, [*c]const u8, ?*const anyopaque) callconv(.C) void) void;
+pub extern fn tcc_list_symbols(s: *TCCState, ctx: ?*anyopaque, symbol_cb: ?*const fn (?*anyopaque, [*c]const u8, ?*const anyopaque) callconv(.C) void) void;
pub const TCC_OUTPUT_MEMORY = @as(c_int, 1);
pub const TCC_OUTPUT_EXE = @as(c_int, 2);
pub const TCC_OUTPUT_DLL = @as(c_int, 3);
diff --git a/src/thread_pool.zig b/src/thread_pool.zig
index 3cfc02979..47feae0df 100644
--- a/src/thread_pool.zig
+++ b/src/thread_pool.zig
@@ -9,7 +9,7 @@ const Futex = @import("./futex.zig");
const Environment = bun.Environment;
const assert = std.debug.assert;
const Atomic = std.atomic.Atomic;
-pub const OnSpawnCallback = fn (ctx: ?*anyopaque) ?*anyopaque;
+pub const OnSpawnCallback = *const fn (ctx: ?*anyopaque) ?*anyopaque;
sleep_on_idle_network_thread: bool = true,
/// executed on the thread
@@ -73,7 +73,7 @@ pub fn deinit(self: *ThreadPool) void {
/// The user provides a `callback` which is invoked when the *Task can run on a thread.
pub const Task = struct {
node: Node = .{},
- callback: fn (*Task) void,
+ callback: *const (fn (*Task) void),
};
/// An unordered collection of Tasks which can be submitted for scheduling as a group.
diff --git a/src/toml/toml_lexer.zig b/src/toml/toml_lexer.zig
index 7377ff50a..11d469c4f 100644
--- a/src/toml/toml_lexer.zig
+++ b/src/toml/toml_lexer.zig
@@ -768,7 +768,7 @@ pub const Lexer = struct {
} else {
try lexer.decodeEscapeSequences(start, text, false, @TypeOf(array_list), &array_list);
}
- lexer.string_literal_slice = array_list.toOwnedSlice();
+ lexer.string_literal_slice = try array_list.toOwnedSlice();
}
lexer.token = T.t_string_literal;
diff --git a/src/url.zig b/src/url.zig
index 74b7a5ae4..ccba2f92b 100644
--- a/src/url.zig
+++ b/src/url.zig
@@ -210,7 +210,7 @@ pub const URL = struct {
}
pub fn parse(base_: string) URL {
- const base = std.mem.trim(u8, base_, &std.ascii.spaces);
+ const base = std.mem.trim(u8, base_, &std.ascii.whitespace);
if (base.len == 0) return URL{};
var url = URL{};
url.href = base;
@@ -542,7 +542,7 @@ pub const QueryStringMap = struct {
pub fn getAll(this: *const QueryStringMap, input: string, target: []string) usize {
const hash = std.hash.Wyhash.hash(0, input);
const _slice = this.list.slice();
- return @call(.{ .modifier = .always_inline }, getAllWithHashFromOffset, .{ this, target, hash, 0, _slice });
+ return @call(.always_inline, getAllWithHashFromOffset, .{ this, target, hash, 0, _slice });
}
pub fn getAllWithHashFromOffset(this: *const QueryStringMap, target: []string, hash: u64, offset: usize, _slice: Param.List.Slice) usize {
@@ -775,7 +775,7 @@ pub const QueryStringMap = struct {
pub const PercentEncoding = struct {
pub fn decode(comptime Writer: type, writer: Writer, input: string) !u32 {
- return @call(.{ .modifier = .always_inline }, decodeFaultTolerant, .{ Writer, writer, input, null, false });
+ return @call(.always_inline, decodeFaultTolerant, .{ Writer, writer, input, null, false });
}
pub fn decodeFaultTolerant(
@@ -1133,23 +1133,23 @@ test "QueryStringMap (full)" {
const url = "?cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_quote_count=true&include_reply_count=1&tweet_mode=extended&dm_users=false&include_groups=true&include_inbox_timelines=true&include_ext_media_color=true&supports_reactions=true&muting_enabled=false&nsfw_filtering_enabled=false&cursor=GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA&filter_low_quality=true&include_quality=all&ext=mediaColor&ext=altText&ext=mediaStats&ext=highlightedLabel&ext=voiceInfo";
// from chrome's devtools
const fixture = .{
- .@"cards_platform" = "Web-12",
- .@"include_cards" = "1",
- .@"include_ext_alt_text" = "true",
- .@"include_quote_count" = "true",
- .@"include_reply_count" = "1",
- .@"tweet_mode" = "extended",
- .@"dm_users" = "false",
- .@"include_groups" = "true",
- .@"include_inbox_timelines" = "true",
- .@"include_ext_media_color" = "true",
- .@"supports_reactions" = "true",
- .@"muting_enabled" = "false",
- .@"nsfw_filtering_enabled" = "false",
- .@"cursor" = "GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA",
- .@"filter_low_quality" = "true",
- .@"include_quality" = "all",
- .@"ext" = &[_]string{ "mediaColor", "altText", "mediaStats", "highlightedLabel", "voiceInfo" },
+ .cards_platform = "Web-12",
+ .include_cards = "1",
+ .include_ext_alt_text = "true",
+ .include_quote_count = "true",
+ .include_reply_count = "1",
+ .tweet_mode = "extended",
+ .dm_users = "false",
+ .include_groups = "true",
+ .include_inbox_timelines = "true",
+ .include_ext_media_color = "true",
+ .supports_reactions = "true",
+ .muting_enabled = "false",
+ .nsfw_filtering_enabled = "false",
+ .cursor = "GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA",
+ .filter_low_quality = "true",
+ .include_quality = "all",
+ .ext = &[_]string{ "mediaColor", "altText", "mediaStats", "highlightedLabel", "voiceInfo" },
};
var map = (try QueryStringMap.init(std.testing.allocator, url)) orelse return try std.testing.expect(false);
@@ -1186,8 +1186,8 @@ test "QueryStringMap (full)" {
test "QueryStringMap not encoded" {
const url = "?hey=1&wow=true";
const fixture = .{
- .@"hey" = "1",
- .@"wow" = "true",
+ .hey = "1",
+ .wow = "true",
};
const url_slice = std.mem.span(url);
var map = (try QueryStringMap.init(std.testing.allocator, url_slice)) orelse return try std.testing.expect(false);
@@ -1205,23 +1205,23 @@ test "QueryStringMap Iterator" {
const url = "?cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_quote_count=true&include_reply_count=1&tweet_mode=extended&dm_users=false&include_groups=true&include_inbox_timelines=true&include_ext_media_color=true&supports_reactions=true&muting_enabled=false&nsfw_filtering_enabled=false&cursor=GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA&filter_low_quality=true&ext=voiceInfo&include_quality=all&ext=mediaColor&ext=altText&ext=mediaStats&ext=highlightedLabel";
// from chrome's devtools
const fixture = .{
- .@"cards_platform" = "Web-12",
- .@"include_cards" = "1",
- .@"include_ext_alt_text" = "true",
- .@"include_quote_count" = "true",
- .@"include_reply_count" = "1",
- .@"tweet_mode" = "extended",
- .@"dm_users" = "false",
- .@"include_groups" = "true",
- .@"include_inbox_timelines" = "true",
- .@"include_ext_media_color" = "true",
- .@"supports_reactions" = "true",
- .@"muting_enabled" = "false",
- .@"nsfw_filtering_enabled" = "false",
- .@"cursor" = "GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA",
- .@"filter_low_quality" = "true",
- .@"include_quality" = "all",
- .@"ext" = &[_]string{
+ .cards_platform = "Web-12",
+ .include_cards = "1",
+ .include_ext_alt_text = "true",
+ .include_quote_count = "true",
+ .include_reply_count = "1",
+ .tweet_mode = "extended",
+ .dm_users = "false",
+ .include_groups = "true",
+ .include_inbox_timelines = "true",
+ .include_ext_media_color = "true",
+ .supports_reactions = "true",
+ .muting_enabled = "false",
+ .nsfw_filtering_enabled = "false",
+ .cursor = "GRwmkMCq6fLUnMAnFpDAquny1JzAJyUAAAA",
+ .filter_low_quality = "true",
+ .include_quality = "all",
+ .ext = &[_]string{
"voiceInfo",
"mediaColor",
"altText",
diff --git a/src/walker_skippable.zig b/src/walker_skippable.zig
index cc3f3fa22..53eff3325 100644
--- a/src/walker_skippable.zig
+++ b/src/walker_skippable.zig
@@ -10,7 +10,7 @@ skip_dirnames: []const u64 = &[_]u64{},
skip_all: []const u64 = &[_]u64{},
seed: u64 = 0,
-const Dir = std.fs.Dir;
+const Dir = std.fs.IterableDir;
pub const WalkerEntry = struct {
/// The containing directory. This can be used to operate directly on `basename`
@@ -78,7 +78,7 @@ pub fn next(self: *Walker) !?WalkerEntry {
self.name_buffer.shrinkRetainingCapacity(cur_len);
if (base.kind == .Directory) {
- var new_dir = top.iter.dir.openDir(base.name, .{ .iterate = true }) catch |err| switch (err) {
+ var new_dir = top.iter.dir.openIterableDir(base.name, .{}) catch |err| switch (err) {
error.NameTooLong => unreachable, // no path sep in base.name
else => |e| return e,
};
@@ -92,7 +92,7 @@ pub fn next(self: *Walker) !?WalkerEntry {
}
}
return WalkerEntry{
- .dir = top.iter.dir,
+ .dir = .{ .dir = top.iter.dir },
.basename = self.name_buffer.items[dirname_len..],
.path = self.name_buffer.items,
.kind = base.kind,
@@ -108,7 +108,7 @@ pub fn next(self: *Walker) !?WalkerEntry {
}
pub fn deinit(self: *Walker) void {
- while (self.stack.popOrNull()) |*item| {
+ for (self.stack.items[1..]) |*item| {
if (self.stack.items.len != 0) {
item.iter.dir.close();
}
diff --git a/src/watcher.zig b/src/watcher.zig
index a1c65bb77..2a20c0db3 100644
--- a/src/watcher.zig
+++ b/src/watcher.zig
@@ -436,7 +436,7 @@ pub fn NewWatcher(comptime ContextType: type) type {
null,
);
- var changes = changelist[0..@intCast(usize, @maximum(0, count_))];
+ var changes = changelist[0..@intCast(usize, @max(0, count_))];
var watchevents = this.watch_events[0..changes.len];
for (changes) |event, i| {
watchevents[i].fromKEvent(event);
@@ -464,7 +464,7 @@ pub fn NewWatcher(comptime ContextType: type) type {
const eventlist_index = this.watchlist.items(.eventlist_index);
while (remaining_events > 0) {
- const slice = events[0..@minimum(remaining_events, this.watch_events.len)];
+ const slice = events[0..@min(remaining_events, this.watch_events.len)];
var watchevents = this.watch_events[0..slice.len];
var watch_event_id: u32 = 0;
for (slice) |event| {
@@ -643,8 +643,8 @@ pub fn NewWatcher(comptime ContextType: type) type {
const fd = brk: {
if (fd_ > 0) break :brk fd_;
- const dir = try std.fs.openDirAbsolute(file_path, .{ .iterate = true });
- break :brk @truncate(StoredFileDescriptorType, dir.fd);
+ const dir = try std.fs.cwd().openIterableDir(file_path, .{});
+ break :brk @truncate(StoredFileDescriptorType, dir.dir.fd);
};
const parent_hash = Watcher.getHash(Fs.PathName.init(file_path).dirWithTrailingSlash());
diff --git a/src/work_pool.zig b/src/work_pool.zig
index 00ea34f3a..d67bc9544 100644
--- a/src/work_pool.zig
+++ b/src/work_pool.zig
@@ -13,7 +13,7 @@ pub fn NewWorkPool(comptime max_threads: ?usize) type {
@setCold(true);
pool = ThreadPool.init(.{
- .max_threads = max_threads orelse @floatToInt(u32, @floor(@intToFloat(f32, @maximum(std.Thread.getCpuCount() catch 0, 2)) * 0.8)),
+ .max_threads = max_threads orelse @floatToInt(u32, @floor(@intToFloat(f32, @max(std.Thread.getCpuCount() catch 0, 2)) * 0.8)),
.stack_size = 2 * 1024 * 1024,
});
return &pool;
diff --git a/src/zlib.zig b/src/zlib.zig
index 4be96760f..e161d4d79 100644
--- a/src/zlib.zig
+++ b/src/zlib.zig
@@ -60,8 +60,8 @@ const z_crc_t = c_uint;
// typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
// typedef void (*free_func) OF((voidpf opaque, voidpf address));
-pub const z_alloc_fn = ?fn (*anyopaque, uInt, uInt) callconv(.C) voidpf;
-pub const z_free_fn = ?fn (*anyopaque, *anyopaque) callconv(.C) void;
+pub const z_alloc_fn = ?*const fn (*anyopaque, uInt, uInt) callconv(.C) voidpf;
+pub const z_free_fn = ?*const fn (*anyopaque, *anyopaque) callconv(.C) void;
pub const struct_internal_state = extern struct {
dummy: c_int,
diff --git a/test/bun.js/body-stream.test.ts b/test/bun.js/body-stream.test.ts
index 0a44246b0..5f505143c 100644
--- a/test/bun.js/body-stream.test.ts
+++ b/test/bun.js/body-stream.test.ts
@@ -1,10 +1,8 @@
// @ts-nocheck
import { file, gc, serve, ServeOptions } from "bun";
-import { afterEach, describe, expect, it, test } from "bun:test";
+import { afterAll, afterEach, describe, expect, it, test } from "bun:test";
import { readFileSync } from "fs";
-// afterEach(() => Bun.gc(true));
-
var port = 4021;
{
@@ -215,6 +213,11 @@ async function runInServer(
}
}
+afterAll(() => {
+ existingServer && existingServer.close();
+ existingServer = null;
+});
+
function fillRepeating(dstBuffer, start, end) {
let len = dstBuffer.length,
sLen = end - start,
diff --git a/test/bun.js/ffi.test.js b/test/bun.js/ffi.test.js
index e3e858b1f..4adf67990 100644
--- a/test/bun.js/ffi.test.js
+++ b/test/bun.js/ffi.test.js
@@ -1,4 +1,4 @@
-import { expect, it } from "bun:test";
+import { afterAll, describe, expect, it } from "bun:test";
//
import {
CFunction,
@@ -310,186 +310,191 @@ function getTypes(fast) {
}
function ffiRunner(fast) {
- const types = getTypes(fast);
- const {
- symbols: {
- returns_true,
- returns_false,
- return_a_function_ptr_to_function_that_returns_true,
- returns_42_char,
- returns_42_float,
- returns_42_double,
- returns_42_uint8_t,
- returns_neg_42_int8_t,
- returns_42_uint16_t,
- returns_42_uint32_t,
- returns_42_uint64_t,
- returns_neg_42_int16_t,
- returns_neg_42_int32_t,
- returns_neg_42_int64_t,
- identity_char,
- identity_float,
- identity_bool,
- identity_double,
- identity_int8_t,
- identity_int16_t,
- identity_int32_t,
- identity_int64_t,
- identity_uint8_t,
- identity_uint16_t,
- identity_uint32_t,
- identity_uint64_t,
- add_char,
- add_float,
- add_double,
- add_int8_t,
- add_int16_t,
- add_int32_t,
- add_int64_t,
- add_uint8_t,
- add_uint16_t,
- identity_ptr,
- add_uint32_t,
- add_uint64_t,
- is_null,
- does_pointer_equal_42_as_int32_t,
- ptr_should_point_to_42_as_int32_t,
- cb_identity_true,
- cb_identity_false,
- cb_identity_42_char,
- cb_identity_42_float,
- cb_identity_42_double,
- cb_identity_42_uint8_t,
- cb_identity_neg_42_int8_t,
- cb_identity_42_uint16_t,
- cb_identity_42_uint32_t,
- cb_identity_42_uint64_t,
- cb_identity_neg_42_int16_t,
- cb_identity_neg_42_int32_t,
- cb_identity_neg_42_int64_t,
- getDeallocatorCalledCount,
- getDeallocatorCallback,
- getDeallocatorBuffer,
- },
- close,
- } = dlopen("/tmp/bun-ffi-test.dylib", types);
-
- Bun.gc(true);
- expect(returns_true()).toBe(true);
- Bun.gc(true);
- expect(returns_false()).toBe(false);
-
- expect(returns_42_char()).toBe(42);
- if (fast) expect(returns_42_uint64_t().valueOf()).toBe(42);
- else expect(returns_42_uint64_t().valueOf()).toBe(42n);
- Bun.gc(true);
- expect(Math.fround(returns_42_float())).toBe(Math.fround(42.41999804973602));
- expect(returns_42_double()).toBe(42.42);
- expect(returns_42_uint8_t()).toBe(42);
- expect(returns_neg_42_int8_t()).toBe(-42);
- expect(returns_42_uint16_t()).toBe(42);
- expect(returns_42_uint32_t()).toBe(42);
- if (fast) expect(returns_42_uint64_t()).toBe(42);
- else expect(returns_42_uint64_t()).toBe(42n);
- expect(returns_neg_42_int16_t()).toBe(-42);
- expect(returns_neg_42_int32_t()).toBe(-42);
- expect(identity_int32_t(10)).toBe(10);
- Bun.gc(true);
- if (fast) expect(returns_neg_42_int64_t()).toBe(-42);
- else expect(returns_neg_42_int64_t()).toBe(-42n);
-
- expect(identity_char(10)).toBe(10);
-
- expect(identity_float(10.199999809265137)).toBe(10.199999809265137);
-
- expect(identity_bool(true)).toBe(true);
-
- expect(identity_bool(false)).toBe(false);
- expect(identity_double(10.100000000000364)).toBe(10.100000000000364);
-
- expect(identity_int8_t(10)).toBe(10);
- expect(identity_int16_t(10)).toBe(10);
-
- if (fast) expect(identity_int64_t(10)).toBe(10);
- else expect(identity_int64_t(10)).toBe(10n);
- expect(identity_uint8_t(10)).toBe(10);
- expect(identity_uint16_t(10)).toBe(10);
- expect(identity_uint32_t(10)).toBe(10);
- if (fast) expect(identity_uint64_t(10)).toBe(10);
- else expect(identity_uint64_t(10)).toBe(10n);
- Bun.gc(true);
- var bigArray = new BigUint64Array(8);
- new Uint8Array(bigArray.buffer).fill(255);
- var bigIntArray = new BigInt64Array(bigArray.buffer);
- expect(identity_uint64_t(bigArray[0])).toBe(bigArray[0]);
- expect(identity_uint64_t(bigArray[0] - BigInt(1))).toBe(
- bigArray[0] - BigInt(1),
- );
- if (fast) {
- expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0);
- expect(
- add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
- ).toBe(10);
- } else {
- expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0n);
- expect(
- add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
- ).toBe(10n);
- }
- if (fast) {
- expect(identity_uint64_t(0)).toBe(0);
- expect(identity_uint64_t(100)).toBe(100);
- expect(identity_uint64_t(BigInt(100))).toBe(100);
-
- expect(identity_int64_t(bigIntArray[0])).toBe(-1);
- expect(identity_int64_t(bigIntArray[0] - BigInt(1))).toBe(-2);
- } else {
- expect(identity_uint64_t(0)).toBe(0n);
- expect(identity_uint64_t(100)).toBe(100n);
- expect(identity_uint64_t(BigInt(100))).toBe(100n);
-
- expect(identity_int64_t(bigIntArray[0])).toBe(bigIntArray[0]);
- expect(identity_int64_t(bigIntArray[0] - BigInt(1))).toBe(
- bigIntArray[0] - BigInt(1),
- );
- }
- Bun.gc(true);
- expect(add_char.native(1, 1)).toBe(2);
-
- expect(add_float(2.4, 2.8)).toBe(Math.fround(5.2));
- expect(add_double(4.2, 0.1)).toBe(4.3);
- expect(add_int8_t(1, 1)).toBe(2);
- expect(add_int16_t(1, 1)).toBe(2);
- expect(add_int32_t(1, 1)).toBe(2);
- if (fast) expect(add_int64_t(1, 1)).toBe(2);
- else expect(add_int64_t(1n, 1n)).toBe(2n);
- expect(add_uint8_t(1, 1)).toBe(2);
- expect(add_uint16_t(1, 1)).toBe(2);
- expect(add_uint32_t(1, 1)).toBe(2);
- Bun.gc(true);
- expect(is_null(null)).toBe(true);
- const cptr = ptr_should_point_to_42_as_int32_t();
- expect(cptr != 0).toBe(true);
- expect(typeof cptr === "number").toBe(true);
- expect(does_pointer_equal_42_as_int32_t(cptr)).toBe(true);
- const buffer = toBuffer(cptr, 0, 4);
- expect(buffer.readInt32(0)).toBe(42);
- expect(new DataView(toArrayBuffer(cptr, 0, 4), 0, 4).getInt32(0, true)).toBe(
- 42,
- );
- expect(ptr(buffer)).toBe(cptr);
- expect(new CString(cptr, 0, 1).toString()).toBe("*");
- expect(identity_ptr(cptr)).toBe(cptr);
- const second_ptr = ptr(new Buffer(8));
- expect(identity_ptr(second_ptr)).toBe(second_ptr);
-
- var myCFunction = new CFunction({
- ptr: return_a_function_ptr_to_function_that_returns_true(),
- returns: "bool",
- });
- expect(myCFunction()).toBe(true);
+ describe("FFI runner" + (fast ? " (fast int)" : ""), () => {
+ const types = getTypes(fast);
+ const {
+ symbols: {
+ returns_true,
+ returns_false,
+ return_a_function_ptr_to_function_that_returns_true,
+ returns_42_char,
+ returns_42_float,
+ returns_42_double,
+ returns_42_uint8_t,
+ returns_neg_42_int8_t,
+ returns_42_uint16_t,
+ returns_42_uint32_t,
+ returns_42_uint64_t,
+ returns_neg_42_int16_t,
+ returns_neg_42_int32_t,
+ returns_neg_42_int64_t,
+ identity_char,
+ identity_float,
+ identity_bool,
+ identity_double,
+ identity_int8_t,
+ identity_int16_t,
+ identity_int32_t,
+ identity_int64_t,
+ identity_uint8_t,
+ identity_uint16_t,
+ identity_uint32_t,
+ identity_uint64_t,
+ add_char,
+ add_float,
+ add_double,
+ add_int8_t,
+ add_int16_t,
+ add_int32_t,
+ add_int64_t,
+ add_uint8_t,
+ add_uint16_t,
+ identity_ptr,
+ add_uint32_t,
+ add_uint64_t,
+ is_null,
+ does_pointer_equal_42_as_int32_t,
+ ptr_should_point_to_42_as_int32_t,
+ cb_identity_true,
+ cb_identity_false,
+ cb_identity_42_char,
+ cb_identity_42_float,
+ cb_identity_42_double,
+ cb_identity_42_uint8_t,
+ cb_identity_neg_42_int8_t,
+ cb_identity_42_uint16_t,
+ cb_identity_42_uint32_t,
+ cb_identity_42_uint64_t,
+ cb_identity_neg_42_int16_t,
+ cb_identity_neg_42_int32_t,
+ cb_identity_neg_42_int64_t,
+ getDeallocatorCalledCount,
+ getDeallocatorCallback,
+ getDeallocatorBuffer,
+ },
+ close,
+ } = dlopen("/tmp/bun-ffi-test.dylib", types);
+ it("primitives", () => {
+ Bun.gc(true);
+ expect(returns_true()).toBe(true);
+ Bun.gc(true);
+ expect(returns_false()).toBe(false);
+
+ expect(returns_42_char()).toBe(42);
+ if (fast) expect(returns_42_uint64_t().valueOf()).toBe(42);
+ else expect(returns_42_uint64_t().valueOf()).toBe(42n);
+ Bun.gc(true);
+ expect(Math.fround(returns_42_float())).toBe(
+ Math.fround(42.41999804973602),
+ );
+ expect(returns_42_double()).toBe(42.42);
+ expect(returns_42_uint8_t()).toBe(42);
+ expect(returns_neg_42_int8_t()).toBe(-42);
+ expect(returns_42_uint16_t()).toBe(42);
+ expect(returns_42_uint32_t()).toBe(42);
+ if (fast) expect(returns_42_uint64_t()).toBe(42);
+ else expect(returns_42_uint64_t()).toBe(42n);
+ expect(returns_neg_42_int16_t()).toBe(-42);
+ expect(returns_neg_42_int32_t()).toBe(-42);
+ expect(identity_int32_t(10)).toBe(10);
+ Bun.gc(true);
+ if (fast) expect(returns_neg_42_int64_t()).toBe(-42);
+ else expect(returns_neg_42_int64_t()).toBe(-42n);
+
+ expect(identity_char(10)).toBe(10);
+
+ expect(identity_float(10.199999809265137)).toBe(10.199999809265137);
+
+ expect(identity_bool(true)).toBe(true);
+
+ expect(identity_bool(false)).toBe(false);
+ expect(identity_double(10.100000000000364)).toBe(10.100000000000364);
+
+ expect(identity_int8_t(10)).toBe(10);
+ expect(identity_int16_t(10)).toBe(10);
+
+ if (fast) expect(identity_int64_t(10)).toBe(10);
+ else expect(identity_int64_t(10)).toBe(10n);
+ expect(identity_uint8_t(10)).toBe(10);
+ expect(identity_uint16_t(10)).toBe(10);
+ expect(identity_uint32_t(10)).toBe(10);
+ if (fast) expect(identity_uint64_t(10)).toBe(10);
+ else expect(identity_uint64_t(10)).toBe(10n);
+ Bun.gc(true);
+ var bigArray = new BigUint64Array(8);
+ new Uint8Array(bigArray.buffer).fill(255);
+ var bigIntArray = new BigInt64Array(bigArray.buffer);
+ expect(identity_uint64_t(bigArray[0])).toBe(bigArray[0]);
+ expect(identity_uint64_t(bigArray[0] - BigInt(1))).toBe(
+ bigArray[0] - BigInt(1),
+ );
+ if (fast) {
+ expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0);
+ expect(
+ add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
+ ).toBe(10);
+ } else {
+ expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0n);
+ expect(
+ add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
+ ).toBe(10n);
+ }
+ if (fast) {
+ expect(identity_uint64_t(0)).toBe(0);
+ expect(identity_uint64_t(100)).toBe(100);
+ expect(identity_uint64_t(BigInt(100))).toBe(100);
+
+ expect(identity_int64_t(bigIntArray[0])).toBe(-1);
+ expect(identity_int64_t(bigIntArray[0] - BigInt(1))).toBe(-2);
+ } else {
+ expect(identity_uint64_t(0)).toBe(0n);
+ expect(identity_uint64_t(100)).toBe(100n);
+ expect(identity_uint64_t(BigInt(100))).toBe(100n);
+
+ expect(identity_int64_t(bigIntArray[0])).toBe(bigIntArray[0]);
+ expect(identity_int64_t(bigIntArray[0] - BigInt(1))).toBe(
+ bigIntArray[0] - BigInt(1),
+ );
+ }
+ Bun.gc(true);
+ expect(add_char.native(1, 1)).toBe(2);
+
+ expect(add_float(2.4, 2.8)).toBe(Math.fround(5.2));
+ expect(add_double(4.2, 0.1)).toBe(4.3);
+ expect(add_int8_t(1, 1)).toBe(2);
+ expect(add_int16_t(1, 1)).toBe(2);
+ expect(add_int32_t(1, 1)).toBe(2);
+ if (fast) expect(add_int64_t(1, 1)).toBe(2);
+ else expect(add_int64_t(1n, 1n)).toBe(2n);
+ expect(add_uint8_t(1, 1)).toBe(2);
+ expect(add_uint16_t(1, 1)).toBe(2);
+ expect(add_uint32_t(1, 1)).toBe(2);
+ Bun.gc(true);
+ expect(is_null(null)).toBe(true);
+ const cptr = ptr_should_point_to_42_as_int32_t();
+ expect(cptr != 0).toBe(true);
+ expect(typeof cptr === "number").toBe(true);
+ expect(does_pointer_equal_42_as_int32_t(cptr)).toBe(true);
+ const buffer = toBuffer(cptr, 0, 4);
+ expect(buffer.readInt32(0)).toBe(42);
+ expect(
+ new DataView(toArrayBuffer(cptr, 0, 4), 0, 4).getInt32(0, true),
+ ).toBe(42);
+ expect(ptr(buffer)).toBe(cptr);
+ expect(new CString(cptr, 0, 1).toString()).toBe("*");
+ expect(identity_ptr(cptr)).toBe(cptr);
+ const second_ptr = ptr(new Buffer(8));
+ expect(identity_ptr(second_ptr)).toBe(second_ptr);
+ });
+
+ it("CFunction", () => {
+ var myCFunction = new CFunction({
+ ptr: return_a_function_ptr_to_function_that_returns_true(),
+ returns: "bool",
+ });
+ expect(myCFunction()).toBe(true);
+ });
- {
const typeMap = {
int8_t: -8,
int16_t: -16,
@@ -505,25 +510,7 @@ function ffiRunner(fast) {
"void*": null,
};
- // Return types, 1 argument
- for (let [returnName, returnValue] of Object.entries(typeMap)) {
- var roundtripFunction = new CFunction({
- ptr: new JSCallback(
- (input) => {
- return input;
- },
- {
- returns: returnName,
- args: [returnName],
- },
- ).ptr,
- returns: returnName,
- args: [returnName],
- });
- expect(roundtripFunction(returnValue)).toBe(returnValue);
- }
-
- {
+ it("JSCallback", () => {
var toClose = new JSCallback(
(input) => {
return input;
@@ -536,65 +523,72 @@ function ffiRunner(fast) {
expect(toClose.ptr > 0).toBe(true);
toClose.close();
expect(toClose.ptr === null).toBe(true);
- }
-
- // Return types, no args
- for (let [name, value] of Object.entries(typeMap)) {
- var roundtripFunction = new CFunction({
- ptr: new JSCallback(() => value, {
- returns: name,
- }).ptr,
- returns: name,
- });
- expect(roundtripFunction()).toBe(value);
- }
-
- // 1 arg, threadsafe
- for (let [name, value] of Object.entries(typeMap)) {
- var roundtripFunction = new CFunction({
- ptr: new JSCallback(
- (arg1) => {
- expect(arg1).toBe(value);
- },
- {
+ });
+
+ describe("callbacks", () => {
+ // Return types, 1 argument
+ for (let [returnName, returnValue] of Object.entries(typeMap)) {
+ it("fn(" + returnName + ") " + returnName, () => {
+ var roundtripFunction = new CFunction({
+ ptr: new JSCallback(
+ (input) => {
+ return input;
+ },
+ {
+ returns: returnName,
+ args: [returnName],
+ },
+ ).ptr,
+ returns: returnName,
+ args: [returnName],
+ });
+ expect(roundtripFunction(returnValue)).toBe(returnValue);
+ });
+ }
+ // Return types, no args
+ for (let [name, value] of Object.entries(typeMap)) {
+ it("fn() " + name, () => {
+ var roundtripFunction = new CFunction({
+ ptr: new JSCallback(() => value, {
+ returns: name,
+ }).ptr,
+ returns: name,
+ });
+ expect(roundtripFunction()).toBe(value);
+ });
+ }
+ });
+
+ describe("threadsafe callback", (done) => {
+ // 1 arg, threadsafe
+ for (let [name, value] of Object.entries(typeMap)) {
+ it("fn(" + name + ") " + name, async () => {
+ const cb = new JSCallback(
+ (arg1) => {
+ expect(arg1).toBe(value);
+ },
+ {
+ args: [name],
+ threadsafe: true,
+ },
+ );
+ var roundtripFunction = new CFunction({
+ ptr: cb.ptr,
+ returns: "void",
args: [name],
- threadsafe: true,
- },
- ).ptr,
- returns: "void",
- args: [name],
- });
- roundtripFunction(value);
- }
- }
-
- // check deallocator is called
-
- // for (let constructor of [toArrayBuffer, toBuffer]) {
- // Bun.gc(true);
-
- // var bufferPtr = getDeallocatorBuffer();
-
- // for (let i = 0; i < 100; i++) {
- // // callback, no userData
- // constructor(bufferPtr, 0, 128, getDeallocatorCallback());
-
- // // callback, userData;
- // constructor(bufferPtr, 0, 128, bufferPtr, getDeallocatorCallback());
- // }
-
- // Bun.gc(true);
- // expect(getDeallocatorCalledCount() >= 190).toBe(true);
- // Bun.gc(true);
- // }
- close();
+ });
+ roundtripFunction(value);
+ await 1;
+ });
+ }
+ });
+
+ afterAll(() => {
+ close();
+ });
+ });
}
-// TODO: There is a crash when dlopen() two times the same library in quick succession
-// it("run ffi fast", () => {
-// ffiRunner(true);
-// });
-
it("read", () => {
const buffer = new BigInt64Array(16);
const dataView = new DataView(buffer.buffer);
@@ -629,6 +623,7 @@ it("read", () => {
}
});
-it("run ffi", () => {
+describe("run ffi", () => {
ffiRunner(false);
+ ffiRunner(true);
});
diff --git a/test/bun.js/inline.macro.js b/test/bun.js/inline.macro.js
index 0fd7491b9..082dbeaf4 100644
--- a/test/bun.js/inline.macro.js
+++ b/test/bun.js/inline.macro.js
@@ -12,8 +12,12 @@ export function promiseReturningFunction(expr, ctx) {
export function promiseReturningCtx(expr, ctx) {
return new Promise((resolve, reject) => {
- setTimeout(() => {
- resolve(ctx);
- }, 1);
+ setTimeout(
+ (ctx) => {
+ resolve(ctx);
+ },
+ 1,
+ ctx,
+ );
});
}
diff --git a/test/bun.js/node-timers.test.ts b/test/bun.js/node-timers.test.ts
index a1f2d08a4..f1a8ae802 100644
--- a/test/bun.js/node-timers.test.ts
+++ b/test/bun.js/node-timers.test.ts
@@ -1,10 +1,11 @@
import { test } from "bun:test";
import { setTimeout } from "node:timers";
-test("unref is possible", () => {
- const timer = setTimeout(() => {
- throw new Error("should not be called");
- }, 1000);
- timer.unref();
- clearTimeout(timer);
-});
+// not implemented yet
+// test("unref is possible", () => {
+// const timer = setTimeout(() => {
+// throw new Error("should not be called");
+// }, 1000);
+// timer.unref();
+// clearTimeout(timer);
+// });
diff --git a/test/bun.js/serve.test.ts b/test/bun.js/serve.test.ts
index becddc678..61740748d 100644
--- a/test/bun.js/serve.test.ts
+++ b/test/bun.js/serve.test.ts
@@ -1,5 +1,5 @@
import { file, gc, serve } from "bun";
-import { afterEach, describe, it, expect } from "bun:test";
+import { afterEach, describe, it, expect, beforeAll, afterAll } from "bun:test";
import { readFile, readFileSync, writeFileSync } from "fs";
import { resolve } from "path";
@@ -7,509 +7,613 @@ afterEach(() => Bun.gc(true));
var port = 10000;
var count = 200;
+var server;
async function runTest(serverOptions, test) {
- var server;
- while (true) {
- try {
- serverOptions.port = port++;
- server = serve(serverOptions);
- break;
- } catch (e: any) {
- if (e?.message !== `Failed to start server. Is port ${serverOptions.port} in use?`) {
- throw e;
+ if (server) {
+ server.reload(serverOptions);
+ } else {
+ while (!server) {
+ try {
+ serverOptions.port = port++;
+ server = serve(serverOptions);
+ break;
+ } catch (e: any) {
+ if (
+ e?.message !==
+ `Failed to start server. Is port ${serverOptions.port} in use?`
+ ) {
+ throw e;
+ }
}
}
}
- try {
- await test(server);
- } finally {
- server?.stop();
- server = null;
- }
+
+ await test(server);
}
+afterAll(() => {
+ if (server) {
+ server.stop();
+ server = undefined;
+ }
+});
+
it("should work for a file", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(file(fixture));
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(file(fixture));
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
it("request.url should log successfully", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
var expected;
- await runTest({
- fetch(req) {
- expect(Bun.inspect(req).includes(expected)).toBe(true);
- return new Response(file(fixture));
+ await runTest(
+ {
+ fetch(req) {
+ expect(Bun.inspect(req).includes(expected)).toBe(true);
+ return new Response(file(fixture));
+ },
},
- }, async (server) => {
- expected = `http://localhost:${server.port}/helloooo`;
- const response = await fetch(expected);
- expect(response.url).toBe(expected);
- expect(await response.text()).toBe(textToExpect);
- });
+ async (server) => {
+ expected = `http://localhost:${server.port}/helloooo`;
+ const response = await fetch(expected);
+ expect(response.url).toBe(expected);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
it("request.url should be based on the Host header", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- expect(req.url).toBe("http://example.com/helloooo");
- return new Response(file(fixture));
- },
- }, async (server) => {
- const expected = `http://${server.hostname}:${server.port}/helloooo`;
- const response = await fetch(expected, {
- headers: {
- Host: "example.com",
+ await runTest(
+ {
+ fetch(req) {
+ expect(req.url).toBe("http://example.com/helloooo");
+ return new Response(file(fixture));
},
- });
- expect(response.url).toBe(expected);
- expect(await response.text()).toBe(textToExpect);
- });
+ },
+ async (server) => {
+ const expected = `http://${server.hostname}:${server.port}/helloooo`;
+ const response = await fetch(expected, {
+ headers: {
+ Host: "example.com",
+ },
+ });
+ expect(response.url).toBe(expected);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
describe("streaming", () => {
describe("error handler", () => {
it("throw on pull reports an error and close the connection", async () => {
var pass = false;
- await runTest({
- development: false,
- error(e) {
- pass = true;
- return new Response("PASS", { status: 555 });
+ await runTest(
+ {
+ development: false,
+ error(e) {
+ pass = true;
+ return new Response("PASS", { status: 555 });
+ },
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ pull(controller) {
+ throw new Error("FAIL");
+ },
+ }),
+ );
+ },
},
- fetch(req) {
- return new Response(
- new ReadableStream({
- pull(controller) {
- throw new Error("FAIL");
- },
- }),
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ if (response.status > 0) {
+ expect(response.status).toBe(555);
+ expect(await response.text()).toBe("PASS");
+ }
+ expect(pass).toBe(true);
},
- }, async (server) => {
- const response = await fetch(
- `http://${server.hostname}:${server.port}`,
- );
- if (response.status > 0) {
- expect(response.status).toBe(555);
- expect(await response.text()).toBe("PASS");
- }
- expect(pass).toBe(true);
- });
+ );
});
it("throw on pull after writing should not call the error handler", async () => {
var pass = true;
- await runTest({
- development: false,
- error(e) {
- pass = true;
- return new Response("FAIL", { status: 555 });
+ await runTest(
+ {
+ development: false,
+ error(e) {
+ pass = true;
+ return new Response("FAIL", { status: 555 });
+ },
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ pull(controller) {
+ controller.enqueue("PASS");
+ throw new Error("error");
+ },
+ }),
+ );
+ },
},
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
+ );
+ // connection terminated
+ expect(response.status).toBe(500);
+ expect(await response.text()).toBe("PASS");
+ expect(pass).toBe(true);
+ },
+ );
+ });
+ });
+
+ it("text from JS, one chunk", async () => {
+ const relative = new URL("./fetch.js.txt", import.meta.url);
+ const textToExpect = readFileSync(relative, "utf-8");
+ await runTest(
+ {
fetch(req) {
return new Response(
new ReadableStream({
- pull(controller) {
- controller.enqueue("PASS");
- throw new Error("error");
+ start(controller) {
+ controller.enqueue(textToExpect);
+ controller.close();
},
}),
);
},
- }, async (server) => {
+ },
+ async (server) => {
const response = await fetch(
`http://${server.hostname}:${server.port}`,
);
- // connection terminated
- expect(response.status).toBe(500);
- expect(await response.text()).toBe("PASS");
- expect(pass).toBe(true);
- });
- });
- });
-
- it("text from JS, one chunk", async () => {
- const relative = new URL("./fetch.js.txt", import.meta.url);
- const textToExpect = readFileSync(relative, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- start(controller) {
- controller.enqueue(textToExpect);
- controller.close();
- },
- }),
- );
+ const text = await response.text();
+ expect(text.length).toBe(textToExpect.length);
+ expect(text).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- const text = await response.text();
- expect(text.length).toBe(textToExpect.length);
- expect(text).toBe(textToExpect);
- });
+ );
});
it("text from JS, two chunks", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
- const textToExpect = readFileSync(fixture, "utf-8")
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- start(controller) {
- controller.enqueue(textToExpect.substring(0, 100));
- controller.enqueue(textToExpect.substring(100));
- controller.close();
- },
- }),
+ const textToExpect = readFileSync(fixture, "utf-8");
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ start(controller) {
+ controller.enqueue(textToExpect.substring(0, 100));
+ controller.enqueue(textToExpect.substring(100));
+ controller.close();
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(await response.text()).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ );
});
it("text from JS throws on start no error handler", async () => {
- await runTest({
- port: port++,
- development: false,
- fetch(req) {
- return new Response(
- new ReadableStream({
- start(controller) {
- throw new Error("Test Passed");
- },
- }),
+ await runTest(
+ {
+ port: port++,
+ development: false,
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ start(controller) {
+ throw new Error("Test Passed");
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(response.status).toBe(500);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(response.status).toBe(500);
- });
+ );
});
it("text from JS throws on start has error handler", async () => {
var pass = false;
var err;
- await runTest({
- development: false,
- error(e) {
- pass = true;
- err = e;
- return new Response("Fail", { status: 500 });
+ await runTest(
+ {
+ development: false,
+ error(e) {
+ pass = true;
+ err = e;
+ return new Response("Fail", { status: 500 });
+ },
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ start(controller) {
+ throw new TypeError("error");
+ },
+ }),
+ );
+ },
},
- fetch(req) {
- return new Response(
- new ReadableStream({
- start(controller) {
- throw new TypeError("error");
- },
- }),
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(response.status).toBe(500);
+ expect(await response.text()).toBe("Fail");
+ expect(pass).toBe(true);
+ expect(err?.name).toBe("TypeError");
+ expect(err?.message).toBe("error");
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(response.status).toBe(500);
- expect(await response.text()).toBe("Fail");
- expect(pass).toBe(true);
- expect(err?.name).toBe("TypeError");
- expect(err?.message).toBe("error");
- });
+ );
});
it("text from JS, 2 chunks, with delay", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- start(controller) {
- controller.enqueue(textToExpect.substring(0, 100));
- queueMicrotask(() => {
- controller.enqueue(textToExpect.substring(100));
- controller.close();
- });
- },
- }),
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ start(controller) {
+ controller.enqueue(textToExpect.substring(0, 100));
+ queueMicrotask(() => {
+ controller.enqueue(textToExpect.substring(100));
+ controller.close();
+ });
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(await response.text()).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ );
});
it("text from JS, 1 chunk via pull()", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- pull(controller) {
- controller.enqueue(textToExpect);
- controller.close();
- },
- }),
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ pull(controller) {
+ controller.enqueue(textToExpect);
+ controller.close();
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ const text = await response.text();
+ expect(text).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- const text = await response.text();
- expect(text).toBe(textToExpect);
- });
+ );
});
it("text from JS, 2 chunks, with delay in pull", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- pull(controller) {
- controller.enqueue(textToExpect.substring(0, 100));
- queueMicrotask(() => {
- controller.enqueue(textToExpect.substring(100));
- controller.close();
- });
- },
- }),
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ pull(controller) {
+ controller.enqueue(textToExpect.substring(0, 100));
+ queueMicrotask(() => {
+ controller.enqueue(textToExpect.substring(100));
+ controller.close();
+ });
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(await response.text()).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ );
});
it("text from JS, 2 chunks, with async pull", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- async pull(controller) {
- controller.enqueue(textToExpect.substring(0, 100));
- await Promise.resolve();
- controller.enqueue(textToExpect.substring(100));
- await Promise.resolve();
- controller.close();
- },
- }),
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ async pull(controller) {
+ controller.enqueue(textToExpect.substring(0, 100));
+ await Promise.resolve();
+ controller.enqueue(textToExpect.substring(100));
+ await Promise.resolve();
+ controller.close();
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(await response.text()).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ );
});
it("text from JS, 10 chunks, with async pull", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(
- new ReadableStream({
- async pull(controller) {
- var remain = textToExpect;
- for (let i = 0; i < 10 && remain.length > 0; i++) {
- controller.enqueue(remain.substring(0, 100));
- remain = remain.substring(100);
- await new Promise((resolve) => queueMicrotask(resolve));
- }
-
- controller.enqueue(remain);
- controller.close();
- },
- }),
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(
+ new ReadableStream({
+ async pull(controller) {
+ var remain = textToExpect;
+ for (let i = 0; i < 10 && remain.length > 0; i++) {
+ controller.enqueue(remain.substring(0, 100));
+ remain = remain.substring(100);
+ await new Promise((resolve) => queueMicrotask(resolve));
+ }
+
+ controller.enqueue(remain);
+ controller.close();
+ },
+ }),
+ );
+ },
+ },
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
);
+ expect(await response.text()).toBe(textToExpect);
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ );
});
});
it("should work for a hello world", async () => {
- await runTest({
- fetch(req) {
- return new Response(`Hello, world!`);
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(`Hello, world!`);
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe("Hello, world!");
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe("Hello, world!");
+ },
+ );
});
it("should work for a blob", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(new Blob([textToExpect]));
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(new Blob([textToExpect]));
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
it("should work for a blob stream", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(new Blob([textToExpect]).stream());
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(new Blob([textToExpect]).stream());
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
it("should work for a file stream", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- fetch(req) {
- return new Response(file(fixture).stream());
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(file(fixture).stream());
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe(textToExpect);
+ },
+ );
});
it("fetch should work with headers", async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
- await runTest({
- fetch(req) {
- if (req.headers.get("X-Foo") !== "bar") {
- return new Response("X-Foo header not set", { status: 500 });
- }
- return new Response(file(fixture), {
- headers: { "X-Both-Ways": "1" },
+ await runTest(
+ {
+ fetch(req) {
+ if (req.headers.get("X-Foo") !== "bar") {
+ return new Response("X-Foo header not set", { status: 500 });
+ }
+ return new Response(file(fixture), {
+ headers: { "X-Both-Ways": "1" },
+ });
+ },
+ },
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`, {
+ headers: {
+ "X-Foo": "bar",
+ },
});
+ expect(response.status).toBe(200);
+ expect(response.headers.get("X-Both-Ways")).toBe("1");
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`, {
- headers: {
- "X-Foo": "bar",
- },
- });
- expect(response.status).toBe(200);
- expect(response.headers.get("X-Both-Ways")).toBe("1");
- });
+ );
});
it(`should work for a file ${count} times serial`, async () => {
const fixture = resolve(import.meta.dir, "./fetch.js.txt");
const textToExpect = readFileSync(fixture, "utf-8");
- await runTest({
- async fetch(req) {
- return new Response(file(fixture));
+ await runTest(
+ {
+ async fetch(req) {
+ return new Response(file(fixture));
+ },
},
- }, async (server) => {
- for (let i = 0; i < count; i++) {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- }
- });
+ async (server) => {
+ for (let i = 0; i < count; i++) {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
+ );
+ expect(await response.text()).toBe(textToExpect);
+ }
+ },
+ );
});
it(`should work for ArrayBuffer ${count} times serial`, async () => {
const textToExpect = "hello";
- await runTest({
- fetch(req) {
- return new Response(new TextEncoder().encode(textToExpect));
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(new TextEncoder().encode(textToExpect));
+ },
},
- }, async (server) => {
- for (let i = 0; i < count; i++) {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe(textToExpect);
- }
- });
+ async (server) => {
+ for (let i = 0; i < count; i++) {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
+ );
+ expect(await response.text()).toBe(textToExpect);
+ }
+ },
+ );
});
describe("parallel", () => {
it(`should work for text ${count} times in batches of 5`, async () => {
const textToExpect = "hello";
- await runTest({
- fetch(req) {
- return new Response(textToExpect);
- },
- }, async (server) => {
- for (let i = 0; i < count; ) {
- let responses = await Promise.all([
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- ]);
-
- for (let response of responses) {
- expect(await response.text()).toBe(textToExpect);
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(textToExpect);
+ },
+ },
+ async (server) => {
+ for (let i = 0; i < count; ) {
+ let responses = await Promise.all([
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ ]);
+
+ for (let response of responses) {
+ expect(await response.text()).toBe(textToExpect);
+ }
+ i += responses.length;
}
- i += responses.length;
- }
- });
+ },
+ );
});
it(`should work for Uint8Array ${count} times in batches of 5`, async () => {
const textToExpect = "hello";
- await runTest({
- fetch(req) {
- return new Response(new TextEncoder().encode(textToExpect));
+ await runTest(
+ {
+ fetch(req) {
+ return new Response(new TextEncoder().encode(textToExpect));
+ },
},
- }, async (server) => {
- for (let i = 0; i < count; ) {
- let responses = await Promise.all([
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- fetch(`http://${server.hostname}:${server.port}`),
- ]);
-
- for (let response of responses) {
- expect(await response.text()).toBe(textToExpect);
+ async (server) => {
+ for (let i = 0; i < count; ) {
+ let responses = await Promise.all([
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ fetch(`http://${server.hostname}:${server.port}`),
+ ]);
+
+ for (let response of responses) {
+ expect(await response.text()).toBe(textToExpect);
+ }
+ i += responses.length;
}
- i += responses.length;
- }
- });
+ },
+ );
});
});
it("should support reloading", async () => {
const first = (req) => new Response("first");
const second = (req) => new Response("second");
- await runTest({
- fetch: first,
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response.text()).toBe("first");
- server.reload({ fetch: second });
- const response2 = await fetch(`http://${server.hostname}:${server.port}`);
- expect(await response2.text()).toBe("second");
- });
+ await runTest(
+ {
+ fetch: first,
+ },
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response.text()).toBe("first");
+ server.reload({ fetch: second });
+ const response2 = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(await response2.text()).toBe("second");
+ },
+ );
});
describe("status code text", () => {
@@ -577,54 +681,68 @@ describe("status code text", () => {
for (let code in fixture) {
it(`should return ${code} ${fixture[code]}`, async () => {
- await runTest({
- fetch(req) {
- return new Response("hey", { status: +code });
+ await runTest(
+ {
+ fetch(req) {
+ return new Response("hey", { status: +code });
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(response.status).toBe(parseInt(code));
- expect(response.statusText).toBe(fixture[code]);
- });
+ async (server) => {
+ const response = await fetch(
+ `http://${server.hostname}:${server.port}`,
+ );
+ expect(response.status).toBe(parseInt(code));
+ expect(response.statusText).toBe(fixture[code]);
+ },
+ );
});
}
});
it("should support multiple Set-Cookie headers", async () => {
- await runTest({
- fetch(req) {
- return new Response("hello", {
- headers: [
- ["Another-Header", "1"],
- ["Set-Cookie", "foo=bar"],
- ["Set-Cookie", "baz=qux"],
- ],
- });
+ await runTest(
+ {
+ fetch(req) {
+ return new Response("hello", {
+ headers: [
+ ["Another-Header", "1"],
+ ["Set-Cookie", "foo=bar"],
+ ["Set-Cookie", "baz=qux"],
+ ],
+ });
+ },
},
- }, async (server) => {
- const response = await fetch(`http://${server.hostname}:${server.port}`);
- expect(response.headers.getAll("Set-Cookie")).toEqual(["foo=bar", "baz=qux"]);
- expect(response.headers.get("Set-Cookie")).toEqual("foo=bar, baz=qux");
-
- const cloned = response.clone().headers;
- expect(response.headers.getAll("Set-Cookie")).toEqual(["foo=bar", "baz=qux"]);
-
- response.headers.delete("Set-Cookie");
- expect(response.headers.getAll("Set-Cookie")).toEqual([]);
- response.headers.delete("Set-Cookie");
- expect(cloned.getAll("Set-Cookie")).toEqual(["foo=bar", "baz=qux"]);
- expect(new Headers(cloned).getAll("Set-Cookie")).toEqual([
- "foo=bar",
- "baz=qux",
- ]);
- });
+ async (server) => {
+ const response = await fetch(`http://${server.hostname}:${server.port}`);
+ expect(response.headers.getAll("Set-Cookie")).toEqual([
+ "foo=bar",
+ "baz=qux",
+ ]);
+ expect(response.headers.get("Set-Cookie")).toEqual("foo=bar, baz=qux");
+
+ const cloned = response.clone().headers;
+ expect(response.headers.getAll("Set-Cookie")).toEqual([
+ "foo=bar",
+ "baz=qux",
+ ]);
+
+ response.headers.delete("Set-Cookie");
+ expect(response.headers.getAll("Set-Cookie")).toEqual([]);
+ response.headers.delete("Set-Cookie");
+ expect(cloned.getAll("Set-Cookie")).toEqual(["foo=bar", "baz=qux"]);
+ expect(new Headers(cloned).getAll("Set-Cookie")).toEqual([
+ "foo=bar",
+ "baz=qux",
+ ]);
+ },
+ );
});
describe("should support Content-Range with Bun.file()", () => {
var server;
// this must be a big file so we can test potentially multiple chunks
// more than 65 KB
- const full = function() {
+ const full = (function () {
const fixture = resolve(import.meta.dir + "/fetch.js.txt");
const chunk = readFileSync(fixture);
var whole = new Uint8Array(chunk.byteLength * 128);
@@ -633,7 +751,7 @@ describe("should support Content-Range with Bun.file()", () => {
}
writeFileSync(fixture + ".big", whole);
return whole;
- }();
+ })();
const fixture = resolve(import.meta.dir + "/fetch.js.txt") + ".big";
const getServer = runTest.bind(null, {
fetch(req) {