diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile
index 033aec633d681a..2b5f944834560a 100644
--- a/.buildkite/Dockerfile
+++ b/.buildkite/Dockerfile
@@ -26,7 +26,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
wget curl git python3 python3-pip ninja-build \
software-properties-common apt-transport-https \
ca-certificates gnupg lsb-release unzip \
- libxml2-dev ruby ruby-dev bison gawk perl make golang \
+ libxml2-dev ruby ruby-dev bison gawk perl make golang ccache \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y gcc-13 g++-13 libgcc-13-dev libstdc++-13-dev \
@@ -35,7 +35,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh ${LLVM_VERSION} all \
- && rm llvm.sh
+ && rm llvm.sh \
+ && rm -rf /var/lib/apt/lists/*
RUN --mount=type=tmpfs,target=/tmp \
@@ -48,14 +49,6 @@ RUN --mount=type=tmpfs,target=/tmp \
wget -O /tmp/cmake.sh "$cmake_url" && \
sh /tmp/cmake.sh --skip-license --prefix=/usr
-RUN --mount=type=tmpfs,target=/tmp \
- sccache_version="0.12.0" && \
- arch=$(uname -m) && \
- sccache_url="https://github.com/mozilla/sccache/releases/download/v${sccache_version}/sccache-v${sccache_version}-${arch}-unknown-linux-musl.tar.gz" && \
- wget -O /tmp/sccache.tar.gz "$sccache_url" && \
- tar -xzf /tmp/sccache.tar.gz -C /tmp && \
- install -m755 /tmp/sccache-v${sccache_version}-${arch}-unknown-linux-musl/sccache /usr/local/bin
-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130 \
--slave /usr/bin/g++ g++ /usr/bin/g++-13 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 \
@@ -134,9 +127,7 @@ RUN ARCH=$(if [ "$TARGETARCH" = "arm64" ]; then echo "arm64"; else echo "amd64";
RUN mkdir -p /var/cache/buildkite-agent /var/log/buildkite-agent /var/run/buildkite-agent /etc/buildkite-agent /var/lib/buildkite-agent/cache/bun
# The following is necessary to configure buildkite to use a stable
-# checkout directory. sccache hashes absolute paths into its cache keys,
-# so if buildkite uses a different checkout path each time (which it does
-# by default), sccache will be useless.
+# checkout directory for ccache to be effective.
RUN mkdir -p -m 755 /var/lib/buildkite-agent/hooks && \
cat <<'EOF' > /var/lib/buildkite-agent/hooks/environment
#!/bin/sh
diff --git a/.gitignore b/.gitignore
index 4b95245f9c9ecb..528cf0fa5f4a9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
.ninja_deps
.ninja_log
.npm
+.npmrc
.npm.gz
.parcel-cache
.swcrc
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fe9a83f3faca7..f30ad577c1e06d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,15 +47,7 @@ include(SetupEsbuild)
include(SetupZig)
include(SetupRust)
-find_program(SCCACHE_PROGRAM sccache)
-if(SCCACHE_PROGRAM AND NOT DEFINED ENV{NO_SCCACHE})
- include(SetupSccache)
-else()
- find_program(CCACHE_PROGRAM ccache)
- if(CCACHE_PROGRAM)
- include(SetupCcache)
- endif()
-endif()
+include(SetupCcache)
# Generate dependency versions header
include(GenerateDependencyVersions)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 192ce5ad6393c9..750eb17a6255e5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,7 +23,7 @@ Using your system's package manager, install Bun's dependencies:
{% codetabs group="os" %}
```bash#macOS (Homebrew)
-$ brew install automake cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby sccache
+$ brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
```
```bash#Ubuntu/Debian
@@ -65,43 +65,28 @@ $ brew install bun
{% /codetabs %}
-### Optional: Install `sccache`
+### Optional: Install `ccache`
-sccache is used to cache compilation artifacts, significantly speeding up builds. It must be installed with S3 support:
+ccache is used to cache compilation artifacts, significantly speeding up builds:
```bash
# For macOS
-$ brew install sccache
+$ brew install ccache
-# For Linux. Note that the version in your package manager may not have S3 support.
-$ cargo install sccache --features=s3
-```
-
-This will install `sccache` with S3 support. Our build scripts will automatically detect and use `sccache` with our shared S3 cache. **Note**: Not all versions of `sccache` are compiled with S3 support, hence we recommend installing it via `cargo`.
-
-#### Registering AWS Credentials for `sccache` (Core Developers Only)
+# For Ubuntu/Debian
+$ sudo apt install ccache
-Core developers have write access to the shared S3 cache. To enable write access, you must log in with AWS credentials. The easiest way to do this is to use the [`aws` CLI](https://aws.amazon.com/cli/) and invoke [`aws configure` to provide your AWS security info](https://docs.aws.amazon.com/cli/latest/reference/configure/).
+# For Arch
+$ sudo pacman -S ccache
-The `cmake` scripts should automatically detect your AWS credentials from the environment or the `~/.aws/credentials` file.
+# For Fedora
+$ sudo dnf install ccache
-
- Logging in to the `aws` CLI
-
- 1. Install the AWS CLI by following [the official guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
- 2. Log in to your AWS account console. A team member should provide you with your credentials.
- 3. Click your name in the top right > Security credentials.
- 4. Scroll to "Access keys" and create a new access key.
- 5. Run `aws configure` in your terminal and provide the access key ID and secret access key when prompted.
-
-
-
- Common Issues You May Encounter
+# For openSUSE
+$ sudo zypper install ccache
+```
- - To confirm that the cache is being used, you can use the `sccache --show-stats` command right after a build. This will expose very useful statistics, including cache hits/misses.
- - If you have multiple AWS profiles configured, ensure that the correct profile is set in the `AWS_PROFILE` environment variable.
- - `sccache` follows a server-client model. If you run into weird issues where `sccache` refuses to use S3, even though you have AWS credentials configured, try killing any running `sccache` servers with `sccache --stop-server` and then re-running the build.
-
+Our build scripts will automatically detect and use `ccache` if available. You can check cache statistics with `ccache --show-stats`.
## Install LLVM
diff --git a/bench/snippets/array-of.js b/bench/snippets/array-of.js
new file mode 100644
index 00000000000000..51e0a47bd530e6
--- /dev/null
+++ b/bench/snippets/array-of.js
@@ -0,0 +1,335 @@
+import { bench, run } from "../runner.mjs";
+
+let sink;
+
+// Integers
+bench("int: Array.of(1,2,3,4,5)", () => {
+ sink = Array.of(1, 2, 3, 4, 5);
+});
+
+bench("int: Array.of(100 elements)", () => {
+ sink = Array.of(
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15,
+ 16,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23,
+ 24,
+ 25,
+ 26,
+ 27,
+ 28,
+ 29,
+ 30,
+ 31,
+ 32,
+ 33,
+ 34,
+ 35,
+ 36,
+ 37,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 46,
+ 47,
+ 48,
+ 49,
+ 50,
+ 51,
+ 52,
+ 53,
+ 54,
+ 55,
+ 56,
+ 57,
+ 58,
+ 59,
+ 60,
+ 61,
+ 62,
+ 63,
+ 64,
+ 65,
+ 66,
+ 67,
+ 68,
+ 69,
+ 70,
+ 71,
+ 72,
+ 73,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 82,
+ 83,
+ 84,
+ 85,
+ 86,
+ 87,
+ 88,
+ 89,
+ 90,
+ 91,
+ 92,
+ 93,
+ 94,
+ 95,
+ 96,
+ 97,
+ 98,
+ 99,
+ );
+});
+
+// Doubles
+bench("double: Array.of(1.1,2.2,3.3,4.4,5.5)", () => {
+ sink = Array.of(1.1, 2.2, 3.3, 4.4, 5.5);
+});
+
+bench("double: Array.of(100 elements)", () => {
+ sink = Array.of(
+ 0.1,
+ 1.1,
+ 2.1,
+ 3.1,
+ 4.1,
+ 5.1,
+ 6.1,
+ 7.1,
+ 8.1,
+ 9.1,
+ 10.1,
+ 11.1,
+ 12.1,
+ 13.1,
+ 14.1,
+ 15.1,
+ 16.1,
+ 17.1,
+ 18.1,
+ 19.1,
+ 20.1,
+ 21.1,
+ 22.1,
+ 23.1,
+ 24.1,
+ 25.1,
+ 26.1,
+ 27.1,
+ 28.1,
+ 29.1,
+ 30.1,
+ 31.1,
+ 32.1,
+ 33.1,
+ 34.1,
+ 35.1,
+ 36.1,
+ 37.1,
+ 38.1,
+ 39.1,
+ 40.1,
+ 41.1,
+ 42.1,
+ 43.1,
+ 44.1,
+ 45.1,
+ 46.1,
+ 47.1,
+ 48.1,
+ 49.1,
+ 50.1,
+ 51.1,
+ 52.1,
+ 53.1,
+ 54.1,
+ 55.1,
+ 56.1,
+ 57.1,
+ 58.1,
+ 59.1,
+ 60.1,
+ 61.1,
+ 62.1,
+ 63.1,
+ 64.1,
+ 65.1,
+ 66.1,
+ 67.1,
+ 68.1,
+ 69.1,
+ 70.1,
+ 71.1,
+ 72.1,
+ 73.1,
+ 74.1,
+ 75.1,
+ 76.1,
+ 77.1,
+ 78.1,
+ 79.1,
+ 80.1,
+ 81.1,
+ 82.1,
+ 83.1,
+ 84.1,
+ 85.1,
+ 86.1,
+ 87.1,
+ 88.1,
+ 89.1,
+ 90.1,
+ 91.1,
+ 92.1,
+ 93.1,
+ 94.1,
+ 95.1,
+ 96.1,
+ 97.1,
+ 98.1,
+ 99.1,
+ );
+});
+
+// Objects
+bench("object: Array.of(obj x5)", () => {
+ sink = Array.of({ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }, { a: 5 });
+});
+
+bench("object: Array.of(100 elements)", () => {
+ sink = Array.of(
+ { a: 0 },
+ { a: 1 },
+ { a: 2 },
+ { a: 3 },
+ { a: 4 },
+ { a: 5 },
+ { a: 6 },
+ { a: 7 },
+ { a: 8 },
+ { a: 9 },
+ { a: 10 },
+ { a: 11 },
+ { a: 12 },
+ { a: 13 },
+ { a: 14 },
+ { a: 15 },
+ { a: 16 },
+ { a: 17 },
+ { a: 18 },
+ { a: 19 },
+ { a: 20 },
+ { a: 21 },
+ { a: 22 },
+ { a: 23 },
+ { a: 24 },
+ { a: 25 },
+ { a: 26 },
+ { a: 27 },
+ { a: 28 },
+ { a: 29 },
+ { a: 30 },
+ { a: 31 },
+ { a: 32 },
+ { a: 33 },
+ { a: 34 },
+ { a: 35 },
+ { a: 36 },
+ { a: 37 },
+ { a: 38 },
+ { a: 39 },
+ { a: 40 },
+ { a: 41 },
+ { a: 42 },
+ { a: 43 },
+ { a: 44 },
+ { a: 45 },
+ { a: 46 },
+ { a: 47 },
+ { a: 48 },
+ { a: 49 },
+ { a: 50 },
+ { a: 51 },
+ { a: 52 },
+ { a: 53 },
+ { a: 54 },
+ { a: 55 },
+ { a: 56 },
+ { a: 57 },
+ { a: 58 },
+ { a: 59 },
+ { a: 60 },
+ { a: 61 },
+ { a: 62 },
+ { a: 63 },
+ { a: 64 },
+ { a: 65 },
+ { a: 66 },
+ { a: 67 },
+ { a: 68 },
+ { a: 69 },
+ { a: 70 },
+ { a: 71 },
+ { a: 72 },
+ { a: 73 },
+ { a: 74 },
+ { a: 75 },
+ { a: 76 },
+ { a: 77 },
+ { a: 78 },
+ { a: 79 },
+ { a: 80 },
+ { a: 81 },
+ { a: 82 },
+ { a: 83 },
+ { a: 84 },
+ { a: 85 },
+ { a: 86 },
+ { a: 87 },
+ { a: 88 },
+ { a: 89 },
+ { a: 90 },
+ { a: 91 },
+ { a: 92 },
+ { a: 93 },
+ { a: 94 },
+ { a: 95 },
+ { a: 96 },
+ { a: 97 },
+ { a: 98 },
+ { a: 99 },
+ );
+});
+
+await run();
diff --git a/bench/snippets/ipc-json-child.mjs b/bench/snippets/ipc-json-child.mjs
new file mode 100644
index 00000000000000..4807baa14c91ab
--- /dev/null
+++ b/bench/snippets/ipc-json-child.mjs
@@ -0,0 +1,4 @@
+// Child process for IPC benchmarks - echoes messages back to parent
+process.on("message", message => {
+ process.send(message);
+});
diff --git a/bench/snippets/ipc-json.mjs b/bench/snippets/ipc-json.mjs
new file mode 100644
index 00000000000000..2daa1cd59e62b4
--- /dev/null
+++ b/bench/snippets/ipc-json.mjs
@@ -0,0 +1,45 @@
+import { fork } from "node:child_process";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { bench, run } from "../runner.mjs";
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const childPath = path.join(__dirname, "ipc-json-child.mjs");
+
+const smallMessage = { type: "ping", id: 1 };
+const largeString = Buffer.alloc(10 * 1024 * 1024, "A").toString();
+const largeMessage = { type: "ping", id: 1, data: largeString };
+
+async function runBenchmark(message, count) {
+ let received = 0;
+ const { promise, resolve } = Promise.withResolvers();
+
+ const child = fork(childPath, [], {
+ stdio: ["ignore", "ignore", "ignore", "ipc"],
+ serialization: "json",
+ });
+
+ child.on("message", () => {
+ received++;
+ if (received >= count) {
+ resolve();
+ }
+ });
+
+ for (let i = 0; i < count; i++) {
+ child.send(message);
+ }
+
+ await promise;
+ child.kill();
+}
+
+bench("ipc json - small messages (1000 roundtrips)", async () => {
+ await runBenchmark(smallMessage, 1000);
+});
+
+bench("ipc json - 10MB messages (10 roundtrips)", async () => {
+ await runBenchmark(largeMessage, 10);
+});
+
+await run();
diff --git a/bench/snippets/response-json.mjs b/bench/snippets/response-json.mjs
index 2cd20523b6e0af..28cad6e6c78934 100644
--- a/bench/snippets/response-json.mjs
+++ b/bench/snippets/response-json.mjs
@@ -112,12 +112,40 @@ const obj = {
},
};
-bench("Response.json(obj)", async () => {
+const smallObj = { id: 1, name: "test" };
+
+const arrayObj = {
+ items: Array.from({ length: 100 }, (_, i) => ({ id: i, value: `item-${i}` })),
+};
+
+bench("Response.json(obj)", () => {
return Response.json(obj);
});
-bench("Response.json(obj).json()", async () => {
- return await Response.json(obj).json();
+bench("new Response(JSON.stringify(obj))", () => {
+ return new Response(JSON.stringify(obj), {
+ headers: { "Content-Type": "application/json" },
+ });
+});
+
+bench("Response.json(smallObj)", () => {
+ return Response.json(smallObj);
+});
+
+bench("new Response(JSON.stringify(smallObj))", () => {
+ return new Response(JSON.stringify(smallObj), {
+ headers: { "Content-Type": "application/json" },
+ });
+});
+
+bench("Response.json(arrayObj)", () => {
+ return Response.json(arrayObj);
+});
+
+bench("new Response(JSON.stringify(arrayObj))", () => {
+ return new Response(JSON.stringify(arrayObj), {
+ headers: { "Content-Type": "application/json" },
+ });
});
await run();
diff --git a/bench/snippets/string-includes.mjs b/bench/snippets/string-includes.mjs
new file mode 100644
index 00000000000000..daf912ecf126cc
--- /dev/null
+++ b/bench/snippets/string-includes.mjs
@@ -0,0 +1,34 @@
+import { bench, run } from "../runner.mjs";
+
+const shortStr = "The quick brown fox jumps over the lazy dog";
+const longStr = shortStr.repeat(100);
+
+bench("String.includes - short, hit (middle)", () => {
+ return shortStr.includes("jumps");
+});
+
+bench("String.includes - short, hit (start)", () => {
+ return shortStr.includes("The");
+});
+
+bench("String.includes - short, hit (end)", () => {
+ return shortStr.includes("dog");
+});
+
+bench("String.includes - short, miss", () => {
+ return shortStr.includes("cat");
+});
+
+bench("String.includes - long, hit (middle)", () => {
+ return longStr.includes("jumps");
+});
+
+bench("String.includes - long, miss", () => {
+ return longStr.includes("cat");
+});
+
+bench("String.includes - with position", () => {
+ return shortStr.includes("fox", 10);
+});
+
+await run();
diff --git a/cmake/tools/SetupBuildkite.cmake b/cmake/tools/SetupBuildkite.cmake
index e1d8b32cdeae63..367c9c8d3bef39 100644
--- a/cmake/tools/SetupBuildkite.cmake
+++ b/cmake/tools/SetupBuildkite.cmake
@@ -48,6 +48,9 @@ if(NOT BUILDKITE_BUILD_STATUS EQUAL 0)
endif()
file(READ ${BUILDKITE_BUILD_PATH}/build.json BUILDKITE_BUILD)
+# Escape backslashes so CMake doesn't interpret JSON escape sequences (e.g., \n in commit messages)
+string(REPLACE "\\" "\\\\" BUILDKITE_BUILD "${BUILDKITE_BUILD}")
+
string(JSON BUILDKITE_BUILD_UUID GET ${BUILDKITE_BUILD} id)
string(JSON BUILDKITE_JOBS GET ${BUILDKITE_BUILD} jobs)
string(JSON BUILDKITE_JOBS_COUNT LENGTH ${BUILDKITE_JOBS})
diff --git a/cmake/tools/SetupCcache.cmake b/cmake/tools/SetupCcache.cmake
index fc1e64aa96cfde..3e1982ca70c46d 100644
--- a/cmake/tools/SetupCcache.cmake
+++ b/cmake/tools/SetupCcache.cmake
@@ -5,18 +5,12 @@ if(NOT ENABLE_CCACHE OR CACHE_STRATEGY STREQUAL "none")
return()
endif()
-if (CI AND NOT APPLE)
- setenv(CCACHE_DISABLE 1)
- return()
-endif()
find_command(
VARIABLE
CCACHE_PROGRAM
COMMAND
ccache
- REQUIRED
- ${CI}
)
if(NOT CCACHE_PROGRAM)
diff --git a/cmake/tools/SetupSccache.cmake b/cmake/tools/SetupSccache.cmake
deleted file mode 100644
index cb4b5aa750ab66..00000000000000
--- a/cmake/tools/SetupSccache.cmake
+++ /dev/null
@@ -1,123 +0,0 @@
-# Setup sccache as the C and C++ compiler launcher to speed up builds by caching
-if(CACHE_STRATEGY STREQUAL "none")
- return()
-endif()
-
-set(SCCACHE_SHARED_CACHE_REGION "us-west-1")
-set(SCCACHE_SHARED_CACHE_BUCKET "bun-build-sccache-store")
-
-# Function to check if the system AWS credentials have access to the sccache S3 bucket.
-function(check_aws_credentials OUT_VAR)
- # Install dependencies first
- execute_process(
- COMMAND ${BUN_EXECUTABLE} install --frozen-lockfile
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/scripts/build-cache
- RESULT_VARIABLE INSTALL_EXIT_CODE
- OUTPUT_VARIABLE INSTALL_OUTPUT
- ERROR_VARIABLE INSTALL_ERROR
- )
-
- if(NOT INSTALL_EXIT_CODE EQUAL 0)
- message(FATAL_ERROR "Failed to install dependencies in scripts/build-cache\n"
- "Exit code: ${INSTALL_EXIT_CODE}\n"
- "Output: ${INSTALL_OUTPUT}\n"
- "Error: ${INSTALL_ERROR}")
- endif()
-
- # Check AWS credentials
- execute_process(
- COMMAND
- ${BUN_EXECUTABLE}
- run
- have-access.ts
- --bucket ${SCCACHE_SHARED_CACHE_BUCKET}
- --region ${SCCACHE_SHARED_CACHE_REGION}
- WORKING_DIRECTORY
- ${CMAKE_SOURCE_DIR}/scripts/build-cache
- RESULT_VARIABLE HAVE_ACCESS_EXIT_CODE
- )
-
- if(HAVE_ACCESS_EXIT_CODE EQUAL 0)
- set(HAS_CREDENTIALS TRUE)
- else()
- set(HAS_CREDENTIALS FALSE)
- endif()
-
- set(${OUT_VAR} ${HAS_CREDENTIALS} PARENT_SCOPE)
-endfunction()
-
-# Configure sccache to use the local cache only.
-function(sccache_configure_local_filesystem)
- unsetenv(SCCACHE_BUCKET)
- unsetenv(SCCACHE_REGION)
- setenv(SCCACHE_DIR "${CACHE_PATH}/sccache")
-endfunction()
-
-# Configure sccache to use the distributed cache (S3 + local).
-function(sccache_configure_distributed)
- setenv(SCCACHE_BUCKET "${SCCACHE_SHARED_CACHE_BUCKET}")
- setenv(SCCACHE_REGION "${SCCACHE_SHARED_CACHE_REGION}")
- setenv(SCCACHE_DIR "${CACHE_PATH}/sccache")
-endfunction()
-
-function(sccache_configure_environment_ci)
- if(CACHE_STRATEGY STREQUAL "auto" OR CACHE_STRATEGY STREQUAL "distributed")
- check_aws_credentials(HAS_AWS_CREDENTIALS)
- if(HAS_AWS_CREDENTIALS)
- sccache_configure_distributed()
- message(NOTICE "sccache: Using distributed cache strategy.")
- else()
- message(FATAL_ERROR "CI CACHE_STRATEGY is set to '${CACHE_STRATEGY}', but no valid AWS "
- "credentials were found. Note that 'auto' requires AWS credentials to access the shared "
- "cache in CI.")
- endif()
- elseif(CACHE_STRATEGY STREQUAL "local")
- # We disallow this because we want our CI runs to always used the shared cache to accelerate
- # builds.
- # none, distributed and auto are all okay.
- #
- # If local is configured, it's as good as "none", so this is probably user error.
- message(FATAL_ERROR "CI CACHE_STRATEGY is set to 'local', which is not allowed.")
- endif()
-endfunction()
-
-function(sccache_configure_environment_developer)
- # Local environments can use any strategy they like. S3 is set up in such a way so as to clean
- # itself from old entries automatically.
- if (CACHE_STRATEGY STREQUAL "auto" OR CACHE_STRATEGY STREQUAL "local")
- # In the local environment, we prioritize using the local cache. This is because sccache takes
- # into consideration the whole absolute path of the files being compiled, and it's very
- # unlikely users will have the same absolute paths on their local machines.
- sccache_configure_local_filesystem()
- message(NOTICE "sccache: Using local cache strategy.")
- elseif(CACHE_STRATEGY STREQUAL "distributed")
- check_aws_credentials(HAS_AWS_CREDENTIALS)
- if(HAS_AWS_CREDENTIALS)
- sccache_configure_distributed()
- message(NOTICE "sccache: Using distributed cache strategy.")
- else()
- message(FATAL_ERROR "CACHE_STRATEGY is set to 'distributed', but no valid AWS credentials "
- "were found.")
- endif()
- endif()
-endfunction()
-
-find_command(VARIABLE SCCACHE_PROGRAM COMMAND sccache REQUIRED ${CI})
-if(NOT SCCACHE_PROGRAM)
- message(WARNING "sccache not found. Your builds will be slower.")
- return()
-endif()
-
-set(SCCACHE_ARGS CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER)
-foreach(arg ${SCCACHE_ARGS})
- setx(${arg} ${SCCACHE_PROGRAM})
- list(APPEND CMAKE_ARGS -D${arg}=${${arg}})
-endforeach()
-
-setenv(SCCACHE_LOG "info")
-
-if (CI)
- sccache_configure_environment_ci()
-else()
- sccache_configure_environment_developer()
-endif()
diff --git a/cmake/tools/SetupWebKit.cmake b/cmake/tools/SetupWebKit.cmake
index 6ff1af55d826c6..6e2ce7d6774153 100644
--- a/cmake/tools/SetupWebKit.cmake
+++ b/cmake/tools/SetupWebKit.cmake
@@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use")
option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading")
if(NOT WEBKIT_VERSION)
- set(WEBKIT_VERSION 8400ec68b2649d7b95f10576ad648c3aa8a92b77)
+ set(WEBKIT_VERSION 863778130931e0081a688f48e8479b8ee61b9507)
endif()
string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX)
diff --git a/docs/pm/isolated-installs.mdx b/docs/pm/isolated-installs.mdx
index 49718d71bcb35a..7a18cee5eeabee 100644
--- a/docs/pm/isolated-installs.mdx
+++ b/docs/pm/isolated-installs.mdx
@@ -189,7 +189,7 @@ Isolated installs are conceptually similar to pnpm, so migration should be strai
```bash terminal icon="terminal"
# Remove pnpm files
-$ rm -rf node_modules pnpm-lock.yaml
+rm -rf node_modules pnpm-lock.yaml
# Install with Bun's isolated linker
bun install --linker isolated
diff --git a/docs/pm/npmrc.mdx b/docs/pm/npmrc.mdx
index bef86d5435063b..fb42aaafbbc3d3 100644
--- a/docs/pm/npmrc.mdx
+++ b/docs/pm/npmrc.mdx
@@ -72,6 +72,7 @@ The following options are supported:
- `username`
- `_password` (base64 encoded password)
- `_auth` (base64 encoded username:password, e.g. `btoa(username + ":" + password)`)
+- `email`
The equivalent `bunfig.toml` option is to add a key in [`install.scopes`](/runtime/bunfig#install-registry):
@@ -109,3 +110,136 @@ The equivalent `bunfig.toml` option is [`install.exact`](/runtime/bunfig#install
[install]
exact = true
```
+
+### `ignore-scripts`: Skip lifecycle scripts
+
+Prevents running lifecycle scripts during installation:
+
+```ini .npmrc icon="npm"
+ignore-scripts=true
+```
+
+This is equivalent to using the `--ignore-scripts` flag with `bun install`.
+
+### `dry-run`: Preview changes without installing
+
+Shows what would be installed without actually installing:
+
+```ini .npmrc icon="npm"
+dry-run=true
+```
+
+The equivalent `bunfig.toml` option is [`install.dryRun`](/runtime/bunfig#install-dryrun):
+
+```toml bunfig.toml icon="settings"
+[install]
+dryRun = true
+```
+
+### `cache`: Configure cache directory
+
+Set the cache directory path, or disable caching:
+
+```ini .npmrc icon="npm"
+# set a custom cache directory
+cache=/path/to/cache
+
+# or disable caching
+cache=false
+```
+
+The equivalent `bunfig.toml` option is [`install.cache`](/runtime/bunfig#install-cache):
+
+```toml bunfig.toml icon="settings"
+[install.cache]
+# set a custom cache directory
+dir = "/path/to/cache"
+
+# or disable caching
+disable = true
+```
+
+### `ca` and `cafile`: Configure CA certificates
+
+Configure custom CA certificates for registry connections:
+
+```ini .npmrc icon="npm"
+# single CA certificate
+ca="-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
+
+# multiple CA certificates
+ca[]="-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
+ca[]="-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
+
+# or specify a path to a CA file
+cafile=/path/to/ca-bundle.crt
+```
+
+### `omit` and `include`: Control dependency types
+
+Control which dependency types are installed:
+
+```ini .npmrc icon="npm"
+# omit dev dependencies
+omit=dev
+
+# omit multiple types
+omit[]=dev
+omit[]=optional
+
+# include specific types (overrides omit)
+include=dev
+```
+
+Valid values: `dev`, `peer`, `optional`
+
+### `install-strategy` and `node-linker`: Installation strategy
+
+Control how packages are installed in `node_modules`. Bun supports two different configuration options for compatibility with different package managers.
+
+**npm's `install-strategy`:**
+
+```ini .npmrc icon="npm"
+# flat node_modules structure (default)
+install-strategy=hoisted
+
+# symlinked structure
+install-strategy=linked
+```
+
+**pnpm/yarn's `node-linker`:**
+
+The `node-linker` option controls the installation mode. Bun supports values from both pnpm and yarn:
+
+| Value | Description | Accepted by |
+| -------------- | ----------------------------------------------- | ----------- |
+| `isolated` | Symlinked structure with isolated dependencies | pnpm |
+| `hoisted` | Flat node_modules structure | pnpm |
+| `pnpm` | Symlinked structure (same as `isolated`) | yarn |
+| `node-modules` | Flat node_modules structure (same as `hoisted`) | yarn |
+
+```ini .npmrc icon="npm"
+# symlinked/isolated mode
+node-linker=isolated
+node-linker=pnpm
+
+# flat/hoisted mode
+node-linker=hoisted
+node-linker=node-modules
+```
+
+### `public-hoist-pattern` and `hoist-pattern`: Control hoisting
+
+Control which packages are hoisted to the root `node_modules`:
+
+```ini .npmrc icon="npm"
+# packages matching this pattern will be hoisted to the root
+public-hoist-pattern=*eslint*
+
+# multiple patterns
+public-hoist-pattern[]=*eslint*
+public-hoist-pattern[]=*prettier*
+
+# control general hoisting behavior
+hoist-pattern=*
+```
diff --git a/docs/project/building-windows.mdx b/docs/project/building-windows.mdx
index 9a4a3ab2d77361..dc0b4836d3a011 100644
--- a/docs/project/building-windows.mdx
+++ b/docs/project/building-windows.mdx
@@ -14,7 +14,7 @@ It is strongly recommended to use [PowerShell 7 (`pwsh.exe`)](https://learn.micr
By default, running unverified scripts are blocked.
```ps1
-> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
+Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
```
### System Dependencies
@@ -22,7 +22,7 @@ By default, running unverified scripts are blocked.
Bun v1.1 or later. We use Bun to run it's own code generators.
```ps1
-> irm bun.sh/install.ps1 | iex
+irm bun.sh/install.ps1 | iex
```
[Visual Studio](https://visualstudio.microsoft.com) with the "Desktop Development with C++" workload. While installing, make sure to install Git as well, if Git for Windows is not already installed.
@@ -30,7 +30,7 @@ Bun v1.1 or later. We use Bun to run it's own code generators.
Visual Studio can be installed graphically using the wizard or through WinGet:
```ps1
-> winget install "Visual Studio Community 2022" --override "--add Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.Git " -s msstore
+winget install "Visual Studio Community 2022" --override "--add Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.Git " -s msstore
```
After Visual Studio, you need the following:
@@ -48,10 +48,10 @@ After Visual Studio, you need the following:
[Scoop](https://scoop.sh) can be used to install these remaining tools easily.
```ps1 Scoop
-> irm https://get.scoop.sh | iex
-> scoop install nodejs-lts go rust nasm ruby perl sccache
+irm https://get.scoop.sh | iex
+scoop install nodejs-lts go rust nasm ruby perl ccache
# scoop seems to be buggy if you install llvm and the rest at the same time
-> scoop install llvm@19.1.7
+scoop install llvm@19.1.7
```
@@ -63,19 +63,19 @@ After Visual Studio, you need the following:
If you intend on building WebKit locally (optional), you should install these packages:
```ps1 Scoop
-> scoop install make cygwin python
+scoop install make cygwin python
```
From here on out, it is **expected you use a PowerShell Terminal with `.\scripts\vs-shell.ps1` sourced**. This script is available in the Bun repository and can be loaded by executing it:
```ps1
-> .\scripts\vs-shell.ps1
+.\scripts\vs-shell.ps1
```
To verify, you can check for an MSVC-only command line such as `mt.exe`
```ps1
-> Get-Command mt
+Get-Command mt
```
@@ -86,16 +86,16 @@ To verify, you can check for an MSVC-only command line such as `mt.exe`
## Building
```ps1
-> bun run build
+bun run build
# after the initial `bun run build` you can use the following to build
-> ninja -Cbuild/debug
+ninja -Cbuild/debug
```
If this was successful, you should have a `bun-debug.exe` in the `build/debug` folder.
```ps1
-> .\build\debug\bun-debug.exe --revision
+.\build\debug\bun-debug.exe --revision
```
You should add this to `$Env:PATH`. The simplest way to do so is to open the start menu, type "Path", and then navigate the environment variables menu to add `C:\.....\bun\build\debug` to the user environment variable `PATH`. You should then restart your editor (if it does not update still, log out and log back in).
@@ -111,15 +111,15 @@ You can run the test suite either using `bun test ` or by using the wrappe
```ps1
# Setup
-> bun i --cwd packages\bun-internal-test
+bun i --cwd packages\bun-internal-test
# Run the entire test suite with reporter
# the package.json script "test" uses "build/debug/bun-debug.exe" by default
-> bun run test
+bun run test
# Run an individual test file:
-> bun-debug test node\fs
-> bun-debug test "C:\bun\test\js\bun\resolve\import-meta.test.js"
+bun-debug test node\fs
+bun-debug test "C:\bun\test\js\bun\resolve\import-meta.test.js"
```
## Troubleshooting
diff --git a/docs/project/contributing.mdx b/docs/project/contributing.mdx
index b645b005f164b4..36353feaa0a401 100644
--- a/docs/project/contributing.mdx
+++ b/docs/project/contributing.mdx
@@ -28,23 +28,23 @@ Using your system's package manager, install Bun's dependencies:
```bash macOS (Homebrew)
-$ brew install automake cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby sccache
+brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
```
```bash Ubuntu/Debian
-$ sudo apt install curl wget lsb-release software-properties-common cargo cmake git golang libtool ninja-build pkg-config rustc ruby-full xz-utils
+sudo apt install curl wget lsb-release software-properties-common cargo cmake git golang libtool ninja-build pkg-config rustc ruby-full xz-utils
```
```bash Arch
-$ sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config python rust sed unzip ruby
+sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config python rust sed unzip ruby
```
```bash Fedora
-$ sudo dnf install cargo clang19 llvm19 lld19 cmake git golang libtool ninja-build pkg-config rustc ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
+sudo dnf install cargo clang19 llvm19 lld19 cmake git golang libtool ninja-build pkg-config rustc ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
```
```bash openSUSE Tumbleweed
-$ sudo zypper install go cmake ninja automake git icu rustup && rustup toolchain install stable
+sudo zypper install go cmake ninja automake git icu rustup && rustup toolchain install stable
```
@@ -56,59 +56,42 @@ Before starting, you will need to already have a release build of Bun installed,
```bash Native
-$ curl -fsSL https://bun.com/install | bash
+curl -fsSL https://bun.com/install | bash
```
```bash npm
-$ npm install -g bun
+npm install -g bun
```
```bash Homebrew
-$ brew tap oven-sh/bun
-$ brew install bun
+brew tap oven-sh/bun
+brew install bun
```
-### Optional: Install `sccache`
+### Optional: Install `ccache`
-sccache is used to cache compilation artifacts, significantly speeding up builds. It must be installed with S3 support:
+ccache is used to cache compilation artifacts, significantly speeding up builds:
```bash
# For macOS
-$ brew install sccache
+brew install ccache
-# For Linux. Note that the version in your package manager may not have S3 support.
-$ cargo install sccache --features=s3
-```
-
-This will install `sccache` with S3 support. Our build scripts will automatically detect and use `sccache` with our shared S3 cache. **Note**: Not all versions of `sccache` are compiled with S3 support, hence we recommend installing it via `cargo`.
-
-#### Registering AWS Credentials for `sccache` (Core Developers Only)
-
-Core developers have write access to the shared S3 cache. To enable write access, you must log in with AWS credentials. The easiest way to do this is to use the [`aws` CLI](https://aws.amazon.com/cli/) and invoke [`aws configure` to provide your AWS security info](https://docs.aws.amazon.com/cli/latest/reference/configure/).
+# For Ubuntu/Debian
+sudo apt install ccache
-The `cmake` scripts should automatically detect your AWS credentials from the environment or the `~/.aws/credentials` file.
+# For Arch
+sudo pacman -S ccache
-
- Logging in to the `aws` CLI
+# For Fedora
+sudo dnf install ccache
- 1. Install the AWS CLI by following [the official guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
- 2. Log in to your AWS account console. A team member should provide you with your credentials.
- 3. Click your name in the top right > Security credentials.
- 4. Scroll to "Access keys" and create a new access key.
- 5. Run `aws configure` in your terminal and provide the access key ID and secret access key when prompted.
-
-
-
-
- Common Issues You May Encounter
-
- - To confirm that the cache is being used, you can use the `sccache --show-stats` command right after a build. This will expose very useful statistics, including cache hits/misses.
- - If you have multiple AWS profiles configured, ensure that the correct profile is set in the `AWS_PROFILE` environment variable.
- - `sccache` follows a server-client model. If you run into weird issues where `sccache` refuses to use S3, even though you have AWS credentials configured, try killing any running `sccache` servers with `sccache --stop-server` and then re-running the build.
+# For openSUSE
+sudo zypper install ccache
+```
-
+Our build scripts will automatically detect and use `ccache` if available. You can check cache statistics with `ccache --show-stats`.
## Install LLVM
@@ -117,24 +100,24 @@ Bun requires LLVM 19 (`clang` is part of LLVM). This version requirement is to m
```bash macOS (Homebrew)
-$ brew install llvm@19
+brew install llvm@19
```
```bash Ubuntu/Debian
-$ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu
-$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 19 all
+# LLVM has an automatic installation script that is compatible with all versions of Ubuntu
+wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 19 all
```
```bash Arch
-$ sudo pacman -S llvm clang lld
+sudo pacman -S llvm clang lld
```
```bash Fedora
-$ sudo dnf install llvm clang lld-devel
+sudo dnf install llvm clang lld-devel
```
```bash openSUSE Tumbleweed
-$ sudo zypper install clang19 lld19 llvm19
+sudo zypper install clang19 lld19 llvm19
```
@@ -144,7 +127,7 @@ If none of the above solutions apply, you will have to install it [manually](htt
Make sure Clang/LLVM 19 is in your path:
```bash
-$ which clang-19
+which clang-19
```
If not, run this to manually add it:
@@ -154,12 +137,12 @@ If not, run this to manually add it:
```bash macOS (Homebrew)
# use fish_add_path if you're using fish
# use path+="$(brew --prefix llvm@19)/bin" if you are using zsh
-$ export PATH="$(brew --prefix llvm@19)/bin:$PATH"
+export PATH="$(brew --prefix llvm@19)/bin:$PATH"
```
```bash Arch
# use fish_add_path if you're using fish
-$ export PATH="$PATH:/usr/lib/llvm19/bin"
+export PATH="$PATH:/usr/lib/llvm19/bin"
```
@@ -179,7 +162,7 @@ bun run build
The binary will be located at `./build/debug/bun-debug`. It is recommended to add this to your `$PATH`. To verify the build worked, let's print the version number on the development build of Bun.
```bash
-$ build/debug/bun-debug --version
+build/debug/bun-debug --version
x.y.z_debug
```
@@ -278,17 +261,17 @@ WebKit is not cloned by default (to save time and disk space). To clone and buil
```bash
# Clone WebKit into ./vendor/WebKit
-$ git clone https://github.com/oven-sh/WebKit vendor/WebKit
+git clone https://github.com/oven-sh/WebKit vendor/WebKit
# Check out the commit hash specified in `set(WEBKIT_VERSION )` in cmake/tools/SetupWebKit.cmake
-$ git -C vendor/WebKit checkout
+git -C vendor/WebKit checkout
# Make a debug build of JSC. This will output build artifacts in ./vendor/WebKit/WebKitBuild/Debug
# Optionally, you can use `bun run jsc:build` for a release build
bun run jsc:build:debug && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
# After an initial run of `make jsc-debug`, you can rebuild JSC with:
-$ cmake --build vendor/WebKit/WebKitBuild/Debug --target jsc && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
+cmake --build vendor/WebKit/WebKitBuild/Debug --target jsc && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
# Build bun with the local JSC build
bun run build:local
@@ -339,20 +322,20 @@ is not able to compile a simple test program.
To fix the error, we need to update the GCC version to 11. To do this, we'll need to check if the latest version is available in the distribution's official repositories or use a third-party repository that provides GCC 11 packages. Here are general steps:
```bash
-$ sudo apt update
-$ sudo apt install gcc-11 g++-11
+sudo apt update
+sudo apt install gcc-11 g++-11
# If the above command fails with `Unable to locate package gcc-11` we need
# to add the APT repository
-$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# Now run `apt install` again
-$ sudo apt install gcc-11 g++-11
+sudo apt install gcc-11 g++-11
```
Now, we need to set GCC 11 as the default compiler:
```bash
-$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
-$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
+sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
+sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
```
### libarchive
@@ -360,7 +343,7 @@ $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
If you see an error on macOS when compiling `libarchive`, run:
```bash
-$ brew install pkg-config
+brew install pkg-config
```
### macOS `library not found for -lSystem`
@@ -368,7 +351,7 @@ $ brew install pkg-config
If you see this error when compiling, run:
```bash
-$ xcode-select --install
+xcode-select --install
```
### Cannot find `libatomic.a`
diff --git a/docs/runtime/templating/create.mdx b/docs/runtime/templating/create.mdx
index 30c69b5c7b4a45..3d190da6fe02b3 100644
--- a/docs/runtime/templating/create.mdx
+++ b/docs/runtime/templating/create.mdx
@@ -19,7 +19,7 @@ If you're looking to create a brand new empty project, use [`bun init`](/runtime
`bun create ./MyComponent.tsx` turns an existing React component into a complete dev environment with hot reload and production builds in one command.
```bash
-$ bun create ./MyComponent.jsx # .tsx also supported
+bun create ./MyComponent.jsx # .tsx also supported
```
diff --git a/docs/style.css b/docs/style.css
index b84026277756bf..29b0d8d2f5cc48 100644
--- a/docs/style.css
+++ b/docs/style.css
@@ -149,25 +149,25 @@ div.callout .code-block {
margin-bottom: 0px;
}
-.code-block[language="shellscript"] code span.line:not(:empty):has(span)::before {
+[language="shellscript"] code span.line:not(:empty):has(span)::before {
content: "$ ";
color: #6272a4;
user-select: none;
}
-.code-block[language="shellscript"] code span.line:has(> span:first-child[style*="color: rgb(98, 114, 164)"])::before,
-.code-block[language="shellscript"] code span.line:has(> span:first-child[style*="#6272A4"])::before {
+[language="shellscript"] code span.line:has(> span:first-child[style*="color: rgb(98, 114, 164)"])::before,
+[language="shellscript"] code span.line:has(> span:first-child[style*="#6272A4"])::before {
content: "";
}
-.code-block[language="powershell"] code span.line:not(:empty):has(span)::before {
+[language="powershell"] code span.line:not(:empty):has(span)::before {
content: "> ";
color: #6272a4;
user-select: none;
}
-.code-block[language="powershell"] code span.line:has(> span:first-child[style*="color: rgb(98, 114, 164)"])::before,
-.code-block[language="powershell"] code span.line:has(> span:first-child[style*="#6272A4"])::before {
+[language="powershell"] code span.line:has(> span:first-child[style*="color: rgb(98, 114, 164)"])::before,
+[language="powershell"] code span.line:has(> span:first-child[style*="#6272A4"])::before {
content: "";
}
diff --git a/flake.nix b/flake.nix
index 43e12b391e3651..3fb940126895ae 100644
--- a/flake.nix
+++ b/flake.nix
@@ -40,7 +40,7 @@
pkgs.cmake # Expected: 3.30+ on nixos-unstable as of 2025-10
pkgs.ninja
pkgs.pkg-config
- pkgs.sccache
+ pkgs.ccache
# Compilers and toolchain - version pinned to LLVM 19
clang
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index e0135432b0ca7c..44a32429d5d4b9 100644
--- a/packages/bun-types/bun.d.ts
+++ b/packages/bun-types/bun.d.ts
@@ -1942,6 +1942,16 @@ declare module "bun" {
development?: boolean;
};
+ /**
+ * Enable React Fast Refresh transform.
+ *
+ * This adds the necessary code transformations for React Fast Refresh (hot module
+ * replacement for React components), but does not emit hot-module code itself.
+ *
+ * @default false
+ */
+ reactFastRefresh?: boolean;
+
outdir?: string;
}
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index 5164112d74a859..b4fba56480f6a7 100755
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -313,7 +313,7 @@ function Install-Build-Essentials {
strawberryperl `
mingw
Install-Rust
- Install-Sccache
+ Install-Ccache
# Needed to remap stack traces
Install-PdbAddr2line
Install-Llvm
@@ -376,8 +376,8 @@ function Install-Rust {
Add-To-Path "$rustPath\cargo\bin"
}
-function Install-Sccache {
- Install-Package sccache -Version "0.12.0"
+function Install-Ccache {
+ Install-Package ccache
}
function Install-PdbAddr2line {
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index c7be1336511994..5deb20a7c792e7 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Version: 25
+# Version: 26
# A script that installs the dependencies needed to build and test Bun.
# This should work on macOS and Linux with a POSIX shell.
@@ -1086,7 +1086,7 @@ install_build_essentials() {
install_osxcross
install_gcc
install_rust
- install_sccache
+ install_ccache
install_docker
}
@@ -1206,35 +1206,24 @@ install_gcc() {
execute_sudo ln -sf $(which llvm-symbolizer-$llvm_v) /usr/bin/llvm-symbolizer
}
-install_sccache() {
- if [ "$os" != "linux" ]; then
- error "Unsupported platform: $os"
- fi
-
- # Alright, look, this function is cobbled together but it's only as cobbled
- # together as this whole script is.
- #
- # For some reason, move_to_bin doesn't work here due to permissions so I'm
- # avoiding that function. It's also wrong with permissions and so on.
- #
- # Unfortunately, we cannot use install_packages since many package managers
- # don't compile `sccache` with S3 support.
- local opts=$-
- set -ef
-
- local sccache_http
- sccache_http="https://github.com/mozilla/sccache/releases/download/v0.12.0/sccache-v0.12.0-$(uname -m)-unknown-linux-musl.tar.gz"
-
- local file
- file=$(download_file "$sccache_http")
-
- local tmpdir
- tmpdir=$(mktemp -d)
-
- execute tar -xzf "$file" -C "$tmpdir"
- execute_sudo install -m755 "$tmpdir/sccache-v0.12.0-$(uname -m)-unknown-linux-musl/sccache" "/usr/local/bin"
-
- set +ef -"$opts"
+install_ccache() {
+ case "$pm" in
+ apt)
+ install_packages ccache
+ ;;
+ brew)
+ install_packages ccache
+ ;;
+ apk)
+ install_packages ccache
+ ;;
+ dnf|yum)
+ install_packages ccache
+ ;;
+ zypper)
+ install_packages ccache
+ ;;
+ esac
}
install_rust() {
@@ -1457,9 +1446,7 @@ create_buildkite_user() {
done
# The following is necessary to configure buildkite to use a stable
- # checkout directory. sccache hashes absolute paths into its cache keys,
- # so if buildkite uses a different checkout path each time (which it does
- # by default), sccache will be useless.
+ # checkout directory for ccache to be effective.
local opts=$-
set -ef
diff --git a/scripts/build-cache/bun.lock b/scripts/build-cache/bun.lock
deleted file mode 100644
index b822c8148378ef..00000000000000
--- a/scripts/build-cache/bun.lock
+++ /dev/null
@@ -1,249 +0,0 @@
-{
- "lockfileVersion": 1,
- "configVersion": 1,
- "workspaces": {
- "": {
- "dependencies": {
- "@aws-sdk/client-s3": "^3.928.0",
- "@aws-sdk/property-provider": "^3.374.0",
- },
- },
- },
- "packages": {
- "@aws-crypto/crc32": ["@aws-crypto/crc32@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg=="],
-
- "@aws-crypto/crc32c": ["@aws-crypto/crc32c@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag=="],
-
- "@aws-crypto/sha1-browser": ["@aws-crypto/sha1-browser@5.2.0", "", { "dependencies": { "@aws-crypto/supports-web-crypto": "^5.2.0", "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg=="],
-
- "@aws-crypto/sha256-browser": ["@aws-crypto/sha256-browser@5.2.0", "", { "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw=="],
-
- "@aws-crypto/sha256-js": ["@aws-crypto/sha256-js@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA=="],
-
- "@aws-crypto/supports-web-crypto": ["@aws-crypto/supports-web-crypto@5.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg=="],
-
- "@aws-crypto/util": ["@aws-crypto/util@5.2.0", "", { "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ=="],
-
- "@aws-sdk/client-s3": ["@aws-sdk/client-s3@3.928.0", "", { "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "3.928.0", "@aws-sdk/credential-provider-node": "3.928.0", "@aws-sdk/middleware-bucket-endpoint": "3.922.0", "@aws-sdk/middleware-expect-continue": "3.922.0", "@aws-sdk/middleware-flexible-checksums": "3.928.0", "@aws-sdk/middleware-host-header": "3.922.0", "@aws-sdk/middleware-location-constraint": "3.922.0", "@aws-sdk/middleware-logger": "3.922.0", "@aws-sdk/middleware-recursion-detection": "3.922.0", "@aws-sdk/middleware-sdk-s3": "3.928.0", "@aws-sdk/middleware-ssec": "3.922.0", "@aws-sdk/middleware-user-agent": "3.928.0", "@aws-sdk/region-config-resolver": "3.925.0", "@aws-sdk/signature-v4-multi-region": "3.928.0", "@aws-sdk/types": "3.922.0", "@aws-sdk/util-endpoints": "3.922.0", "@aws-sdk/util-user-agent-browser": "3.922.0", "@aws-sdk/util-user-agent-node": "3.928.0", "@aws-sdk/xml-builder": "3.921.0", "@smithy/config-resolver": "^4.4.2", "@smithy/core": "^3.17.2", "@smithy/eventstream-serde-browser": "^4.2.4", "@smithy/eventstream-serde-config-resolver": "^4.3.4", "@smithy/eventstream-serde-node": "^4.2.4", "@smithy/fetch-http-handler": "^5.3.5", "@smithy/hash-blob-browser": "^4.2.5", "@smithy/hash-node": "^4.2.4", "@smithy/hash-stream-node": "^4.2.4", "@smithy/invalid-dependency": "^4.2.4", "@smithy/md5-js": "^4.2.4", "@smithy/middleware-content-length": "^4.2.4", "@smithy/middleware-endpoint": "^4.3.6", "@smithy/middleware-retry": "^4.4.6", "@smithy/middleware-serde": "^4.2.4", "@smithy/middleware-stack": "^4.2.4", "@smithy/node-config-provider": "^4.3.4", "@smithy/node-http-handler": "^4.4.4", "@smithy/protocol-http": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/url-parser": "^4.2.4", "@smithy/util-base64": "^4.3.0", "@smithy/util-body-length-browser": "^4.2.0", "@smithy/util-body-length-node": "^4.2.1", "@smithy/util-defaults-mode-browser": "^4.3.5", "@smithy/util-defaults-mode-node": "^4.2.8", "@smithy/util-endpoints": "^3.2.4", "@smithy/util-middleware": "^4.2.4", "@smithy/util-retry": "^4.2.4", "@smithy/util-stream": "^4.5.5", "@smithy/util-utf8": "^4.2.0", "@smithy/util-waiter": "^4.2.4", "@smithy/uuid": "^1.1.0", "tslib": "^2.6.2" } }, "sha512-lXhhmcBjYa+ea0kRs00aq3WUwiXggwJkLwcMzOOsbW3CVYQaNpT7hztkfn2S6Qna7ETzd8M5+XZP+BmQRVE0Sg=="],
-
- "@aws-sdk/client-sso": ["@aws-sdk/client-sso@3.928.0", "", { "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "3.928.0", "@aws-sdk/middleware-host-header": "3.922.0", "@aws-sdk/middleware-logger": "3.922.0", "@aws-sdk/middleware-recursion-detection": "3.922.0", "@aws-sdk/middleware-user-agent": "3.928.0", "@aws-sdk/region-config-resolver": "3.925.0", "@aws-sdk/types": "3.922.0", "@aws-sdk/util-endpoints": "3.922.0", "@aws-sdk/util-user-agent-browser": "3.922.0", "@aws-sdk/util-user-agent-node": "3.928.0", "@smithy/config-resolver": "^4.4.2", "@smithy/core": "^3.17.2", "@smithy/fetch-http-handler": "^5.3.5", "@smithy/hash-node": "^4.2.4", "@smithy/invalid-dependency": "^4.2.4", "@smithy/middleware-content-length": "^4.2.4", "@smithy/middleware-endpoint": "^4.3.6", "@smithy/middleware-retry": "^4.4.6", "@smithy/middleware-serde": "^4.2.4", "@smithy/middleware-stack": "^4.2.4", "@smithy/node-config-provider": "^4.3.4", "@smithy/node-http-handler": "^4.4.4", "@smithy/protocol-http": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/url-parser": "^4.2.4", "@smithy/util-base64": "^4.3.0", "@smithy/util-body-length-browser": "^4.2.0", "@smithy/util-body-length-node": "^4.2.1", "@smithy/util-defaults-mode-browser": "^4.3.5", "@smithy/util-defaults-mode-node": "^4.2.8", "@smithy/util-endpoints": "^3.2.4", "@smithy/util-middleware": "^4.2.4", "@smithy/util-retry": "^4.2.4", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Efenb8zV2fJJDXmp2NE4xj8Ymhp4gVJCkQ6ixhdrpfQXgd2PODO7a20C2+BhFM6aGmN3m6XWYJ64ZyhXF4pAyQ=="],
-
- "@aws-sdk/core": ["@aws-sdk/core@3.928.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@aws-sdk/xml-builder": "3.921.0", "@smithy/core": "^3.17.2", "@smithy/node-config-provider": "^4.3.4", "@smithy/property-provider": "^4.2.4", "@smithy/protocol-http": "^5.3.4", "@smithy/signature-v4": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/util-base64": "^4.3.0", "@smithy/util-middleware": "^4.2.4", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-e28J2uKjy2uub4u41dNnmzAu0AN3FGB+LRcLN2Qnwl9Oq3kIcByl5sM8ZD+vWpNG+SFUrUasBCq8cMnHxwXZ4w=="],
-
- "@aws-sdk/credential-provider-env": ["@aws-sdk/credential-provider-env@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/property-provider": "^4.2.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-tB8F9Ti0/NFyFVQX8UQtgRik88evtHpyT6WfXOB4bAY6lEnEHA0ubJZmk9y+aUeoE+OsGLx70dC3JUsiiCPJkQ=="],
-
- "@aws-sdk/credential-provider-http": ["@aws-sdk/credential-provider-http@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/fetch-http-handler": "^5.3.5", "@smithy/node-http-handler": "^4.4.4", "@smithy/property-provider": "^4.2.4", "@smithy/protocol-http": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/util-stream": "^4.5.5", "tslib": "^2.6.2" } }, "sha512-67ynC/8UW9Y8Gn1ZZtC3OgcQDGWrJelHmkbgpmmxYUrzVhp+NINtz3wiTzrrBFhPH/8Uy6BxvhMfXhn0ptcMEQ=="],
-
- "@aws-sdk/credential-provider-ini": ["@aws-sdk/credential-provider-ini@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/credential-provider-env": "3.928.0", "@aws-sdk/credential-provider-http": "3.928.0", "@aws-sdk/credential-provider-process": "3.928.0", "@aws-sdk/credential-provider-sso": "3.928.0", "@aws-sdk/credential-provider-web-identity": "3.928.0", "@aws-sdk/nested-clients": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/credential-provider-imds": "^4.2.4", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-WVWYyj+jox6mhKYp11mu8x1B6Xa2sLbXFHAv5K3Jg8CHvXYpePgTcYlCljq3d4XHC4Jl4nCcsdMtBahSpU9bAA=="],
-
- "@aws-sdk/credential-provider-node": ["@aws-sdk/credential-provider-node@3.928.0", "", { "dependencies": { "@aws-sdk/credential-provider-env": "3.928.0", "@aws-sdk/credential-provider-http": "3.928.0", "@aws-sdk/credential-provider-ini": "3.928.0", "@aws-sdk/credential-provider-process": "3.928.0", "@aws-sdk/credential-provider-sso": "3.928.0", "@aws-sdk/credential-provider-web-identity": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/credential-provider-imds": "^4.2.4", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-SdXVjxZOIXefIR/NJx+lyXOrn4m0ScTAU2JXpLsFCkW2Cafo6vTqHUghyO8vak/XQ8PpPqpLXVpGbAYFuIPW6Q=="],
-
- "@aws-sdk/credential-provider-process": ["@aws-sdk/credential-provider-process@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-XL0juran8yhqwn0mreV+NJeHJOkcRBaExsvVn9fXWW37A4gLh4esSJxM2KbSNh0t+/Bk3ehBI5sL9xad+yRDuw=="],
-
- "@aws-sdk/credential-provider-sso": ["@aws-sdk/credential-provider-sso@3.928.0", "", { "dependencies": { "@aws-sdk/client-sso": "3.928.0", "@aws-sdk/core": "3.928.0", "@aws-sdk/token-providers": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-md/y+ePDsO1zqPJrsOyPs4ciKmdpqLL7B0dln1NhqZPnKIS5IBfTqZJ5tJ9eTezqc7Tn4Dbg6HiuemcGvZTeFA=="],
-
- "@aws-sdk/credential-provider-web-identity": ["@aws-sdk/credential-provider-web-identity@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/nested-clients": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-rd97nLY5e/nGOr73ZfsXD+H44iZ9wyGZTKt/2QkiBN3hot/idhgT9+XHsWhRi+o/dThQbpL8RkpAnpF+0ZGthw=="],
-
- "@aws-sdk/middleware-bucket-endpoint": ["@aws-sdk/middleware-bucket-endpoint@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@aws-sdk/util-arn-parser": "3.893.0", "@smithy/node-config-provider": "^4.3.4", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "@smithy/util-config-provider": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Dpr2YeOaLFqt3q1hocwBesynE3x8/dXZqXZRuzSX/9/VQcwYBFChHAm4mTAl4zuvArtDbLrwzWSxmOWYZGtq5w=="],
-
- "@aws-sdk/middleware-expect-continue": ["@aws-sdk/middleware-expect-continue@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-xmnLWMtmHJHJBupSWMUEW1gyxuRIeQ1Ov2xa8Tqq77fPr4Ft2AluEwiDMaZIMHoAvpxWKEEt9Si59Li7GIA+bQ=="],
-
- "@aws-sdk/middleware-flexible-checksums": ["@aws-sdk/middleware-flexible-checksums@3.928.0", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@aws-crypto/crc32c": "5.2.0", "@aws-crypto/util": "5.2.0", "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/is-array-buffer": "^4.2.0", "@smithy/node-config-provider": "^4.3.4", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "@smithy/util-middleware": "^4.2.4", "@smithy/util-stream": "^4.5.5", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-9+aCRt7teItSIMbnGvOY+FhtJnW2ZBUbfD+ug29a/ZbobDfTwmtrmtgEIWdXryFaRbT03HHfaJ3a++lTw4osuw=="],
-
- "@aws-sdk/middleware-host-header": ["@aws-sdk/middleware-host-header@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-HPquFgBnq/KqKRVkiuCt97PmWbKtxQ5iUNLEc6FIviqOoZTmaYG3EDsIbuFBz9C4RHJU4FKLmHL2bL3FEId6AA=="],
-
- "@aws-sdk/middleware-location-constraint": ["@aws-sdk/middleware-location-constraint@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-T4iqd7WQ2DDjCH/0s50mnhdoX+IJns83ZE+3zj9IDlpU0N2aq8R91IG890qTfYkUEdP9yRm0xir/CNed+v6Dew=="],
-
- "@aws-sdk/middleware-logger": ["@aws-sdk/middleware-logger@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-AkvYO6b80FBm5/kk2E636zNNcNgjztNNUxpqVx+huyGn9ZqGTzS4kLqW2hO6CBe5APzVtPCtiQsXL24nzuOlAg=="],
-
- "@aws-sdk/middleware-recursion-detection": ["@aws-sdk/middleware-recursion-detection@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@aws/lambda-invoke-store": "^0.1.1", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-TtSCEDonV/9R0VhVlCpxZbp/9sxQvTTRKzIf8LxW3uXpby6Wl8IxEciBJlxmSkoqxh542WRcko7NYODlvL/gDA=="],
-
- "@aws-sdk/middleware-sdk-s3": ["@aws-sdk/middleware-sdk-s3@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@aws-sdk/util-arn-parser": "3.893.0", "@smithy/core": "^3.17.2", "@smithy/node-config-provider": "^4.3.4", "@smithy/protocol-http": "^5.3.4", "@smithy/signature-v4": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/util-config-provider": "^4.2.0", "@smithy/util-middleware": "^4.2.4", "@smithy/util-stream": "^4.5.5", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-LTkjS6cpJ2PEtsottTKq7JxZV0oH+QJ12P/dGNPZL4URayjEMBVR/dp4zh835X/FPXzijga3sdotlIKzuFy9FA=="],
-
- "@aws-sdk/middleware-ssec": ["@aws-sdk/middleware-ssec@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-eHvSJZTSRJO+/tjjGD6ocnPc8q9o3m26+qbwQTu/4V6yOJQ1q+xkDZNqwJQphL+CodYaQ7uljp8g1Ji/AN3D9w=="],
-
- "@aws-sdk/middleware-user-agent": ["@aws-sdk/middleware-user-agent@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/types": "3.922.0", "@aws-sdk/util-endpoints": "3.922.0", "@smithy/core": "^3.17.2", "@smithy/protocol-http": "^5.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-ESvcfLx5PtpdUM3ptCwb80toBTd3y5I4w5jaeOPHihiZr7jkRLE/nsaCKzlqscPs6UQ8xI0maav04JUiTskcHw=="],
-
- "@aws-sdk/nested-clients": ["@aws-sdk/nested-clients@3.928.0", "", { "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "3.928.0", "@aws-sdk/middleware-host-header": "3.922.0", "@aws-sdk/middleware-logger": "3.922.0", "@aws-sdk/middleware-recursion-detection": "3.922.0", "@aws-sdk/middleware-user-agent": "3.928.0", "@aws-sdk/region-config-resolver": "3.925.0", "@aws-sdk/types": "3.922.0", "@aws-sdk/util-endpoints": "3.922.0", "@aws-sdk/util-user-agent-browser": "3.922.0", "@aws-sdk/util-user-agent-node": "3.928.0", "@smithy/config-resolver": "^4.4.2", "@smithy/core": "^3.17.2", "@smithy/fetch-http-handler": "^5.3.5", "@smithy/hash-node": "^4.2.4", "@smithy/invalid-dependency": "^4.2.4", "@smithy/middleware-content-length": "^4.2.4", "@smithy/middleware-endpoint": "^4.3.6", "@smithy/middleware-retry": "^4.4.6", "@smithy/middleware-serde": "^4.2.4", "@smithy/middleware-stack": "^4.2.4", "@smithy/node-config-provider": "^4.3.4", "@smithy/node-http-handler": "^4.4.4", "@smithy/protocol-http": "^5.3.4", "@smithy/smithy-client": "^4.9.2", "@smithy/types": "^4.8.1", "@smithy/url-parser": "^4.2.4", "@smithy/util-base64": "^4.3.0", "@smithy/util-body-length-browser": "^4.2.0", "@smithy/util-body-length-node": "^4.2.1", "@smithy/util-defaults-mode-browser": "^4.3.5", "@smithy/util-defaults-mode-node": "^4.2.8", "@smithy/util-endpoints": "^3.2.4", "@smithy/util-middleware": "^4.2.4", "@smithy/util-retry": "^4.2.4", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-kXzfJkq2cD65KAHDe4hZCsnxcGGEWD5pjHqcZplwG4VFMa/iVn/mWrUY9QdadD2GBpXFNQbgOiKG3U2NkKu+4Q=="],
-
- "@aws-sdk/property-provider": ["@aws-sdk/property-provider@3.374.0", "", { "dependencies": { "@smithy/property-provider": "^1.0.1", "tslib": "^2.5.0" } }, "sha512-UvsRnRtLD3g0tPMuiILJiGT9PIg4tgU3coRO4s+bAuT29mUiuViDAQB8DYPgaOtqA4qNFiWose+AMCpdxlOhRA=="],
-
- "@aws-sdk/region-config-resolver": ["@aws-sdk/region-config-resolver@3.925.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/config-resolver": "^4.4.2", "@smithy/node-config-provider": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-FOthcdF9oDb1pfQBRCfWPZhJZT5wqpvdAS5aJzB1WDZ+6EuaAhLzLH/fW1slDunIqq1PSQGG3uSnVglVVOvPHQ=="],
-
- "@aws-sdk/signature-v4-multi-region": ["@aws-sdk/signature-v4-multi-region@3.928.0", "", { "dependencies": { "@aws-sdk/middleware-sdk-s3": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/protocol-http": "^5.3.4", "@smithy/signature-v4": "^5.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-1+Ic8+MyqQy+OE6QDoQKVCIcSZO+ETmLLLpVS5yu0fihBU85B5HHU7iaKX1qX7lEaGPMpSN/mbHW0VpyQ0Xqaw=="],
-
- "@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.928.0", "", { "dependencies": { "@aws-sdk/core": "3.928.0", "@aws-sdk/nested-clients": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/property-provider": "^4.2.4", "@smithy/shared-ini-file-loader": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-533NpTdUJNDi98zBwRp4ZpZoqULrAVfc0YgIy+8AZHzk0v7N+v59O0d2Du3YO6zN4VU8HU8766DgKiyEag6Dzg=="],
-
- "@aws-sdk/types": ["@aws-sdk/types@3.922.0", "", { "dependencies": { "@smithy/types": "^4.8.1", "tslib": "^2.6.2" } }, "sha512-eLA6XjVobAUAMivvM7DBL79mnHyrm+32TkXNWZua5mnxF+6kQCfblKKJvxMZLGosO53/Ex46ogim8IY5Nbqv2w=="],
-
- "@aws-sdk/util-arn-parser": ["@aws-sdk/util-arn-parser@3.893.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-u8H4f2Zsi19DGnwj5FSZzDMhytYF/bCh37vAtBsn3cNDL3YG578X5oc+wSX54pM3tOxS+NY7tvOAo52SW7koUA=="],
-
- "@aws-sdk/util-endpoints": ["@aws-sdk/util-endpoints@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/types": "^4.8.1", "@smithy/url-parser": "^4.2.4", "@smithy/util-endpoints": "^3.2.4", "tslib": "^2.6.2" } }, "sha512-4ZdQCSuNMY8HMlR1YN4MRDdXuKd+uQTeKIr5/pIM+g3TjInZoj8imvXudjcrFGA63UF3t92YVTkBq88mg58RXQ=="],
-
- "@aws-sdk/util-locate-window": ["@aws-sdk/util-locate-window@3.893.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg=="],
-
- "@aws-sdk/util-user-agent-browser": ["@aws-sdk/util-user-agent-browser@3.922.0", "", { "dependencies": { "@aws-sdk/types": "3.922.0", "@smithy/types": "^4.8.1", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "sha512-qOJAERZ3Plj1st7M4Q5henl5FRpE30uLm6L9edZqZXGR6c7ry9jzexWamWVpQ4H4xVAVmiO9dIEBAfbq4mduOA=="],
-
- "@aws-sdk/util-user-agent-node": ["@aws-sdk/util-user-agent-node@3.928.0", "", { "dependencies": { "@aws-sdk/middleware-user-agent": "3.928.0", "@aws-sdk/types": "3.922.0", "@smithy/node-config-provider": "^4.3.4", "@smithy/types": "^4.8.1", "tslib": "^2.6.2" }, "peerDependencies": { "aws-crt": ">=1.0.0" }, "optionalPeers": ["aws-crt"] }, "sha512-s0jP67nQLLWVWfBtqTkZUkSWK5e6OI+rs+wFya2h9VLyWBFir17XSDI891s8HZKIVCEl8eBrup+hhywm4nsIAA=="],
-
- "@aws-sdk/xml-builder": ["@aws-sdk/xml-builder@3.921.0", "", { "dependencies": { "@smithy/types": "^4.8.1", "fast-xml-parser": "5.2.5", "tslib": "^2.6.2" } }, "sha512-LVHg0jgjyicKKvpNIEMXIMr1EBViESxcPkqfOlT+X1FkmUMTNZEEVF18tOJg4m4hV5vxtkWcqtr4IEeWa1C41Q=="],
-
- "@aws/lambda-invoke-store": ["@aws/lambda-invoke-store@0.1.1", "", {}, "sha512-RcLam17LdlbSOSp9VxmUu1eI6Mwxp+OwhD2QhiSNmNCzoDb0EeUXTD2n/WbcnrAYMGlmf05th6QYq23VqvJqpA=="],
-
- "@smithy/abort-controller": ["@smithy/abort-controller@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA=="],
-
- "@smithy/chunked-blob-reader": ["@smithy/chunked-blob-reader@5.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA=="],
-
- "@smithy/chunked-blob-reader-native": ["@smithy/chunked-blob-reader-native@4.2.1", "", { "dependencies": { "@smithy/util-base64": "^4.3.0", "tslib": "^2.6.2" } }, "sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ=="],
-
- "@smithy/config-resolver": ["@smithy/config-resolver@4.4.3", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.5", "@smithy/types": "^4.9.0", "@smithy/util-config-provider": "^4.2.0", "@smithy/util-endpoints": "^3.2.5", "@smithy/util-middleware": "^4.2.5", "tslib": "^2.6.2" } }, "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw=="],
-
- "@smithy/core": ["@smithy/core@3.18.0", "", { "dependencies": { "@smithy/middleware-serde": "^4.2.5", "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "@smithy/util-base64": "^4.3.0", "@smithy/util-body-length-browser": "^4.2.0", "@smithy/util-middleware": "^4.2.5", "@smithy/util-stream": "^4.5.6", "@smithy/util-utf8": "^4.2.0", "@smithy/uuid": "^1.1.0", "tslib": "^2.6.2" } }, "sha512-vGSDXOJFZgOPTatSI1ly7Gwyy/d/R9zh2TO3y0JZ0uut5qQ88p9IaWaZYIWSSqtdekNM4CGok/JppxbAff4KcQ=="],
-
- "@smithy/credential-provider-imds": ["@smithy/credential-provider-imds@4.2.5", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.5", "@smithy/property-provider": "^4.2.5", "@smithy/types": "^4.9.0", "@smithy/url-parser": "^4.2.5", "tslib": "^2.6.2" } }, "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ=="],
-
- "@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.5", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.9.0", "@smithy/util-hex-encoding": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA=="],
-
- "@smithy/eventstream-serde-browser": ["@smithy/eventstream-serde-browser@4.2.5", "", { "dependencies": { "@smithy/eventstream-serde-universal": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-HohfmCQZjppVnKX2PnXlf47CW3j92Ki6T/vkAT2DhBR47e89pen3s4fIa7otGTtrVxmj7q+IhH0RnC5kpR8wtw=="],
-
- "@smithy/eventstream-serde-config-resolver": ["@smithy/eventstream-serde-config-resolver@4.3.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-ibjQjM7wEXtECiT6my1xfiMH9IcEczMOS6xiCQXoUIYSj5b1CpBbJ3VYbdwDy8Vcg5JHN7eFpOCGk8nyZAltNQ=="],
-
- "@smithy/eventstream-serde-node": ["@smithy/eventstream-serde-node@4.2.5", "", { "dependencies": { "@smithy/eventstream-serde-universal": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-+elOuaYx6F2H6x1/5BQP5ugv12nfJl66GhxON8+dWVUEDJ9jah/A0tayVdkLRP0AeSac0inYkDz5qBFKfVp2Gg=="],
-
- "@smithy/eventstream-serde-universal": ["@smithy/eventstream-serde-universal@4.2.5", "", { "dependencies": { "@smithy/eventstream-codec": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-G9WSqbST45bmIFaeNuP/EnC19Rhp54CcVdX9PDL1zyEB514WsDVXhlyihKlGXnRycmHNmVv88Bvvt4EYxWef/Q=="],
-
- "@smithy/fetch-http-handler": ["@smithy/fetch-http-handler@5.3.6", "", { "dependencies": { "@smithy/protocol-http": "^5.3.5", "@smithy/querystring-builder": "^4.2.5", "@smithy/types": "^4.9.0", "@smithy/util-base64": "^4.3.0", "tslib": "^2.6.2" } }, "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg=="],
-
- "@smithy/hash-blob-browser": ["@smithy/hash-blob-browser@4.2.6", "", { "dependencies": { "@smithy/chunked-blob-reader": "^5.2.0", "@smithy/chunked-blob-reader-native": "^4.2.1", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8P//tA8DVPk+3XURk2rwcKgYwFvwGwmJH/wJqQiSKwXZtf/LiZK+hbUZmPj/9KzM+OVSwe4o85KTp5x9DUZTjw=="],
-
- "@smithy/hash-node": ["@smithy/hash-node@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "@smithy/util-buffer-from": "^4.2.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA=="],
-
- "@smithy/hash-stream-node": ["@smithy/hash-stream-node@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-6+do24VnEyvWcGdHXomlpd0m8bfZePpUKBy7m311n+JuRwug8J4dCanJdTymx//8mi0nlkflZBvJe+dEO/O12Q=="],
-
- "@smithy/invalid-dependency": ["@smithy/invalid-dependency@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A=="],
-
- "@smithy/is-array-buffer": ["@smithy/is-array-buffer@4.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ=="],
-
- "@smithy/md5-js": ["@smithy/md5-js@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Bt6jpSTMWfjCtC0s79gZ/WZ1w90grfmopVOWqkI2ovhjpD5Q2XRXuecIPB9689L2+cCySMbaXDhBPU56FKNDNg=="],
-
- "@smithy/middleware-content-length": ["@smithy/middleware-content-length@4.2.5", "", { "dependencies": { "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A=="],
-
- "@smithy/middleware-endpoint": ["@smithy/middleware-endpoint@4.3.7", "", { "dependencies": { "@smithy/core": "^3.18.0", "@smithy/middleware-serde": "^4.2.5", "@smithy/node-config-provider": "^4.3.5", "@smithy/shared-ini-file-loader": "^4.4.0", "@smithy/types": "^4.9.0", "@smithy/url-parser": "^4.2.5", "@smithy/util-middleware": "^4.2.5", "tslib": "^2.6.2" } }, "sha512-i8Mi8OuY6Yi82Foe3iu7/yhBj1HBRoOQwBSsUNYglJTNSFaWYTNM2NauBBs/7pq2sqkLRqeUXA3Ogi2utzpUlQ=="],
-
- "@smithy/middleware-retry": ["@smithy/middleware-retry@4.4.7", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.5", "@smithy/protocol-http": "^5.3.5", "@smithy/service-error-classification": "^4.2.5", "@smithy/smithy-client": "^4.9.3", "@smithy/types": "^4.9.0", "@smithy/util-middleware": "^4.2.5", "@smithy/util-retry": "^4.2.5", "@smithy/uuid": "^1.1.0", "tslib": "^2.6.2" } }, "sha512-E7Vc6WHCHlzDRTx1W0jZ6J1L6ziEV0PIWcUdmfL4y+c8r7WYr6I+LkQudaD8Nfb7C5c4P3SQ972OmXHtv6m/OA=="],
-
- "@smithy/middleware-serde": ["@smithy/middleware-serde@4.2.5", "", { "dependencies": { "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-La1ldWTJTZ5NqQyPqnCNeH9B+zjFhrNoQIL1jTh4zuqXRlmXhxYHhMtI1/92OlnoAtp6JoN7kzuwhWoXrBwPqg=="],
-
- "@smithy/middleware-stack": ["@smithy/middleware-stack@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ=="],
-
- "@smithy/node-config-provider": ["@smithy/node-config-provider@4.3.5", "", { "dependencies": { "@smithy/property-provider": "^4.2.5", "@smithy/shared-ini-file-loader": "^4.4.0", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg=="],
-
- "@smithy/node-http-handler": ["@smithy/node-http-handler@4.4.5", "", { "dependencies": { "@smithy/abort-controller": "^4.2.5", "@smithy/protocol-http": "^5.3.5", "@smithy/querystring-builder": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw=="],
-
- "@smithy/property-provider": ["@smithy/property-provider@1.2.0", "", { "dependencies": { "@smithy/types": "^1.2.0", "tslib": "^2.5.0" } }, "sha512-qlJd9gT751i4T0t/hJAyNGfESfi08Fek8QiLcysoKPgR05qHhG0OYhlaCJHhpXy4ECW0lHyjvFM1smrCLIXVfw=="],
-
- "@smithy/protocol-http": ["@smithy/protocol-http@5.3.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ=="],
-
- "@smithy/querystring-builder": ["@smithy/querystring-builder@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "@smithy/util-uri-escape": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg=="],
-
- "@smithy/querystring-parser": ["@smithy/querystring-parser@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ=="],
-
- "@smithy/service-error-classification": ["@smithy/service-error-classification@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0" } }, "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ=="],
-
- "@smithy/shared-ini-file-loader": ["@smithy/shared-ini-file-loader@4.4.0", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA=="],
-
- "@smithy/signature-v4": ["@smithy/signature-v4@5.3.5", "", { "dependencies": { "@smithy/is-array-buffer": "^4.2.0", "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "@smithy/util-hex-encoding": "^4.2.0", "@smithy/util-middleware": "^4.2.5", "@smithy/util-uri-escape": "^4.2.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w=="],
-
- "@smithy/smithy-client": ["@smithy/smithy-client@4.9.3", "", { "dependencies": { "@smithy/core": "^3.18.0", "@smithy/middleware-endpoint": "^4.3.7", "@smithy/middleware-stack": "^4.2.5", "@smithy/protocol-http": "^5.3.5", "@smithy/types": "^4.9.0", "@smithy/util-stream": "^4.5.6", "tslib": "^2.6.2" } }, "sha512-8tlueuTgV5n7inQCkhyptrB3jo2AO80uGrps/XTYZivv5MFQKKBj3CIWIGMI2fRY5LEduIiazOhAWdFknY1O9w=="],
-
- "@smithy/types": ["@smithy/types@4.9.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA=="],
-
- "@smithy/url-parser": ["@smithy/url-parser@4.2.5", "", { "dependencies": { "@smithy/querystring-parser": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ=="],
-
- "@smithy/util-base64": ["@smithy/util-base64@4.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ=="],
-
- "@smithy/util-body-length-browser": ["@smithy/util-body-length-browser@4.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg=="],
-
- "@smithy/util-body-length-node": ["@smithy/util-body-length-node@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA=="],
-
- "@smithy/util-buffer-from": ["@smithy/util-buffer-from@4.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew=="],
-
- "@smithy/util-config-provider": ["@smithy/util-config-provider@4.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q=="],
-
- "@smithy/util-defaults-mode-browser": ["@smithy/util-defaults-mode-browser@4.3.6", "", { "dependencies": { "@smithy/property-provider": "^4.2.5", "@smithy/smithy-client": "^4.9.3", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-kbpuXbEf2YQ9zEE6eeVnUCQWO0e1BjMnKrXL8rfXgiWA0m8/E0leU4oSNzxP04WfCmW8vjEqaDeXWxwE4tpOjQ=="],
-
- "@smithy/util-defaults-mode-node": ["@smithy/util-defaults-mode-node@4.2.9", "", { "dependencies": { "@smithy/config-resolver": "^4.4.3", "@smithy/credential-provider-imds": "^4.2.5", "@smithy/node-config-provider": "^4.3.5", "@smithy/property-provider": "^4.2.5", "@smithy/smithy-client": "^4.9.3", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-dgyribrVWN5qE5usYJ0m5M93mVM3L3TyBPZWe1Xl6uZlH2gzfQx3dz+ZCdW93lWqdedJRkOecnvbnoEEXRZ5VQ=="],
-
- "@smithy/util-endpoints": ["@smithy/util-endpoints@3.2.5", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A=="],
-
- "@smithy/util-hex-encoding": ["@smithy/util-hex-encoding@4.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw=="],
-
- "@smithy/util-middleware": ["@smithy/util-middleware@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA=="],
-
- "@smithy/util-retry": ["@smithy/util-retry@4.2.5", "", { "dependencies": { "@smithy/service-error-classification": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg=="],
-
- "@smithy/util-stream": ["@smithy/util-stream@4.5.6", "", { "dependencies": { "@smithy/fetch-http-handler": "^5.3.6", "@smithy/node-http-handler": "^4.4.5", "@smithy/types": "^4.9.0", "@smithy/util-base64": "^4.3.0", "@smithy/util-buffer-from": "^4.2.0", "@smithy/util-hex-encoding": "^4.2.0", "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ=="],
-
- "@smithy/util-uri-escape": ["@smithy/util-uri-escape@4.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA=="],
-
- "@smithy/util-utf8": ["@smithy/util-utf8@4.2.0", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw=="],
-
- "@smithy/util-waiter": ["@smithy/util-waiter@4.2.5", "", { "dependencies": { "@smithy/abort-controller": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-Dbun99A3InifQdIrsXZ+QLcC0PGBPAdrl4cj1mTgJvyc9N2zf7QSxg8TBkzsCmGJdE3TLbO9ycwpY0EkWahQ/g=="],
-
- "@smithy/uuid": ["@smithy/uuid@1.1.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw=="],
-
- "bowser": ["bowser@2.12.1", "", {}, "sha512-z4rE2Gxh7tvshQ4hluIT7XcFrgLIQaw9X3A+kTTRdovCz5PMukm/0QC/BKSYPj3omF5Qfypn9O/c5kgpmvYUCw=="],
-
- "fast-xml-parser": ["fast-xml-parser@5.2.5", "", { "dependencies": { "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ=="],
-
- "strnum": ["strnum@2.1.1", "", {}, "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw=="],
-
- "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
-
- "@aws-crypto/sha1-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="],
-
- "@aws-crypto/sha256-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="],
-
- "@aws-crypto/util/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="],
-
- "@aws-sdk/core/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-env/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-http/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-ini/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-node/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-process/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-sso/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/credential-provider-web-identity/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-sdk/token-providers/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@smithy/credential-provider-imds/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@smithy/node-config-provider/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@smithy/property-provider/@smithy/types": ["@smithy/types@1.2.0", "", { "dependencies": { "tslib": "^2.5.0" } }, "sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA=="],
-
- "@smithy/util-defaults-mode-browser/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@smithy/util-defaults-mode-node/@smithy/property-provider": ["@smithy/property-provider@4.2.5", "", { "dependencies": { "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg=="],
-
- "@aws-crypto/sha1-browser/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="],
-
- "@aws-crypto/sha256-browser/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="],
-
- "@aws-crypto/util/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="],
-
- "@aws-crypto/sha1-browser/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="],
-
- "@aws-crypto/sha256-browser/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="],
-
- "@aws-crypto/util/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="],
- }
-}
diff --git a/scripts/build-cache/have-access.ts b/scripts/build-cache/have-access.ts
deleted file mode 100644
index e3a28b9ccb2760..00000000000000
--- a/scripts/build-cache/have-access.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Test whether the current user has access to the Bun build-cache.
- *
- * Exits with code 0 if access is available, or 1 otherwise.
- */
-import { HeadBucketCommand, S3Client } from "@aws-sdk/client-s3";
-import { CredentialsProviderError } from "@aws-sdk/property-provider";
-
-class CacheConfig {
- #bucket: string;
- #region: string;
-
- get bucket(): string {
- return this.#bucket;
- }
-
- get region(): string {
- return this.#region;
- }
-
- static fromArgv(): CacheConfig {
- const cacheConfig = new CacheConfig();
-
- const exitWithHelp = (reason: string) => {
- console.error(`Error: ${reason}\n`);
- console.error("Usage: have-access --bucket --region ");
- process.exit(1);
- };
-
- for (let i = 2; i < process.argv.length; i++) {
- switch (process.argv[i]) {
- case "-b":
- case "--bucket":
- cacheConfig.#bucket = process.argv[++i];
- break;
- case "-r":
- case "--region":
- cacheConfig.#region = process.argv[++i];
- break;
- default:
- exitWithHelp(`Unknown argument: ${process.argv[i]}`);
- }
- }
-
- if (!cacheConfig.#bucket) {
- exitWithHelp("Missing required argument: --bucket");
- }
-
- if (!cacheConfig.#region) {
- exitWithHelp("Missing required argument: --region");
- }
-
- return cacheConfig;
- }
-}
-
-/**
- * Test whether the current user has access to the Bun build-cache.
- */
-async function currentUserHasAccess(cacheConfig: CacheConfig): Promise {
- const s3Client = new S3Client({ region: cacheConfig.region });
-
- try {
- await s3Client.send(new HeadBucketCommand({ Bucket: cacheConfig.bucket }));
- return true;
- } catch (error) {
- if (
- error.name === "NotFound" ||
- error.$metadata?.httpStatusCode === 404 ||
- error.name === "Forbidden" ||
- error.$metadata?.httpStatusCode === 403 ||
- error instanceof CredentialsProviderError
- ) {
- return false;
- }
-
- throw error;
- }
-}
-
-const ok = await currentUserHasAccess(CacheConfig.fromArgv());
-process.exit(ok ? 0 : 1);
diff --git a/scripts/build-cache/package.json b/scripts/build-cache/package.json
deleted file mode 100644
index 79e2d130a13d0a..00000000000000
--- a/scripts/build-cache/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "dependencies": {
- "@aws-sdk/client-s3": "^3.928.0",
- "@aws-sdk/property-provider": "^3.374.0"
- }
-}
diff --git a/scripts/build.mjs b/scripts/build.mjs
index 2607b11a73172c..34ce12247c66f5 100755
--- a/scripts/build.mjs
+++ b/scripts/build.mjs
@@ -108,8 +108,8 @@ async function build(args) {
await startGroup("CMake Build", () => spawn("cmake", buildArgs, { env }));
if (ciCppBuild) {
- await startGroup("sccache stats", () => {
- spawn("sccache", ["--show-stats"], { env });
+ await startGroup("ccache stats", () => {
+ spawn("ccache", ["--show-stats"], { env });
});
}
diff --git a/shell.nix b/shell.nix
index 22c4315dec563f..571c66d17601df 100644
--- a/shell.nix
+++ b/shell.nix
@@ -17,7 +17,7 @@ pkgs.mkShell rec {
cargo
go
python3
- sccache
+ ccache
pkg-config
gnumake
libtool
diff --git a/src/ast/Expr.zig b/src/ast/Expr.zig
index 8b3052a0d932bc..aa9f7eb5b58a81 100644
--- a/src/ast/Expr.zig
+++ b/src/ast/Expr.zig
@@ -617,7 +617,7 @@ pub fn joinAllWithCommaCallback(all: []Expr, comptime Context: type, ctx: Contex
return callback(ctx, all[0]);
},
2 => {
- return Expr.joinWithComma(
+ const result = Expr.joinWithComma(
callback(ctx, all[0]) orelse Expr{
.data = .{ .e_missing = .{} },
.loc = all[0].loc,
@@ -628,6 +628,10 @@ pub fn joinAllWithCommaCallback(all: []Expr, comptime Context: type, ctx: Contex
},
allocator,
);
+ if (result.isMissing()) {
+ return null;
+ }
+ return result;
},
else => {
var i: usize = 1;
@@ -643,6 +647,9 @@ pub fn joinAllWithCommaCallback(all: []Expr, comptime Context: type, ctx: Contex
}, allocator);
}
+ if (expr.isMissing()) {
+ return null;
+ }
return expr;
},
}
diff --git a/src/ast/SideEffects.zig b/src/ast/SideEffects.zig
index 37d64a0294d52c..44c25896da46e5 100644
--- a/src/ast/SideEffects.zig
+++ b/src/ast/SideEffects.zig
@@ -315,6 +315,10 @@ pub const SideEffects = enum(u1) {
);
}
+ if (result.isMissing()) {
+ return null;
+ }
+
return result;
},
.e_array => {
diff --git a/src/bake/BakeGlobalObject.cpp b/src/bake/BakeGlobalObject.cpp
index f7ca1b4231941a..b5c25eecac1c4e 100644
--- a/src/bake/BakeGlobalObject.cpp
+++ b/src/bake/BakeGlobalObject.cpp
@@ -141,10 +141,10 @@ JSC::JSInternalPromise* bakeModuleLoaderFetch(JSC::JSGlobalObject* globalObject,
globalObject,
source.toWTFString(),
origin,
- WTFMove(moduleKey),
+ WTF::move(moduleKey),
WTF::TextPosition(),
JSC::SourceProviderSourceType::Module));
- return resolvedInternalPromise(globalObject, JSC::JSSourceCode::create(vm, WTFMove(sourceCode)));
+ return resolvedInternalPromise(globalObject, JSC::JSSourceCode::create(vm, WTF::move(sourceCode)));
}
// We unconditionally prefix the key with "bake:" inside
diff --git a/src/bake/BakeSourceProvider.cpp b/src/bake/BakeSourceProvider.cpp
index 8efa3d8d347596..24353dcb7bf863 100644
--- a/src/bake/BakeSourceProvider.cpp
+++ b/src/bake/BakeSourceProvider.cpp
@@ -33,7 +33,7 @@ extern "C" JSC::EncodedJSValue BakeLoadInitialServerCode(JSC::JSGlobalObject* gl
global,
source.toWTFString(),
origin,
- WTFMove(string),
+ WTF::move(string),
WTF::TextPosition(),
JSC::SourceProviderSourceType::Program
));
@@ -67,7 +67,7 @@ extern "C" JSC::EncodedJSValue BakeLoadServerHmrPatch(GlobalObject* global, BunS
global,
source.toWTFString(),
origin,
- WTFMove(string),
+ WTF::move(string),
WTF::TextPosition(),
JSC::SourceProviderSourceType::Program
));
@@ -93,7 +93,7 @@ extern "C" JSC::EncodedJSValue BakeLoadServerHmrPatchWithSourceMap(GlobalObject*
sourceMapJSONPtr,
sourceMapJSONLength,
origin,
- WTFMove(string),
+ WTF::move(string),
WTF::TextPosition(),
JSC::SourceProviderSourceType::Program
);
@@ -159,7 +159,7 @@ extern "C" JSC::EncodedJSValue BakeRegisterProductionChunk(JSC::JSGlobalObject*
global,
source.toWTFString(),
origin,
- WTFMove(string),
+ WTF::move(string),
WTF::TextPosition(),
JSC::SourceProviderSourceType::Module
));
diff --git a/src/bake/BakeSourceProvider.h b/src/bake/BakeSourceProvider.h
index 7055fcedbea61b..2b6ffe495d59c9 100644
--- a/src/bake/BakeSourceProvider.h
+++ b/src/bake/BakeSourceProvider.h
@@ -20,7 +20,7 @@ class SourceProvider final : public JSC::StringSourceProvider {
const TextPosition& startPosition,
JSC::SourceProviderSourceType sourceType)
{
- auto provider = adoptRef(*new SourceProvider(source, sourceOrigin, WTFMove(sourceURL), startPosition, sourceType));
+ auto provider = adoptRef(*new SourceProvider(source, sourceOrigin, WTF::move(sourceURL), startPosition, sourceType));
auto* zigGlobalObject = jsCast(globalObject);
auto specifier = Bun::toString(provider->sourceURL());
Bun__addBakeSourceProviderSourceMap(zigGlobalObject->bunVM(), provider.ptr(), &specifier);
@@ -38,7 +38,7 @@ class SourceProvider final : public JSC::StringSourceProvider {
source,
sourceOrigin,
JSC::SourceTaintedOrigin::Untainted,
- WTFMove(sourceURL),
+ WTF::move(sourceURL),
startPosition,
sourceType)
{
diff --git a/src/bake/DevServerSourceProvider.h b/src/bake/DevServerSourceProvider.h
index 7667b6f811c176..d18087dd147f7d 100644
--- a/src/bake/DevServerSourceProvider.h
+++ b/src/bake/DevServerSourceProvider.h
@@ -25,7 +25,7 @@ class DevServerSourceProvider final : public JSC::StringSourceProvider {
const TextPosition& startPosition,
JSC::SourceProviderSourceType sourceType)
{
- auto provider = adoptRef(*new DevServerSourceProvider(source, sourceMapJSONPtr, sourceMapJSONLength, sourceOrigin, WTFMove(sourceURL), startPosition, sourceType));
+ auto provider = adoptRef(*new DevServerSourceProvider(source, sourceMapJSONPtr, sourceMapJSONLength, sourceOrigin, WTF::move(sourceURL), startPosition, sourceType));
auto* zigGlobalObject = jsCast<::Zig::GlobalObject*>(globalObject);
auto specifier = Bun::toString(provider->sourceURL());
provider->m_globalObject = zigGlobalObject;
@@ -52,7 +52,7 @@ class DevServerSourceProvider final : public JSC::StringSourceProvider {
source,
sourceOrigin,
JSC::SourceTaintedOrigin::Untainted,
- WTFMove(sourceURL),
+ WTF::move(sourceURL),
startPosition,
sourceType)
, m_sourceMapJSON(sourceMapJSONPtr, sourceMapJSONLength)
diff --git a/src/bun.js/ConsoleObject.zig b/src/bun.js/ConsoleObject.zig
index f9d540ed11edcd..491689ecc43800 100644
--- a/src/bun.js/ConsoleObject.zig
+++ b/src/bun.js/ConsoleObject.zig
@@ -1629,11 +1629,11 @@ pub const Formatter = struct {
},
.j => {
- // JSON.stringify the value
+ // JSON.stringify the value using FastStringifier for SIMD optimization
var str = bun.String.empty;
defer str.deref();
- try next_value.jsonStringify(global, 0, &str);
+ try next_value.jsonStringifyFast(global, &str);
this.addForNewLine(str.length());
writer.print("{f}", .{str});
},
diff --git a/src/bun.js/JSONLineBuffer.zig b/src/bun.js/JSONLineBuffer.zig
new file mode 100644
index 00000000000000..b4b2833005dea6
--- /dev/null
+++ b/src/bun.js/JSONLineBuffer.zig
@@ -0,0 +1,135 @@
+/// Buffer for newline-delimited data that tracks scan positions to avoid O(n²) scanning.
+/// Each byte is scanned exactly once. We track:
+/// - newline_pos: position of first known newline (if any)
+/// - scanned_pos: how far we've scanned (bytes before this have been checked)
+/// - head: offset into the buffer where unconsumed data starts (avoids copying on each consume)
+///
+/// When data arrives, we only scan the NEW bytes.
+/// When we consume a message, we just advance `head` instead of copying.
+/// Compaction only happens when head exceeds a threshold.
+pub const JSONLineBuffer = struct {
+ data: bun.ByteList = .{},
+ /// Offset into data where unconsumed content starts.
+ head: u32 = 0,
+ /// Position of a known upcoming newline relative to head, if any.
+ newline_pos: ?u32 = null,
+ /// How far we've scanned for newlines relative to head.
+ scanned_pos: u32 = 0,
+
+ /// Compact the buffer when head exceeds this threshold.
+ const compaction_threshold = 16 * 1024 * 1024; // 16 MB
+
+ /// Get the active (unconsumed) portion of the buffer.
+ fn activeSlice(self: *const @This()) []const u8 {
+ return self.data.slice()[self.head..];
+ }
+
+ /// Scan for newline in unscanned portion of the buffer.
+ fn scanForNewline(self: *@This()) void {
+ if (self.newline_pos != null) return;
+ const slice = self.activeSlice();
+ if (self.scanned_pos >= slice.len) return;
+
+ const unscanned = slice[self.scanned_pos..];
+ if (bun.strings.indexOfChar(unscanned, '\n')) |local_idx| {
+ bun.debugAssert(local_idx <= std.math.maxInt(u32));
+ const pos = self.scanned_pos +| @as(u32, @intCast(local_idx));
+ self.newline_pos = pos;
+ self.scanned_pos = pos +| 1; // Only scanned up to (and including) the newline
+ } else {
+ bun.debugAssert(slice.len <= std.math.maxInt(u32));
+ self.scanned_pos = @intCast(slice.len); // No newline, scanned everything
+ }
+ }
+
+ /// Compact the buffer by moving data to the front. Called when head exceeds threshold.
+ fn compact(self: *@This()) void {
+ if (self.head == 0) return;
+ const slice = self.activeSlice();
+ bun.copy(u8, self.data.ptr[0..slice.len], slice);
+ bun.debugAssert(slice.len <= std.math.maxInt(u32));
+ self.data.len = @intCast(slice.len);
+ self.head = 0;
+ }
+
+ /// Append bytes to the buffer, scanning only new data for newline.
+ pub fn append(self: *@This(), bytes: []const u8) void {
+ _ = bun.handleOom(self.data.write(bun.default_allocator, bytes));
+ self.scanForNewline();
+ }
+
+ /// Returns the next complete message (up to and including newline) if available.
+ pub fn next(self: *const @This()) ?struct { data: []const u8, newline_pos: u32 } {
+ const pos = self.newline_pos orelse return null;
+ return .{
+ .data = self.activeSlice()[0 .. pos + 1],
+ .newline_pos = pos,
+ };
+ }
+
+ /// Consume bytes from the front of the buffer after processing a message.
+ /// Just advances head offset - no copying until compaction threshold is reached.
+ pub fn consume(self: *@This(), bytes: u32) void {
+ self.head +|= bytes;
+
+ // Adjust scanned_pos (subtract consumed bytes, but don't go negative)
+ self.scanned_pos = if (bytes >= self.scanned_pos) 0 else self.scanned_pos - bytes;
+
+ // Adjust newline_pos
+ if (self.newline_pos) |pos| {
+ if (bytes > pos) {
+ // Consumed past the known newline - clear it and scan for next
+ self.newline_pos = null;
+ self.scanForNewline();
+ } else {
+ self.newline_pos = pos - bytes;
+ }
+ }
+
+ // Check if we've consumed everything
+ if (self.head >= self.data.len) {
+ // Free memory if capacity exceeds threshold, otherwise just reset
+ if (self.data.cap >= compaction_threshold) {
+ self.data.deinit(bun.default_allocator);
+ self.data = .{};
+ } else {
+ self.data.len = 0;
+ }
+ self.head = 0;
+ self.scanned_pos = 0;
+ self.newline_pos = null;
+ return;
+ }
+
+ // Compact if head exceeds threshold to avoid unbounded memory growth
+ if (self.head >= compaction_threshold) {
+ self.compact();
+ }
+ }
+
+ pub fn isEmpty(self: *const @This()) bool {
+ return self.head >= self.data.len;
+ }
+
+ pub fn unusedCapacitySlice(self: *@This()) []u8 {
+ return self.data.unusedCapacitySlice();
+ }
+
+ pub fn ensureUnusedCapacity(self: *@This(), additional: usize) void {
+ bun.handleOom(self.data.ensureUnusedCapacity(bun.default_allocator, additional));
+ }
+
+ /// Notify the buffer that data was written directly (e.g., via pre-allocated slice).
+ pub fn notifyWritten(self: *@This(), new_data: []const u8) void {
+ bun.debugAssert(new_data.len <= std.math.maxInt(u32));
+ self.data.len +|= @as(u32, @intCast(new_data.len));
+ self.scanForNewline();
+ }
+
+ pub fn deinit(self: *@This()) void {
+ self.data.deinit(bun.default_allocator);
+ }
+};
+
+const bun = @import("bun");
+const std = @import("std");
diff --git a/src/bun.js/api/BunObject.zig b/src/bun.js/api/BunObject.zig
index 1ed2b9e24452a5..831c4c50088bad 100644
--- a/src/bun.js/api/BunObject.zig
+++ b/src/bun.js/api/BunObject.zig
@@ -16,6 +16,7 @@ pub const BunObject = struct {
pub const connect = toJSCallback(host_fn.wrapStaticMethod(api.Listener, "connect", false));
pub const createParsedShellScript = toJSCallback(bun.shell.ParsedShellScript.createParsedShellScript);
pub const createShellInterpreter = toJSCallback(bun.shell.Interpreter.createShellInterpreter);
+ pub const traceShellScript = toJSCallback(bun.shell.TraceInterpreter.traceShellScript);
pub const deflateSync = toJSCallback(JSZlib.deflateSync);
pub const file = toJSCallback(WebCore.Blob.constructBunFile);
pub const gunzipSync = toJSCallback(JSZlib.gunzipSync);
@@ -154,6 +155,7 @@ pub const BunObject = struct {
@export(&BunObject.connect, .{ .name = callbackName("connect") });
@export(&BunObject.createParsedShellScript, .{ .name = callbackName("createParsedShellScript") });
@export(&BunObject.createShellInterpreter, .{ .name = callbackName("createShellInterpreter") });
+ @export(&BunObject.traceShellScript, .{ .name = callbackName("traceShellScript") });
@export(&BunObject.deflateSync, .{ .name = callbackName("deflateSync") });
@export(&BunObject.file, .{ .name = callbackName("file") });
@export(&BunObject.gunzipSync, .{ .name = callbackName("gunzipSync") });
diff --git a/src/bun.js/api/HashObject.zig b/src/bun.js/api/HashObject.zig
index 05256cf581aab1..92b3f6da4e5577 100644
--- a/src/bun.js/api/HashObject.zig
+++ b/src/bun.js/api/HashObject.zig
@@ -2,7 +2,22 @@ const HashObject = @This();
pub const wyhash = hashWrap(std.hash.Wyhash);
pub const adler32 = hashWrap(std.hash.Adler32);
-pub const crc32 = hashWrap(std.hash.Crc32);
+/// Use hardware-accelerated CRC32 from zlib
+pub const crc32 = hashWrap(struct {
+ pub fn hash(seed: u32, bytes: []const u8) u32 {
+ // zlib takes a 32-bit length, so chunk large inputs to avoid truncation.
+ var crc: u64 = seed;
+ var offset: usize = 0;
+ while (offset < bytes.len) {
+ const remaining = bytes.len - offset;
+ const max_len: usize = std.math.maxInt(u32);
+ const chunk_len: u32 = if (remaining > max_len) @intCast(max_len) else @intCast(remaining);
+ crc = bun.zlib.crc32(crc, bytes.ptr + offset, chunk_len);
+ offset += chunk_len;
+ }
+ return @intCast(crc);
+ }
+});
pub const cityHash32 = hashWrap(std.hash.CityHash32);
pub const cityHash64 = hashWrap(std.hash.CityHash64);
pub const xxHash32 = hashWrap(struct {
diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig
index 6e77655062742f..1a948f78b38c60 100644
--- a/src/bun.js/api/JSBundler.zig
+++ b/src/bun.js/api/JSBundler.zig
@@ -7,6 +7,7 @@ pub const JSBundler = struct {
target: Target = Target.browser,
entry_points: bun.StringSet = bun.StringSet.init(bun.default_allocator),
hot: bool = false,
+ react_fast_refresh: bool = false,
define: bun.StringMap = bun.StringMap.init(bun.default_allocator, false),
loaders: ?api.LoaderMap = null,
dir: OwnedString = OwnedString.initEmpty(bun.default_allocator),
@@ -341,6 +342,10 @@ pub const JSBundler = struct {
}
}
+ if (try config.getBooleanLoose(globalThis, "reactFastRefresh")) |react_fast_refresh| {
+ this.react_fast_refresh = react_fast_refresh;
+ }
+
var has_out_dir = false;
if (try config.getOptional(globalThis, "outdir", ZigString.Slice)) |slice| {
defer slice.deinit();
diff --git a/src/bun.js/api/JSTranspiler.zig b/src/bun.js/api/JSTranspiler.zig
index 86814d6deedaaa..2524468d1a8c6a 100644
--- a/src/bun.js/api/JSTranspiler.zig
+++ b/src/bun.js/api/JSTranspiler.zig
@@ -165,7 +165,8 @@ pub const Config = struct {
}
if (!kind.isStringLike()) {
- try tsconfig.jsonStringify(globalThis, 0, &out);
+ // Use jsonStringifyFast for SIMD-optimized serialization
+ try tsconfig.jsonStringifyFast(globalThis, &out);
} else {
out = try tsconfig.toBunString(globalThis);
}
@@ -204,7 +205,8 @@ pub const Config = struct {
defer out.deref();
// TODO: write a converter between JSC types and Bun AST types
if (is_object) {
- try macros.jsonStringify(globalThis, 0, &out);
+ // Use jsonStringifyFast for SIMD-optimized serialization
+ try macros.jsonStringifyFast(globalThis, &out);
} else {
out = try macros.toBunString(globalThis);
}
diff --git a/src/bun.js/api/bun/js_bun_spawn_bindings.zig b/src/bun.js/api/bun/js_bun_spawn_bindings.zig
index 7010c9f7e2d2f2..45c33a5a19e44a 100644
--- a/src/bun.js/api/bun/js_bun_spawn_bindings.zig
+++ b/src/bun.js/api/bun/js_bun_spawn_bindings.zig
@@ -6,6 +6,11 @@ fn getArgv0(globalThis: *jsc.JSGlobalObject, PATH: []const u8, cwd: []const u8,
} {
var arg0 = try first_cmd.toSliceOrNullWithAllocator(globalThis, allocator);
defer arg0.deinit();
+
+ // Check for null bytes in command (security: prevent null byte injection)
+ if (strings.indexOfChar(arg0.slice(), 0) != null) {
+ return globalThis.ERR(.INVALID_ARG_VALUE, "The argument 'args[0]' must be a string without null bytes. Received {f}", .{bun.fmt.quote(arg0.slice())}).throw();
+ }
// Heap allocate it to ensure we don't run out of stack space.
const path_buf: *bun.PathBuffer = try bun.default_allocator.create(bun.PathBuffer);
defer bun.default_allocator.destroy(path_buf);
@@ -63,11 +68,18 @@ fn getArgv(globalThis: *jsc.JSGlobalObject, args: JSValue, PATH: []const u8, cwd
argv0.* = argv0_result.argv0.ptr;
argv.appendAssumeCapacity(argv0_result.arg0.ptr);
+ var arg_index: usize = 1;
while (try cmds_array.next()) |value| {
const arg = try value.toBunString(globalThis);
defer arg.deref();
+ // Check for null bytes in argument (security: prevent null byte injection)
+ if (arg.indexOfAsciiChar(0) != null) {
+ return globalThis.ERR(.INVALID_ARG_VALUE, "The argument 'args[{d}]' must be a string without null bytes. Received \"{f}\"", .{ arg_index, arg.toZigString() }).throw();
+ }
+
argv.appendAssumeCapacity(try arg.toOwnedSliceZ(allocator));
+ arg_index += 1;
}
if (argv.items.len == 0) {
@@ -1063,7 +1075,18 @@ pub fn appendEnvpFromJS(globalThis: *jsc.JSGlobalObject, object: *jsc.JSObject,
var value = object_iter.value;
if (value.isUndefined()) continue;
- const line = try std.fmt.allocPrintSentinel(envp.allocator, "{f}={f}", .{ key, try value.getZigString(globalThis) }, 0);
+ const value_bunstr = try value.toBunString(globalThis);
+ defer value_bunstr.deref();
+
+ // Check for null bytes in env key and value (security: prevent null byte injection)
+ if (key.indexOfAsciiChar(0) != null) {
+ return globalThis.ERR(.INVALID_ARG_VALUE, "The property 'options.env['{f}']' must be a string without null bytes. Received \"{f}\"", .{ key.toZigString(), key.toZigString() }).throw();
+ }
+ if (value_bunstr.indexOfAsciiChar(0) != null) {
+ return globalThis.ERR(.INVALID_ARG_VALUE, "The property 'options.env['{f}']' must be a string without null bytes. Received \"{f}\"", .{ key.toZigString(), value_bunstr.toZigString() }).throw();
+ }
+
+ const line = try std.fmt.allocPrintSentinel(envp.allocator, "{f}={f}", .{ key, value_bunstr.toZigString() }, 0);
if (key.eqlComptime("PATH")) {
PATH.* = bun.asByteSlice(line["PATH=".len..]);
diff --git a/src/bun.js/bindings/BunCPUProfiler.cpp b/src/bun.js/bindings/BunCPUProfiler.cpp
index e31dccaae61dac..6fa40d28815c47 100644
--- a/src/bun.js/bindings/BunCPUProfiler.cpp
+++ b/src/bun.js/bindings/BunCPUProfiler.cpp
@@ -34,7 +34,7 @@ void startCPUProfiler(JSC::VM& vm)
auto stopwatch = WTF::Stopwatch::create();
stopwatch->start();
- JSC::SamplingProfiler& samplingProfiler = vm.ensureSamplingProfiler(WTFMove(stopwatch));
+ JSC::SamplingProfiler& samplingProfiler = vm.ensureSamplingProfiler(WTF::move(stopwatch));
// Set sampling interval to 1ms (1000 microseconds) to match Node.js
samplingProfiler.setTimingInterval(WTF::Seconds::fromMicroseconds(1000));
@@ -92,7 +92,7 @@ WTF::String stopCPUProfilerAndGetJSON(JSC::VM& vm)
rootNode.lineNumber = -1;
rootNode.columnNumber = -1;
rootNode.hitCount = 0;
- nodes.append(WTFMove(rootNode));
+ nodes.append(WTF::move(rootNode));
int nextNodeId = 2;
WTF::Vector samples;
@@ -229,7 +229,7 @@ WTF::String stopCPUProfilerAndGetJSON(JSC::VM& vm)
node.columnNumber = columnNumber;
node.hitCount = 0;
- nodes.append(WTFMove(node));
+ nodes.append(WTF::move(node));
// Add this node as child of parent
if (currentParentId > 0) {
diff --git a/src/bun.js/bindings/BunClientData.cpp b/src/bun.js/bindings/BunClientData.cpp
index 37ebf65ddee7fc..aa1285153bbaa1 100644
--- a/src/bun.js/bindings/BunClientData.cpp
+++ b/src/bun.js/bindings/BunClientData.cpp
@@ -85,10 +85,10 @@ void JSVMClientData::create(VM* vm, void* bunVM)
JSVMClientData* clientData = new JSVMClientData(*vm, provider);
clientData->bunVM = bunVM;
vm->deferredWorkTimer->onAddPendingWork = [clientData](Ref&& ticket, JSC::DeferredWorkTimer::WorkType kind) -> void {
- Bun::JSCTaskScheduler::onAddPendingWork(clientData, WTFMove(ticket), kind);
+ Bun::JSCTaskScheduler::onAddPendingWork(clientData, WTF::move(ticket), kind);
};
vm->deferredWorkTimer->onScheduleWorkSoon = [clientData](JSC::DeferredWorkTimer::Ticket ticket, JSC::DeferredWorkTimer::Task&& task) -> void {
- Bun::JSCTaskScheduler::onScheduleWorkSoon(clientData, ticket, WTFMove(task));
+ Bun::JSCTaskScheduler::onScheduleWorkSoon(clientData, ticket, WTF::move(task));
};
vm->deferredWorkTimer->onCancelPendingWork = [clientData](JSC::DeferredWorkTimer::Ticket ticket) -> void {
Bun::JSCTaskScheduler::onCancelPendingWork(clientData, ticket);
diff --git a/src/bun.js/bindings/BunClientData.h b/src/bun.js/bindings/BunClientData.h
index 07ba0cfc95fbe1..d0ba38b19dab42 100644
--- a/src/bun.js/bindings/BunClientData.h
+++ b/src/bun.js/bindings/BunClientData.h
@@ -170,7 +170,7 @@ ALWAYS_INLINE JSC::GCClient::IsoSubspace* subspaceForImpl(JSC::VM& vm, GetClient
uniqueSubspace = makeUnique ISO_SUBSPACE_INIT(heap, heap.cellHeapCellType, T);
}
space = uniqueSubspace.get();
- setServer(subspaces, WTFMove(uniqueSubspace));
+ setServer(subspaces, WTF::move(uniqueSubspace));
IGNORE_WARNINGS_BEGIN("unreachable-code")
IGNORE_WARNINGS_BEGIN("tautological-compare")
@@ -184,7 +184,7 @@ ALWAYS_INLINE JSC::GCClient::IsoSubspace* subspaceForImpl(JSC::VM& vm, GetClient
auto uniqueClientSubspace = makeUnique(*space);
auto* clientSpace = uniqueClientSubspace.get();
- setClient(clientSubspaces, WTFMove(uniqueClientSubspace));
+ setClient(clientSubspaces, WTF::move(uniqueClientSubspace));
return clientSpace;
}
diff --git a/src/bun.js/bindings/BunDebugger.cpp b/src/bun.js/bindings/BunDebugger.cpp
index 00ee9499e98a3c..25573fb1975b2c 100644
--- a/src/bun.js/bindings/BunDebugger.cpp
+++ b/src/bun.js/bindings/BunDebugger.cpp
@@ -280,7 +280,7 @@ class BunInspectorConnection : public Inspector::FrontendChannel {
}
for (auto message : messages) {
- dispatcher.dispatchMessageFromRemote(WTFMove(message));
+ dispatcher.dispatchMessageFromRemote(WTF::move(message));
if (!debugger) {
debugger = reinterpret_cast(globalObject->debugger());
@@ -293,7 +293,7 @@ class BunInspectorConnection : public Inspector::FrontendChannel {
}
} else {
for (auto message : messages) {
- dispatcher.dispatchMessageFromRemote(WTFMove(message));
+ dispatcher.dispatchMessageFromRemote(WTF::move(message));
}
}
@@ -461,7 +461,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionSend, (JSC::JSGlobalObject * globalObject, JS
messages.append(value.toWTFString(globalObject).isolatedCopy());
return true;
});
- jsConnection->connection()->sendMessageToInspectorFromDebuggerThread(WTFMove(messages));
+ jsConnection->connection()->sendMessageToInspectorFromDebuggerThread(WTF::move(messages));
}
return JSValue::encode(jsUndefined());
diff --git a/src/bun.js/bindings/BunInjectedScriptHost.cpp b/src/bun.js/bindings/BunInjectedScriptHost.cpp
index 7141083305a7e5..0402d3ec87669c 100644
--- a/src/bun.js/bindings/BunInjectedScriptHost.cpp
+++ b/src/bun.js/bindings/BunInjectedScriptHost.cpp
@@ -130,7 +130,7 @@ JSValue BunInjectedScriptHost::getInternalProperties(VM& vm, JSGlobalObject* exe
String name = worker->name();
if (!name.isEmpty())
- array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "name"_s, jsString(vm, WTFMove(name))));
+ array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "name"_s, jsString(vm, WTF::move(name))));
array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "terminated"_s, jsBoolean(worker->wasTerminated())));
diff --git a/src/bun.js/bindings/BunInspector.cpp b/src/bun.js/bindings/BunInspector.cpp
index ef7a9a251df756..cbabe4f91e79f1 100644
--- a/src/bun.js/bindings/BunInspector.cpp
+++ b/src/bun.js/bindings/BunInspector.cpp
@@ -74,7 +74,7 @@ class BunInspectorConnection : public Inspector::FrontendChannel {
Bun__tickWhilePaused(&done);
};
}
- this->globalObject->inspectorDebuggable().dispatchMessageFromRemote(WTFMove(messageString));
+ this->globalObject->inspectorDebuggable().dispatchMessageFromRemote(WTF::move(messageString));
}
void drain()
@@ -138,7 +138,7 @@ static void addInspector(void* app, JSC::JSGlobalObject* globalObject)
delete inspector; }
};
- ((uWS::SSLApp*)app)->ws("/bun:inspect", std::move(handler));
+ ((uWS::SSLApp*)app)->ws("/bun:inspect", WTF::move(handler));
} else {
auto handler = uWS::App::WebSocketBehavior {
@@ -174,7 +174,7 @@ static void addInspector(void* app, JSC::JSGlobalObject* globalObject)
delete inspector; }
};
- ((uWS::App*)app)->ws("/bun:inspect", std::move(handler));
+ ((uWS::App*)app)->ws("/bun:inspect", WTF::move(handler));
}
}
diff --git a/src/bun.js/bindings/BunObject+exports.h b/src/bun.js/bindings/BunObject+exports.h
index d92b41c0cd803c..b4481f7e4758f5 100644
--- a/src/bun.js/bindings/BunObject+exports.h
+++ b/src/bun.js/bindings/BunObject+exports.h
@@ -69,6 +69,7 @@
macro(spawn) \
macro(spawnSync) \
macro(stringWidth) \
+ macro(traceShellScript) \
macro(udpSocket) \
macro(which) \
macro(write) \
diff --git a/src/bun.js/bindings/BunObject.cpp b/src/bun.js/bindings/BunObject.cpp
index 3f835745723920..c94784cf96e085 100644
--- a/src/bun.js/bindings/BunObject.cpp
+++ b/src/bun.js/bindings/BunObject.cpp
@@ -232,12 +232,12 @@ static inline JSC::EncodedJSValue flattenArrayOfBuffersIntoArrayBufferOrUint8Arr
}
if (asUint8Array) {
- auto uint8array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->m_typedArrayUint8.get(lexicalGlobalObject), WTFMove(buffer), 0, byteLength);
+ auto uint8array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->m_typedArrayUint8.get(lexicalGlobalObject), WTF::move(buffer), 0, byteLength);
RETURN_IF_EXCEPTION(throwScope, {});
return JSValue::encode(uint8array);
}
- RELEASE_AND_RETURN(throwScope, JSValue::encode(JSC::JSArrayBuffer::create(vm, lexicalGlobalObject->arrayBufferStructure(), WTFMove(buffer))));
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(JSC::JSArrayBuffer::create(vm, lexicalGlobalObject->arrayBufferStructure(), WTF::move(buffer))));
}
JSC_DEFINE_HOST_FUNCTION(functionConcatTypedArrays, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
@@ -354,12 +354,14 @@ static JSValue constructBunShell(VM& vm, JSObject* bunObject)
auto* globalObject = jsCast(bunObject->globalObject());
JSFunction* createParsedShellScript = JSFunction::create(vm, bunObject->globalObject(), 2, "createParsedShellScript"_s, BunObject_callback_createParsedShellScript, ImplementationVisibility::Private, NoIntrinsic);
JSFunction* createShellInterpreterFunction = JSFunction::create(vm, bunObject->globalObject(), 1, "createShellInterpreter"_s, BunObject_callback_createShellInterpreter, ImplementationVisibility::Private, NoIntrinsic);
+ JSFunction* traceShellScriptFunction = JSFunction::create(vm, bunObject->globalObject(), 1, "traceShellScript"_s, BunObject_callback_traceShellScript, ImplementationVisibility::Private, NoIntrinsic);
JSC::JSFunction* createShellFn = JSC::JSFunction::create(vm, globalObject, shellCreateBunShellTemplateFunctionCodeGenerator(vm), globalObject);
auto scope = DECLARE_THROW_SCOPE(vm);
auto args = JSC::MarkedArgumentBuffer();
args.append(createShellInterpreterFunction);
args.append(createParsedShellScript);
+ args.append(traceShellScriptFunction);
JSC::JSValue shell = JSC::call(globalObject, createShellFn, args, "BunShell"_s);
RETURN_IF_EXCEPTION(scope, {});
@@ -585,7 +587,7 @@ JSC_DEFINE_HOST_FUNCTION(functionPathToFileURL, (JSC::JSGlobalObject * lexicalGl
auto fileURL = WTF::URL::fileURLWithFileSystemPath(pathString);
auto object = WebCore::DOMURL::create(fileURL.string(), String());
- jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTFMove(object));
+ jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTF::move(object));
}
auto* jsDOMURL = jsCast(jsValue.asCell());
diff --git a/src/bun.js/bindings/BunPlugin.cpp b/src/bun.js/bindings/BunPlugin.cpp
index 94bc8350236509..590037d1a5ce4f 100644
--- a/src/bun.js/bindings/BunPlugin.cpp
+++ b/src/bun.js/bindings/BunPlugin.cpp
@@ -371,7 +371,7 @@ void BunPlugin::Base::append(JSC::VM& vm, JSC::RegExp* filter, JSC::JSObject* fu
} else {
Group newGroup;
newGroup.append(vm, filter, func);
- this->groups.append(WTFMove(newGroup));
+ this->groups.append(WTF::move(newGroup));
this->namespaces.append(namespaceString);
}
}
diff --git a/src/bun.js/bindings/BunProcess.cpp b/src/bun.js/bindings/BunProcess.cpp
index 0c427be8f0b383..f0e77d579c5514 100644
--- a/src/bun.js/bindings/BunProcess.cpp
+++ b/src/bun.js/bindings/BunProcess.cpp
@@ -3740,7 +3740,7 @@ JSC_DEFINE_CUSTOM_GETTER(processTitle, (JSC::JSGlobalObject * globalObject, JSC:
BunString str;
Bun__Process__getTitle(globalObject, &str);
auto value = str.transferToWTFString();
- auto* result = jsString(globalObject->vm(), WTFMove(value));
+ auto* result = jsString(globalObject->vm(), WTF::move(value));
RETURN_IF_EXCEPTION(scope, {});
RELEASE_AND_RETURN(scope, JSValue::encode(result));
#else
diff --git a/src/bun.js/bindings/BunProcess.h b/src/bun.js/bindings/BunProcess.h
index 807b4c0c105cbb..02b049ebf1e5d1 100644
--- a/src/bun.js/bindings/BunProcess.h
+++ b/src/bun.js/bindings/BunProcess.h
@@ -35,7 +35,7 @@ class Process : public WebCore::JSEventEmitter {
public:
Process(JSC::Structure* structure, WebCore::JSDOMGlobalObject& globalObject, Ref&& impl)
- : Base(structure, globalObject, WTFMove(impl))
+ : Base(structure, globalObject, WTF::move(impl))
{
}
@@ -88,7 +88,7 @@ class Process : public WebCore::JSEventEmitter {
static Process* create(WebCore::JSDOMGlobalObject& globalObject, JSC::Structure* structure)
{
auto emitter = WebCore::EventEmitter::create(*globalObject.scriptExecutionContext());
- Process* accessor = new (NotNull, JSC::allocateCell(globalObject.vm())) Process(structure, globalObject, WTFMove(emitter));
+ Process* accessor = new (NotNull, JSC::allocateCell(globalObject.vm())) Process(structure, globalObject, WTF::move(emitter));
accessor->finishCreation(globalObject.vm());
return accessor;
}
diff --git a/src/bun.js/bindings/BunString.cpp b/src/bun.js/bindings/BunString.cpp
index 6c90ec612e446e..fddb5c8cbe649b 100644
--- a/src/bun.js/bindings/BunString.cpp
+++ b/src/bun.js/bindings/BunString.cpp
@@ -102,7 +102,7 @@ extern "C" [[ZIG_EXPORT(zero_is_throw)]] JSC::EncodedJSValue BunString__createUT
return {};
}
scope.assertNoException();
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
extern "C" JSC::EncodedJSValue BunString__transferToJS(BunString* bunString, JSC::JSGlobalObject* globalObject)
@@ -125,12 +125,12 @@ extern "C" JSC::EncodedJSValue BunString__transferToJS(BunString* bunString, JSC
#endif
bunString->impl.wtf->deref();
*bunString = { .tag = BunStringTag::Dead };
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
WTF::String str = bunString->toWTFString();
*bunString = { .tag = BunStringTag::Dead };
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
// int64_t max to say "not a number"
@@ -553,7 +553,7 @@ extern "C" JSC::EncodedJSValue BunString__toJSDOMURL(JSC::JSGlobalObject* lexica
auto str = bunString->toWTFString(BunString::ZeroCopy);
auto object = WebCore::DOMURL::create(str, String());
- auto jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTFMove(object));
+ auto jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTF::move(object));
auto* jsDOMURL = jsCast(jsValue.asCell());
vm.heap.reportExtraMemoryAllocated(jsDOMURL, jsDOMURL->wrapped().memoryCostForGC());
RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(jsValue));
@@ -573,7 +573,7 @@ extern "C" WTF::URL* URL__fromJS(EncodedJSValue encodedValue, JSC::JSGlobalObjec
if (!url.isValid() || url.isNull())
return nullptr;
- return new WTF::URL(WTFMove(url));
+ return new WTF::URL(WTF::move(url));
}
extern "C" BunString URL__getHrefFromJS(EncodedJSValue encodedValue, JSC::JSGlobalObject* globalObject)
@@ -647,7 +647,7 @@ extern "C" WTF::URL* URL__fromString(BunString* input)
if (!url.isValid())
return nullptr;
- return new WTF::URL(WTFMove(url));
+ return new WTF::URL(WTF::move(url));
}
extern "C" BunString URL__protocol(WTF::URL* url)
diff --git a/src/bun.js/bindings/ConsoleObject.cpp b/src/bun.js/bindings/ConsoleObject.cpp
index beecfc84a14cec..6d8fddae56b71c 100644
--- a/src/bun.js/bindings/ConsoleObject.cpp
+++ b/src/bun.js/bindings/ConsoleObject.cpp
@@ -35,7 +35,7 @@ void ConsoleObject::messageWithTypeAndLevel(MessageType type, MessageLevel level
Ref&& arguments)
{
if (globalObject->inspectable()) {
- if (auto* client = globalObject->inspectorController().consoleClient().get()) {
+ if (auto client = globalObject->inspectorController().consoleClient()) {
client->messageWithTypeAndLevel(type, level, globalObject, arguments.copyRef());
}
}
@@ -113,7 +113,7 @@ void ConsoleObject::warnUnimplemented(const String& method) {}
void ConsoleObject::profile(JSC::JSGlobalObject* globalObject, const String& title)
{
if (globalObject->inspectable()) {
- if (auto* client = globalObject->inspectorController().consoleClient().get()) {
+ if (auto client = globalObject->inspectorController().consoleClient()) {
client->profile(globalObject, title);
}
}
@@ -122,7 +122,7 @@ void ConsoleObject::profile(JSC::JSGlobalObject* globalObject, const String& tit
void ConsoleObject::profileEnd(JSC::JSGlobalObject* globalObject, const String& title)
{
if (globalObject->inspectable()) {
- if (auto* client = globalObject->inspectorController().consoleClient().get()) {
+ if (auto client = globalObject->inspectorController().consoleClient()) {
client->profileEnd(globalObject, title);
}
}
diff --git a/src/bun.js/bindings/CookieMap.cpp b/src/bun.js/bindings/CookieMap.cpp
index f2adb476b466f4..fa84f709398957 100644
--- a/src/bun.js/bindings/CookieMap.cpp
+++ b/src/bun.js/bindings/CookieMap.cpp
@@ -47,12 +47,12 @@ CookieMap::CookieMap()
}
CookieMap::CookieMap(Vector[>&& cookies)
- : m_modifiedCookies(WTFMove(cookies))
+ : m_modifiedCookies(WTF::move(cookies))
{
}
CookieMap::CookieMap(Vector>&& cookies)
- : m_originalCookies(WTFMove(cookies))
+ : m_originalCookies(WTF::move(cookies))
{
}
@@ -68,7 +68,7 @@ ExceptionOr][> CookieMap::create(std::variant
return Exception { TypeError, "Invalid cookie string: expected name=value pair"_s };
}
}
- return adoptRef(*new CookieMap(WTFMove(cookies)));
+ return adoptRef(*new CookieMap(WTF::move(cookies)));
},
[&](const HashMap& pairs) -> ExceptionOr][> {
Vector> cookies;
@@ -76,7 +76,7 @@ ExceptionOr][> CookieMap::create(std::variant
cookies.append(KeyValuePair(entry.key, entry.value));
}
- return adoptRef(*new CookieMap(WTFMove(cookies)));
+ return adoptRef(*new CookieMap(WTF::move(cookies)));
},
[&](const String& cookieString) -> ExceptionOr][> {
StringView forCookieHeader = cookieString;
@@ -121,7 +121,7 @@ ExceptionOr][> CookieMap::create(std::variant
cookies.append(KeyValuePair(name, value));
}
- return adoptRef(*new CookieMap(WTFMove(cookies)));
+ return adoptRef(*new CookieMap(WTF::move(cookies)));
});
return std::visit(visitor, variant);
@@ -181,7 +181,7 @@ void CookieMap::set(Ref cookie)
{
removeInternal(cookie->name());
// Add the new cookie
- m_modifiedCookies.append(WTFMove(cookie));
+ m_modifiedCookies.append(WTF::move(cookie));
}
ExceptionOr CookieMap::remove(const CookieStoreDeleteOptions& options)
@@ -198,7 +198,7 @@ ExceptionOr CookieMap::remove(const CookieStoreDeleteOptions& options)
return cookie_exception.releaseException();
}
auto cookie = cookie_exception.releaseReturnValue();
- m_modifiedCookies.append(WTFMove(cookie));
+ m_modifiedCookies.append(WTF::move(cookie));
return {};
}
diff --git a/src/bun.js/bindings/DOMFormData.cpp b/src/bun.js/bindings/DOMFormData.cpp
index 08c203585f9a11..e866c2704eb924 100644
--- a/src/bun.js/bindings/DOMFormData.cpp
+++ b/src/bun.js/bindings/DOMFormData.cpp
@@ -173,7 +173,7 @@ void DOMFormData::set(const String& name, Item&& item)
}
if (initialMatchLocation) {
- m_items[*initialMatchLocation] = WTFMove(item);
+ m_items[*initialMatchLocation] = WTF::move(item);
m_items.removeAllMatching([&name](const auto& item) {
return item.name == name;
@@ -182,7 +182,7 @@ void DOMFormData::set(const String& name, Item&& item)
return;
}
- m_items.append(WTFMove(item));
+ m_items.append(WTF::move(item));
}
DOMFormData::Iterator::Iterator(DOMFormData& target)
diff --git a/src/bun.js/bindings/DOMURL.cpp b/src/bun.js/bindings/DOMURL.cpp
index 2bfc6d43366512..61af7c63383d5d 100644
--- a/src/bun.js/bindings/DOMURL.cpp
+++ b/src/bun.js/bindings/DOMURL.cpp
@@ -56,7 +56,7 @@ static inline String redact(const String& input)
}
inline DOMURL::DOMURL(URL&& completeURL)
- : m_url(WTFMove(completeURL))
+ : m_url(WTF::move(completeURL))
, m_initialURLCostForGC(static_cast(std::min(m_url.string().impl()->costDuringGC(), std::numeric_limits::max())))
{
ASSERT(m_url.isValid());
@@ -67,7 +67,7 @@ ExceptionOr][> DOMURL::create(const String& url)
URL completeURL { url };
if (!completeURL.isValid())
return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) };
- return adoptRef(*new DOMURL(WTFMove(completeURL)));
+ return adoptRef(*new DOMURL(WTF::move(completeURL)));
}
ExceptionOr][> DOMURL::create(const String& url, const URL& base)
@@ -76,7 +76,7 @@ ExceptionOr][> DOMURL::create(const String& url, const URL& base)
URL completeURL { base, url };
if (!completeURL.isValid())
return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) };
- return adoptRef(*new DOMURL(WTFMove(completeURL)));
+ return adoptRef(*new DOMURL(WTF::move(completeURL)));
}
ExceptionOr][> DOMURL::create(const String& url, const String& base)
@@ -102,7 +102,7 @@ RefPtr DOMURL::parse(const String& url, const String& base)
auto completeURL = parseInternal(url, base);
if (!completeURL.isValid())
return {};
- return adoptRef(*new DOMURL(WTFMove(completeURL)));
+ return adoptRef(*new DOMURL(WTF::move(completeURL)));
}
bool DOMURL::canParse(const String& url, const String& base)
@@ -117,7 +117,7 @@ ExceptionOr DOMURL::setHref(const String& url)
return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) };
}
- m_url = WTFMove(completeURL);
+ m_url = WTF::move(completeURL);
if (m_searchParams)
m_searchParams->updateFromAssociatedURL();
return {};
diff --git a/src/bun.js/bindings/ErrorStackTrace.h b/src/bun.js/bindings/ErrorStackTrace.h
index faaac27a84ca99..1d8f89c70d777b 100644
--- a/src/bun.js/bindings/ErrorStackTrace.h
+++ b/src/bun.js/bindings/ErrorStackTrace.h
@@ -169,7 +169,7 @@ class JSCStackTrace {
}
JSCStackTrace(WTF::Vector&& frames)
- : m_frames(WTFMove(frames))
+ : m_frames(WTF::move(frames))
{
}
@@ -177,7 +177,7 @@ class JSCStackTrace {
bool isEmpty() const { return m_frames.isEmpty(); }
JSCStackFrame& at(size_t i) { return m_frames.at(i); }
- WTF::Vector&& frames() { return WTFMove(m_frames); }
+ WTF::Vector&& frames() { return WTF::move(m_frames); }
static JSCStackTrace fromExisting(JSC::VM& vm, const WTF::Vector& existingFrames);
@@ -203,7 +203,7 @@ class JSCStackTrace {
private:
JSCStackTrace(WTF::Vector& frames)
- : m_frames(WTFMove(frames))
+ : m_frames(WTF::move(frames))
{
}
};
diff --git a/src/bun.js/bindings/EventLoopTask.h b/src/bun.js/bindings/EventLoopTask.h
index 953fc0da851702..021c39b1a17e91 100644
--- a/src/bun.js/bindings/EventLoopTask.h
+++ b/src/bun.js/bindings/EventLoopTask.h
@@ -11,20 +11,20 @@ class EventLoopTask {
template::value && std::is_convertible>::value>::type>
EventLoopTask(T task)
- : m_task(WTFMove(task))
+ : m_task(WTF::move(task))
, m_isCleanupTask(false)
{
}
EventLoopTask(Function&& task)
- : m_task([task = WTFMove(task)](ScriptExecutionContext&) { task(); })
+ : m_task([task = WTF::move(task)](ScriptExecutionContext&) { task(); })
, m_isCleanupTask(false)
{
}
template>::value>::type>
EventLoopTask(CleanupTaskTag, T task)
- : m_task(WTFMove(task))
+ : m_task(WTF::move(task))
, m_isCleanupTask(true)
{
}
diff --git a/src/bun.js/bindings/EventLoopTaskNoContext.h b/src/bun.js/bindings/EventLoopTaskNoContext.h
index e795a23ccbfdcd..fede33f2603c50 100644
--- a/src/bun.js/bindings/EventLoopTaskNoContext.h
+++ b/src/bun.js/bindings/EventLoopTaskNoContext.h
@@ -12,7 +12,7 @@ class EventLoopTaskNoContext {
public:
EventLoopTaskNoContext(JSC::JSGlobalObject* globalObject, Function&& task)
: m_createdInBunVm(defaultGlobalObject(globalObject)->bunVM())
- , m_task(WTFMove(task))
+ , m_task(WTF::move(task))
{
}
diff --git a/src/bun.js/bindings/Exception.h b/src/bun.js/bindings/Exception.h
index e14b1e01a1fab2..a5b09e9bf40a01 100644
--- a/src/bun.js/bindings/Exception.h
+++ b/src/bun.js/bindings/Exception.h
@@ -39,7 +39,7 @@ class Exception {
ExceptionCode code() const { return m_code; }
const String& message() const { return m_message; }
- String&& releaseMessage() { return WTFMove(m_message); }
+ String&& releaseMessage() { return WTF::move(m_message); }
Exception isolatedCopy() const
{
@@ -55,7 +55,7 @@ Exception isolatedCopy(Exception&&);
inline Exception::Exception(ExceptionCode code, String message)
: m_code { code }
- , m_message { WTFMove(message) }
+ , m_message { WTF::move(message) }
{
}
diff --git a/src/bun.js/bindings/ExceptionOr.h b/src/bun.js/bindings/ExceptionOr.h
index aed54f73755b12..adad6fe19f2bab 100644
--- a/src/bun.js/bindings/ExceptionOr.h
+++ b/src/bun.js/bindings/ExceptionOr.h
@@ -92,12 +92,12 @@ template<> class ExceptionOr {
ExceptionOr isolatedCopy(ExceptionOr&&);
template inline ExceptionOr::ExceptionOr(Exception&& exception)
- : m_value(makeUnexpected(WTFMove(exception)))
+ : m_value(makeUnexpected(WTF::move(exception)))
{
}
template inline ExceptionOr::ExceptionOr(ReturnType&& returnValue)
- : m_value(WTFMove(returnValue))
+ : m_value(WTF::move(returnValue))
{
}
@@ -118,7 +118,7 @@ template inline const Exception& ExceptionOr::e
template inline Exception ExceptionOr::releaseException()
{
- return WTFMove(m_value.error());
+ return WTF::move(m_value.error());
}
template inline const ReturnType& ExceptionOr::returnValue() const
@@ -128,11 +128,11 @@ template inline const ReturnType& ExceptionOr::
template inline ReturnType ExceptionOr::releaseReturnValue()
{
- return WTFMove(m_value.value());
+ return WTF::move(m_value.value());
}
template inline ExceptionOr::ExceptionOr(Exception&& exception)
- : m_value(WTFMove(exception))
+ : m_value(WTF::move(exception))
{
}
@@ -167,7 +167,7 @@ template inline ReturnReferenceType& ExceptionOr::ExceptionOr(Exception&& exception)
- : m_value(makeUnexpected(WTFMove(exception)))
+ : m_value(makeUnexpected(WTF::move(exception)))
{
}
@@ -183,7 +183,7 @@ inline const Exception& ExceptionOr::exception() const
inline Exception ExceptionOr::releaseException()
{
- return WTFMove(m_value.error());
+ return WTF::move(m_value.error());
}
inline ExceptionOr isolatedCopy(ExceptionOr&& value)
diff --git a/src/bun.js/bindings/FormatStackTraceForJS.cpp b/src/bun.js/bindings/FormatStackTraceForJS.cpp
index c570432ea3aec1..bd53f19267d16b 100644
--- a/src/bun.js/bindings/FormatStackTraceForJS.cpp
+++ b/src/bun.js/bindings/FormatStackTraceForJS.cpp
@@ -687,7 +687,7 @@ JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncCaptureStackTrace, (JSC::JSGlobalOb
JSCStackTrace::getFramesForCaller(vm, callFrame, errorObject, caller, stackTrace, stackTraceLimit);
if (auto* instance = jsDynamicCast(errorObject)) {
- instance->setStackFrames(vm, WTFMove(stackTrace));
+ instance->setStackFrames(vm, WTF::move(stackTrace));
if (instance->hasMaterializedErrorInfo()) {
const auto& propertyName = vm.propertyNames->stack;
VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
diff --git a/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp b/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp
index 81039a09de7e3b..4cc5e4c659356b 100644
--- a/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp
+++ b/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp
@@ -82,7 +82,7 @@ void InspectorBunFrontendDevServerAgent::bundleStart(int devServerId, RefbundleStart(devServerId, WTFMove(triggerFiles));
+ m_frontendDispatcher->bundleStart(devServerId, WTF::move(triggerFiles));
}
void InspectorBunFrontendDevServerAgent::bundleComplete(int devServerId, double durationMs)
@@ -106,7 +106,7 @@ void InspectorBunFrontendDevServerAgent::clientNavigated(int devServerId, int co
if (!m_enabled || !m_frontendDispatcher)
return;
- m_frontendDispatcher->clientNavigated(devServerId, connectionId, url, WTFMove(routeBundleId));
+ m_frontendDispatcher->clientNavigated(devServerId, connectionId, url, WTF::move(routeBundleId));
}
void InspectorBunFrontendDevServerAgent::clientErrorReported(int devServerId, const String& clientErrorPayloadBase64)
@@ -154,7 +154,7 @@ void InspectorBunFrontendDevServerAgent__notifyBundleStart(InspectorBunFrontendD
files->addItem(triggerFiles[i].transferToWTFString());
}
- agent->bundleStart(devServerId, WTFMove(files));
+ agent->bundleStart(devServerId, WTF::move(files));
}
void InspectorBunFrontendDevServerAgent__notifyBundleComplete(InspectorBunFrontendDevServerAgent* agent, int devServerId, double durationMs)
diff --git a/src/bun.js/bindings/InspectorHTTPServerAgent.cpp b/src/bun.js/bindings/InspectorHTTPServerAgent.cpp
index cc376d13ac9822..e1e12784982657 100644
--- a/src/bun.js/bindings/InspectorHTTPServerAgent.cpp
+++ b/src/bun.js/bindings/InspectorHTTPServerAgent.cpp
@@ -132,7 +132,7 @@ void InspectorHTTPServerAgent::serverRoutesUpdated(int serverId, int hotReloadId
return;
}
- this->m_frontendDispatcher->serverRoutesUpdated(serverId, hotReloadId, WTFMove(routes));
+ this->m_frontendDispatcher->serverRoutesUpdated(serverId, hotReloadId, WTF::move(routes));
}
void InspectorHTTPServerAgent::requestWillBeSent(Ref&& request)
{
@@ -140,7 +140,7 @@ void InspectorHTTPServerAgent::requestWillBeSent(Refm_frontendDispatcher->requestWillBeSent(WTFMove(request));
+ this->m_frontendDispatcher->requestWillBeSent(WTF::move(request));
}
void InspectorHTTPServerAgent::responseReceived(Ref&& response)
{
@@ -148,7 +148,7 @@ void InspectorHTTPServerAgent::responseReceived(Refm_frontendDispatcher->responseReceived(WTFMove(response));
+ this->m_frontendDispatcher->responseReceived(WTF::move(response));
}
void InspectorHTTPServerAgent::bodyChunkReceived(Ref&& chunk)
{
@@ -156,7 +156,7 @@ void InspectorHTTPServerAgent::bodyChunkReceived(Refm_frontendDispatcher->bodyChunkReceived(WTFMove(chunk));
+ this->m_frontendDispatcher->bodyChunkReceived(WTF::move(chunk));
}
void InspectorHTTPServerAgent::requestFinished(int requestId, int serverId, double timestamp, std::optional&& opt_duration)
{
@@ -164,7 +164,7 @@ void InspectorHTTPServerAgent::requestFinished(int requestId, int serverId, doub
return;
}
- this->m_frontendDispatcher->requestFinished(requestId, serverId, timestamp, WTFMove(opt_duration));
+ this->m_frontendDispatcher->requestFinished(requestId, serverId, timestamp, WTF::move(opt_duration));
}
void InspectorHTTPServerAgent::requestHandlerException(Ref&& error)
{
@@ -172,7 +172,7 @@ void InspectorHTTPServerAgent::requestHandlerException(Refm_frontendDispatcher->requestHandlerException(WTFMove(error));
+ this->m_frontendDispatcher->requestHandlerException(WTF::move(error));
}
}
@@ -258,9 +258,9 @@ struct Route {
object->setScriptUrl(route.script_url.toWTFString());
}
- routes->addItem(WTFMove(object));
+ routes->addItem(WTF::move(object));
}
- agent->serverRoutesUpdated(serverId, hotReloadId, WTFMove(routes));
+ agent->serverRoutesUpdated(serverId, hotReloadId, WTF::move(routes));
}
}
diff --git a/src/bun.js/bindings/InspectorLifecycleAgent.cpp b/src/bun.js/bindings/InspectorLifecycleAgent.cpp
index 67ae9822990c04..e3c24a1f9a75b3 100644
--- a/src/bun.js/bindings/InspectorLifecycleAgent.cpp
+++ b/src/bun.js/bindings/InspectorLifecycleAgent.cpp
@@ -122,7 +122,7 @@ void InspectorLifecycleAgent::reportError(ZigException& exception)
}
// error(const String& message, const String& name, Ref>&& urls, Ref>&& lineColumns, Ref>&& sourceLines);
- m_frontendDispatcher->error(WTFMove(message), WTFMove(name), WTFMove(urls), WTFMove(lineColumns), WTFMove(sourceLines));
+ m_frontendDispatcher->error(WTF::move(message), WTF::move(name), WTF::move(urls), WTF::move(lineColumns), WTF::move(sourceLines));
}
Protocol::ErrorStringOr InspectorLifecycleAgent::preventExit()
@@ -206,7 +206,7 @@ Protocol::ErrorStringOr InspectorLifecycleAgent::getModuleGraph()
RETURN_IF_EXCEPTION(scope, makeUnexpected(ErrorString("Failed to convert value to string"_s)));
}
- return ModuleGraph { WTFMove(esm), WTFMove(cjs), WTFMove(cwd), WTFMove(main), WTFMove(argv) };
+ return ModuleGraph { WTF::move(esm), WTF::move(cjs), WTF::move(cwd), WTF::move(main), WTF::move(argv) };
}
}
diff --git a/src/bun.js/bindings/InternalModuleRegistry.cpp b/src/bun.js/bindings/InternalModuleRegistry.cpp
index 1b0837ae734bf6..4e4f6fb428bf9d 100644
--- a/src/bun.js/bindings/InternalModuleRegistry.cpp
+++ b/src/bun.js/bindings/InternalModuleRegistry.cpp
@@ -100,7 +100,7 @@ ALWAYS_INLINE JSC::JSValue generateNativeModule(
#ifdef BUN_DYNAMIC_JS_LOAD_PATH
JSValue initializeInternalModuleFromDisk(JSGlobalObject* globalObject, VM& vm, const WTF::String& moduleName, WTF::String fileBase, const WTF::String& urlString)
{
- WTF::String file = makeString(ASCIILiteral::fromLiteralUnsafe(BUN_DYNAMIC_JS_LOAD_PATH), "/"_s, WTFMove(fileBase));
+ WTF::String file = makeString(ASCIILiteral::fromLiteralUnsafe(BUN_DYNAMIC_JS_LOAD_PATH), "/"_s, WTF::move(fileBase));
if (auto contents = WTF::FileSystemImpl::readEntireFile(file)) {
auto string = WTF::String::fromUTF8(contents.value());
return generateModule(globalObject, vm, string, moduleName, urlString);
diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp
index e3be045a44dc9e..867a689fbac42e 100644
--- a/src/bun.js/bindings/JSBuffer.cpp
+++ b/src/bun.js/bindings/JSBuffer.cpp
@@ -80,6 +80,10 @@
extern "C" bool Bun__Node__ZeroFillBuffers;
+// SIMD-optimized search functions from highway_strings.cpp
+extern "C" void* highway_memmem(const uint8_t* haystack, size_t haystack_len, const uint8_t* needle, size_t needle_len);
+extern "C" size_t highway_index_of_char(const uint8_t* haystack, size_t haystack_len, uint8_t needle);
+
// export fn Bun__inspect_singleline(globalThis: *JSGlobalObject, value: JSValue) bun.String
extern "C" BunString Bun__inspect_singleline(JSC::JSGlobalObject* globalObject, JSC::JSValue value);
@@ -352,7 +356,7 @@ JSC::EncodedJSValue JSBuffer__bufferFromPointerAndLengthAndDeinit(JSC::JSGlobalO
bytesDeallocator(p, ctx);
}));
- uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), 0, length);
+ uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), 0, length);
} else {
uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, 0);
}
@@ -409,7 +413,7 @@ static JSC::EncodedJSValue writeToBuffer(JSC::JSGlobalObject* lexicalGlobalObjec
JSC::JSUint8Array* createBuffer(JSC::JSGlobalObject* lexicalGlobalObject, Ref&& backingStore)
{
size_t length = backingStore->byteLength();
- return JSC::JSUint8Array::create(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject)->JSBufferSubclassStructure(), WTFMove(backingStore), 0, length);
+ return JSC::JSUint8Array::create(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject)->JSBufferSubclassStructure(), WTF::move(backingStore), 0, length);
}
JSC::JSUint8Array* createBuffer(JSC::JSGlobalObject* lexicalGlobalObject, const uint8_t* ptr, size_t length)
@@ -1377,11 +1381,20 @@ static ssize_t indexOfOffset(size_t length, ssize_t offset_i64, ssize_t needle_l
static int64_t indexOf(const uint8_t* thisPtr, int64_t thisLength, const uint8_t* valuePtr, int64_t valueLength, int64_t byteOffset)
{
- auto haystack = std::span(thisPtr, thisLength).subspan(byteOffset);
- auto needle = std::span(valuePtr, valueLength);
- auto it = std::search(haystack.begin(), haystack.end(), needle.begin(), needle.end());
- if (it == haystack.end()) return -1;
- return byteOffset + std::distance(haystack.begin(), it);
+ const size_t haystackLen = static_cast(thisLength - byteOffset);
+ const uint8_t* haystackPtr = thisPtr + byteOffset;
+
+ if (valueLength == 1) {
+ // Use SIMD-optimized single-byte search
+ size_t result = highway_index_of_char(haystackPtr, haystackLen, valuePtr[0]);
+ if (result == haystackLen) return -1;
+ return byteOffset + static_cast(result);
+ }
+
+ // Use SIMD-optimized multi-byte search
+ void* result = highway_memmem(haystackPtr, haystackLen, valuePtr, static_cast(valueLength));
+ if (result == nullptr) return -1;
+ return byteOffset + static_cast(static_cast(result) - haystackPtr);
}
static int64_t indexOf16(const uint8_t* thisPtr, int64_t thisLength, const uint8_t* valuePtr, int64_t valueLength, int64_t byteOffset)
@@ -1771,7 +1784,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec
}
memcpy(data.data(), bytes.data(), bytes.size());
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
case BufferEncodingType::ucs2:
case BufferEncodingType::utf16le: {
@@ -1786,7 +1799,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec
return {};
}
memcpy(reinterpret_cast(data.data()), bytes.data(), u16length * 2);
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
case BufferEncodingType::ascii: {
std::span data;
@@ -1796,7 +1809,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec
return {};
}
Bun__encoding__writeLatin1(bytes.data(), bytes.size(), data.data(), data.size(), static_cast(encoding));
- return JSValue::encode(jsString(vm, WTFMove(str)));
+ return JSValue::encode(jsString(vm, WTF::move(str)));
}
case WebCore::BufferEncodingType::utf8:
@@ -2167,7 +2180,7 @@ extern "C" JSC::EncodedJSValue JSBuffer__fromMmap(Zig::GlobalObject* globalObjec
#endif
}));
- auto* view = JSC::JSUint8Array::create(globalObject, structure, WTFMove(buffer), 0, length);
+ auto* view = JSC::JSUint8Array::create(globalObject, structure, WTF::move(buffer), 0, length);
RETURN_IF_EXCEPTION(scope, {});
if (!view) [[unlikely]] {
@@ -2889,7 +2902,7 @@ EncodedJSValue constructBufferFromArrayBuffer(JSC::ThrowScope& throwScope, JSGlo
auto isResizableOrGrowableShared = jsBuffer->isResizableOrGrowableShared();
if (isResizableOrGrowableShared) {
auto* subclassStructure = globalObject->JSResizableOrGrowableSharedBufferSubclassStructure();
- auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), offset, std::nullopt);
+ auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), offset, std::nullopt);
RETURN_IF_EXCEPTION(throwScope, {});
if (!uint8Array) [[unlikely]] {
throwOutOfMemoryError(globalObject, throwScope);
@@ -2898,7 +2911,7 @@ EncodedJSValue constructBufferFromArrayBuffer(JSC::ThrowScope& throwScope, JSGlo
RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(uint8Array));
}
auto* subclassStructure = globalObject->JSBufferSubclassStructure();
- auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), offset, length);
+ auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), offset, length);
RETURN_IF_EXCEPTION(throwScope, {});
if (!uint8Array) [[unlikely]] {
throwOutOfMemoryError(globalObject, throwScope);
diff --git a/src/bun.js/bindings/JSBunRequest.cpp b/src/bun.js/bindings/JSBunRequest.cpp
index f72f54a40f07d5..1a40d64dc26035 100644
--- a/src/bun.js/bindings/JSBunRequest.cpp
+++ b/src/bun.js/bindings/JSBunRequest.cpp
@@ -132,7 +132,7 @@ JSBunRequest* JSBunRequest::clone(JSC::VM& vm, JSGlobalObject* globalObject)
if (auto* wrapper = jsDynamicCast(cookiesObject)) {
auto cookieMap = wrapper->protectedWrapped();
auto cookieMapClone = cookieMap->clone();
- auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTFMove(cookieMapClone));
+ auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTF::move(cookieMapClone));
clone->setCookies(cookies.getObject());
}
}
@@ -266,7 +266,7 @@ JSC_DEFINE_CUSTOM_GETTER(jsJSBunRequestGetCookies, (JSC::JSGlobalObject * global
auto cookieMap = cookieMapResult.releaseReturnValue();
// Convert to JS
- auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTFMove(cookieMap));
+ auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTF::move(cookieMap));
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
request->setCookies(cookies.getObject());
return JSValue::encode(cookies);
diff --git a/src/bun.js/bindings/JSBundlerPlugin.cpp b/src/bun.js/bindings/JSBundlerPlugin.cpp
index 3bd323e2ef038c..c1152b494fe068 100644
--- a/src/bun.js/bindings/JSBundlerPlugin.cpp
+++ b/src/bun.js/bindings/JSBundlerPlugin.cpp
@@ -71,7 +71,7 @@ void BundlerPlugin::NamespaceList::append(JSC::VM& vm, JSC::RegExp* filter, Stri
auto pattern = filter->pattern();
auto filter_regexp = FilterRegExp(pattern, filter->flags());
- nsGroup->append(WTFMove(filter_regexp));
+ nsGroup->append(WTF::move(filter_regexp));
}
static bool anyMatchesForNamespace(JSC::VM& vm, BundlerPlugin::NamespaceList& list, const BunString* namespaceStr, const BunString* path)
@@ -260,7 +260,7 @@ void BundlerPlugin::NativePluginList::append(JSC::VM& vm, JSC::RegExp* filter, S
auto pattern = filter->pattern();
auto filter_regexp = FilterRegExp(pattern, filter->flags());
- nsGroup->append(WTFMove(filter_regexp));
+ nsGroup->append(WTF::move(filter_regexp));
}
if (index == std::numeric_limits::max()) {
diff --git a/src/bun.js/bindings/JSBundlerPlugin.h b/src/bun.js/bindings/JSBundlerPlugin.h
index 34fb3130758fdc..ee59d1e61441c0 100644
--- a/src/bun.js/bindings/JSBundlerPlugin.h
+++ b/src/bun.js/bindings/JSBundlerPlugin.h
@@ -29,8 +29,8 @@ class BundlerPlugin final {
WTF::Lock lock {};
FilterRegExp(FilterRegExp&& other)
- : m_pattern(WTFMove(other.m_pattern))
- , regex(WTFMove(other.regex))
+ : m_pattern(WTF::move(other.m_pattern))
+ , regex(WTF::move(other.regex))
{
}
diff --git a/src/bun.js/bindings/JSCTaskScheduler.cpp b/src/bun.js/bindings/JSCTaskScheduler.cpp
index 7652caabef7a54..171b5c4edc19a9 100644
--- a/src/bun.js/bindings/JSCTaskScheduler.cpp
+++ b/src/bun.js/bindings/JSCTaskScheduler.cpp
@@ -16,8 +16,8 @@ extern "C" void Bun__eventLoop__incrementRefConcurrently(void* bunVM, int delta)
class JSCDeferredWorkTask {
public:
JSCDeferredWorkTask(Ref ticket, Task&& task)
- : ticket(WTFMove(ticket))
- , task(WTFMove(task))
+ : ticket(WTF::move(ticket))
+ , task(WTF::move(task))
{
}
@@ -43,14 +43,14 @@ void JSCTaskScheduler::onAddPendingWork(WebCore::JSVMClientData* clientData, Ref
Locker holder { scheduler.m_lock };
if (kind == DeferredWorkTimer::WorkType::ImminentlyScheduled) {
Bun__eventLoop__incrementRefConcurrently(clientData->bunVM, 1);
- scheduler.m_pendingTicketsKeepingEventLoopAlive.add(WTFMove(ticket));
+ scheduler.m_pendingTicketsKeepingEventLoopAlive.add(WTF::move(ticket));
} else {
- scheduler.m_pendingTicketsOther.add(WTFMove(ticket));
+ scheduler.m_pendingTicketsOther.add(WTF::move(ticket));
}
}
void JSCTaskScheduler::onScheduleWorkSoon(WebCore::JSVMClientData* clientData, Ticket ticket, Task&& task)
{
- auto* job = new JSCDeferredWorkTask(*ticket, WTFMove(task));
+ auto* job = new JSCDeferredWorkTask(*ticket, WTF::move(task));
Bun__queueJSCDeferredWorkTaskConcurrently(clientData->bunVM, job);
}
diff --git a/src/bun.js/bindings/JSCommonJSModule.cpp b/src/bun.js/bindings/JSCommonJSModule.cpp
index b6000602bc9a2f..095d305e661a52 100644
--- a/src/bun.js/bindings/JSCommonJSModule.cpp
+++ b/src/bun.js/bindings/JSCommonJSModule.cpp
@@ -112,7 +112,7 @@ extern "C" void Bun__VM__setEntryPointEvalResultCJS(void*, EncodedJSValue);
static bool evaluateCommonJSModuleOnce(JSC::VM& vm, Zig::GlobalObject* globalObject, JSCommonJSModule* moduleObject, JSString* dirname, JSValue filename)
{
auto scope = DECLARE_THROW_SCOPE(vm);
- SourceCode code = std::move(moduleObject->sourceCode);
+ SourceCode code = WTF::move(moduleObject->sourceCode);
// If an exception occurred somewhere else, we might have cleared the source code.
if (code.isNull()) [[unlikely]] {
@@ -715,7 +715,7 @@ JSC_DEFINE_HOST_FUNCTION(functionJSCommonJSModule_compile, (JSGlobalObject * glo
}
moduleObject->sourceCode = makeSource(
- WTFMove(wrappedString),
+ WTF::move(wrappedString),
SourceOrigin(URL::fileURLWithFileSystemPath(filenameString)),
JSC::SourceTaintedOrigin::Untainted,
filenameString,
@@ -1365,7 +1365,7 @@ void JSCommonJSModule::evaluate(
if (this->hasEvaluated)
return;
- this->sourceCode = JSC::SourceCode(WTFMove(sourceProvider));
+ this->sourceCode = JSC::SourceCode(WTF::move(sourceProvider));
evaluateCommonJSModuleOnce(vm, globalObject, this, this->m_dirname.get(), this->m_filename.get());
}
@@ -1466,7 +1466,7 @@ std::optional createCommonJSModule(
moduleObject = JSCommonJSModule::create(
vm,
globalObject->CommonJSModuleObjectStructure(),
- requireMapKey, filename, dirname, WTFMove(JSC::SourceCode(WTFMove(sourceProvider))));
+ requireMapKey, filename, dirname, JSC::SourceCode(WTF::move(sourceProvider)));
moduleObject->putDirect(vm,
WebCore::clientData(vm)->builtinNames().exportsPublicName(),
diff --git a/src/bun.js/bindings/JSDOMExceptionHandling.cpp b/src/bun.js/bindings/JSDOMExceptionHandling.cpp
index f2dc43508652c6..2b8bd8a3abd03c 100644
--- a/src/bun.js/bindings/JSDOMExceptionHandling.cpp
+++ b/src/bun.js/bindings/JSDOMExceptionHandling.cpp
@@ -212,7 +212,7 @@ JSValue createDOMException(JSGlobalObject& lexicalGlobalObject, Exception&& exce
void propagateExceptionSlowPath(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, Exception&& exception)
{
throwScope.assertNoExceptionExceptTermination();
- auto jsException = createDOMException(lexicalGlobalObject, WTFMove(exception));
+ auto jsException = createDOMException(lexicalGlobalObject, WTF::move(exception));
RETURN_IF_EXCEPTION(throwScope, );
throwException(&lexicalGlobalObject, throwScope, jsException);
}
diff --git a/src/bun.js/bindings/JSDOMExceptionHandling.h b/src/bun.js/bindings/JSDOMExceptionHandling.h
index 600673927e658d..7f04a6efdec7f5 100644
--- a/src/bun.js/bindings/JSDOMExceptionHandling.h
+++ b/src/bun.js/bindings/JSDOMExceptionHandling.h
@@ -80,7 +80,7 @@ ALWAYS_INLINE void propagateException(JSC::JSGlobalObject& lexicalGlobalObject,
{
if (throwScope.exception())
return;
- propagateExceptionSlowPath(lexicalGlobalObject, throwScope, WTFMove(exception));
+ propagateExceptionSlowPath(lexicalGlobalObject, throwScope, WTF::move(exception));
}
inline void propagateException(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, ExceptionOr&& value)
@@ -91,7 +91,7 @@ inline void propagateException(JSC::JSGlobalObject& lexicalGlobalObject, JSC::Th
ALWAYS_INLINE void propagateException(JSC::JSGlobalObject* lexicalGlobalObject, JSC::ThrowScope& throwScope, Exception&& exception)
{
- return propagateException(*lexicalGlobalObject, throwScope, WTFMove(exception));
+ return propagateException(*lexicalGlobalObject, throwScope, WTF::move(exception));
}
template void invokeFunctorPropagatingExceptionIfNecessary(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, Functor&& functor)
diff --git a/src/bun.js/bindings/JSDOMWrapper.h b/src/bun.js/bindings/JSDOMWrapper.h
index bff0179a4586ac..d27d0c24c324a5 100644
--- a/src/bun.js/bindings/JSDOMWrapper.h
+++ b/src/bun.js/bindings/JSDOMWrapper.h
@@ -91,7 +91,7 @@ class JSDOMWrapper : public JSDOMObject {
protected:
JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject& globalObject, Ref&& impl)
: Base(structure, globalObject)
- , m_wrapped(WTFMove(impl))
+ , m_wrapped(WTF::move(impl))
{
}
diff --git a/src/bun.js/bindings/JSDOMWrapperCache.h b/src/bun.js/bindings/JSDOMWrapperCache.h
index 11795651a04553..7397ae993c346d 100644
--- a/src/bun.js/bindings/JSDOMWrapperCache.h
+++ b/src/bun.js/bindings/JSDOMWrapperCache.h
@@ -186,14 +186,14 @@ template inline auto createWrapper(JSDOMGlobalObj
ASSERT(!getCachedWrapper(globalObject->world(), domObject));
auto* domObjectPtr = domObject.ptr();
- auto* wrapper = WrapperClass::create(getDOMStructure(globalObject->vm(), *globalObject), globalObject, WTFMove(domObject));
+ auto* wrapper = WrapperClass::create(getDOMStructure(globalObject->vm(), *globalObject), globalObject, WTF::move(domObject));
cacheWrapper(globalObject->world(), domObjectPtr, wrapper);
return wrapper;
}
template inline auto createWrapper(JSDOMGlobalObject* globalObject, Ref&& domObject) -> typename std::enable_if::value, typename JSDOMWrapperConverterTraits::WrapperClass*>::type
{
- return createWrapper(globalObject, unsafeRefDowncast(WTFMove(domObject)));
+ return createWrapper(globalObject, unsafeRefDowncast(WTF::move(domObject)));
}
template inline JSC::JSValue wrap(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, DOMClass& domObject)
diff --git a/src/bun.js/bindings/JSFFIFunction.cpp b/src/bun.js/bindings/JSFFIFunction.cpp
index 0a66f7366587e4..292f15e875770d 100644
--- a/src/bun.js/bindings/JSFFIFunction.cpp
+++ b/src/bun.js/bindings/JSFFIFunction.cpp
@@ -127,7 +127,7 @@ const ClassInfo JSFFIFunction::s_info = { "Function"_s, &Base::s_info, nullptr,
JSFFIFunction::JSFFIFunction(VM& vm, NativeExecutable* executable, JSGlobalObject* globalObject, Structure* structure, CFFIFunction&& function)
: Base(vm, executable, globalObject, structure)
- , m_function(WTFMove(function))
+ , m_function(WTF::move(function))
{
// used in NAPI
dataPtr = nullptr;
@@ -153,7 +153,7 @@ JSFFIFunction* JSFFIFunction::create(VM& vm, Zig::GlobalObject* globalObject, un
{
NativeExecutable* executable = vm.getHostFunction(FFIFunction, ImplementationVisibility::Public, intrinsic, FFIFunction, nullptr, name);
Structure* structure = globalObject->FFIFunctionStructure();
- JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTFMove(FFIFunction)));
+ JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTF::move(FFIFunction)));
function->finishCreation(vm, executable, length, name);
return function;
}
@@ -176,7 +176,7 @@ JSFFIFunction* JSFFIFunction::createForFFI(VM& vm, Zig::GlobalObject* globalObje
NativeExecutable* executable = vm.getHostFunction(FFIFunction, ImplementationVisibility::Public, NoIntrinsic, FFIFunction, nullptr, name);
#endif
Structure* structure = globalObject->FFIFunctionStructure();
- JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTFMove(FFIFunction)));
+ JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTF::move(FFIFunction)));
function->finishCreation(vm, executable, length, name);
return function;
}
@@ -212,7 +212,7 @@ FFI_Callback_threadsafe_call(FFICallbackFunctionWrapper& wrapper, size_t argCoun
for (size_t i = 0; i < argCount; ++i)
argsVec.append(args[i]);
- WebCore::ScriptExecutionContext::postTaskTo(globalObject->scriptExecutionContext()->identifier(), [argsVec = WTFMove(argsVec), wrapper](WebCore::ScriptExecutionContext& ctx) mutable {
+ WebCore::ScriptExecutionContext::postTaskTo(globalObject->scriptExecutionContext()->identifier(), [argsVec = WTF::move(argsVec), wrapper](WebCore::ScriptExecutionContext& ctx) mutable {
auto* globalObject = JSC::jsCast(ctx.jsGlobalObject());
auto& vm = JSC::getVM(globalObject);
JSC::MarkedArgumentBuffer arguments;
diff --git a/src/bun.js/bindings/JSSecrets.cpp b/src/bun.js/bindings/JSSecrets.cpp
index 94fd771a8c5387..f86093ec528416 100644
--- a/src/bun.js/bindings/JSSecrets.cpp
+++ b/src/bun.js/bindings/JSSecrets.cpp
@@ -246,13 +246,13 @@ void Bun__SecretsJobOptions__runTask(SecretsJobOptions* opts, JSGlobalObject* gl
auto result = Secrets::getPassword(opts->service, opts->name, opts->error);
if (result.has_value()) {
// Store as String for main thread (String is thread-safe to construct from CString)
- opts->resultPassword = WTFMove(result.value());
+ opts->resultPassword = WTF::move(result.value());
}
break;
}
case SecretsJobOptions::SET:
- opts->error = Secrets::setPassword(opts->service, opts->name, WTFMove(opts->password), opts->allowUnrestrictedAccess);
+ opts->error = Secrets::setPassword(opts->service, opts->name, WTF::move(opts->password), opts->allowUnrestrictedAccess);
break;
case SecretsJobOptions::DELETE_OP:
@@ -288,7 +288,7 @@ void Bun__SecretsJobOptions__runFromJS(SecretsJobOptions* opts, JSGlobalObject*
switch (opts->op) {
case SecretsJobOptions::GET:
if (opts->resultPassword.has_value()) {
- auto resultPassword = WTFMove(opts->resultPassword.value());
+ auto resultPassword = WTF::move(opts->resultPassword.value());
result = jsString(vm, String::fromUTF8(resultPassword.span()));
RETURN_IF_EXCEPTION(scope, );
memsetSpan(resultPassword.mutableSpan(), 0);
diff --git a/src/bun.js/bindings/JSStringDecoder.cpp b/src/bun.js/bindings/JSStringDecoder.cpp
index 14b8e51da46802..4d6186509d303e 100644
--- a/src/bun.js/bindings/JSStringDecoder.cpp
+++ b/src/bun.js/bindings/JSStringDecoder.cpp
@@ -486,7 +486,7 @@ static JSC_DEFINE_CUSTOM_GETTER(jsStringDecoder_lastChar, (JSGlobalObject * lexi
RETURN_IF_EXCEPTION(scope, {});
auto buffer = ArrayBuffer::create({ castedThis->m_lastChar, 4 });
auto* globalObject = static_cast(lexicalGlobalObject);
- JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(buffer), 0, 4);
+ JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(buffer), 0, 4);
RELEASE_AND_RETURN(scope, JSC::JSValue::encode(uint8Array));
}
static JSC_DEFINE_CUSTOM_GETTER(jsStringDecoder_lastNeed, (JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, PropertyName attributeName))
diff --git a/src/bun.js/bindings/JSValue.zig b/src/bun.js/bindings/JSValue.zig
index fe8b178dc1d2ff..8d911d6ecced73 100644
--- a/src/bun.js/bindings/JSValue.zig
+++ b/src/bun.js/bindings/JSValue.zig
@@ -1202,6 +1202,15 @@ pub const JSValue = enum(i64) {
return bun.jsc.fromJSHostCallGeneric(globalThis, @src(), JSC__JSValue__jsonStringify, .{ this, globalThis, indent, out });
}
+ extern fn JSC__JSValue__jsonStringifyFast(this: JSValue, globalThis: *JSGlobalObject, out: *bun.String) void;
+
+ /// Fast version of JSON.stringify that uses JSC's FastStringifier optimization.
+ /// When space is undefined (as opposed to 0), JSC uses a highly optimized SIMD-based
+ /// serialization path. This is significantly faster for most common use cases.
+ pub fn jsonStringifyFast(this: JSValue, globalThis: *JSGlobalObject, out: *bun.String) bun.JSError!void {
+ return bun.jsc.fromJSHostCallGeneric(globalThis, @src(), JSC__JSValue__jsonStringifyFast, .{ this, globalThis, out });
+ }
+
/// Call `toString()` on the JSValue and clone the result.
pub fn toSliceOrNull(this: JSValue, globalThis: *JSGlobalObject) bun.JSError!ZigString.Slice {
const str = try bun.String.fromJS(this, globalThis);
diff --git a/src/bun.js/bindings/JSX509Certificate.cpp b/src/bun.js/bindings/JSX509Certificate.cpp
index 36058482cfcfa2..0dfee0257510f0 100644
--- a/src/bun.js/bindings/JSX509Certificate.cpp
+++ b/src/bun.js/bindings/JSX509Certificate.cpp
@@ -265,13 +265,13 @@ JSX509Certificate* JSX509Certificate::create(JSC::VM& vm, JSC::Structure* struct
return nullptr;
}
- return create(vm, structure, globalObject, WTFMove(result.value));
+ return create(vm, structure, globalObject, WTF::move(result.value));
}
JSX509Certificate* JSX509Certificate::create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, ncrypto::X509Pointer&& cert)
{
auto* certificate = create(vm, structure);
- certificate->m_x509 = WTFMove(cert);
+ certificate->m_x509 = WTF::move(cert);
size_t size = i2d_X509(certificate->m_x509.get(), nullptr);
certificate->m_extraMemorySizeForGC = size;
vm.heap.reportExtraMemoryAllocated(certificate, size);
@@ -573,7 +573,7 @@ JSUint8Array* JSX509Certificate::computeRaw(ncrypto::X509View view, JSGlobalObje
Ref buffer = JSC::ArrayBuffer::createFromBytes(std::span(reinterpret_cast(bptr->data), bptr->length), createSharedTask([](void* data) {
ncrypto::BIOPointer free_me(static_cast(data));
}));
- RELEASE_AND_RETURN(scope, Bun::createBuffer(globalObject, WTFMove(buffer)));
+ RELEASE_AND_RETURN(scope, Bun::createBuffer(globalObject, WTF::move(buffer)));
}
bool JSX509Certificate::computeIsCA(ncrypto::X509View view, JSGlobalObject* globalObject)
@@ -1046,8 +1046,8 @@ JSValue JSX509Certificate::computePublicKey(ncrypto::X509View view, JSGlobalObje
return {};
}
- auto handle = KeyObject::create(CryptoKeyType::Public, WTFMove(result.value));
- return JSPublicKeyObject::create(vm, globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject), lexicalGlobalObject, WTFMove(handle));
+ auto handle = KeyObject::create(CryptoKeyType::Public, WTF::move(result.value));
+ return JSPublicKeyObject::create(vm, globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject), lexicalGlobalObject, WTF::move(handle));
}
JSValue JSX509Certificate::computeInfoAccess(ncrypto::X509View view, JSGlobalObject* globalObject, bool legacy)
@@ -1171,7 +1171,7 @@ extern "C" EncodedJSValue Bun__X509__toJS(X509* cert, JSGlobalObject* globalObje
{
ncrypto::X509Pointer cert_ptr(cert);
auto* zigGlobalObject = defaultGlobalObject(globalObject);
- return JSValue::encode(JSX509Certificate::create(zigGlobalObject->vm(), zigGlobalObject->m_JSX509CertificateClassStructure.get(zigGlobalObject), globalObject, WTFMove(cert_ptr)));
+ return JSValue::encode(JSX509Certificate::create(zigGlobalObject->vm(), zigGlobalObject->m_JSX509CertificateClassStructure.get(zigGlobalObject), globalObject, WTF::move(cert_ptr)));
}
JSC_DEFINE_HOST_FUNCTION(jsIsX509Certificate, (JSGlobalObject * globalObject, CallFrame* callFrame))
diff --git a/src/bun.js/bindings/ModuleLoader.cpp b/src/bun.js/bindings/ModuleLoader.cpp
index fb46b9f127ef5a..05ab6649c1d514 100644
--- a/src/bun.js/bindings/ModuleLoader.cpp
+++ b/src/bun.js/bindings/ModuleLoader.cpp
@@ -422,10 +422,10 @@ static JSValue handleVirtualModuleResult(
globalObject,
object);
auto source = JSC::SourceCode(
- JSC::SyntheticSourceProvider::create(WTFMove(function),
+ JSC::SyntheticSourceProvider::create(WTF::move(function),
JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy)));
JSC::ensureStillAliveHere(object);
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source))));
}
case OnLoadResultTypePromise: {
@@ -496,7 +496,7 @@ extern "C" void Bun__onFulfillAsyncModule(
auto created = Bun::createCommonJSModule(jsCast(globalObject), specifierValue, res->result.value);
EXCEPTION_ASSERT(created.has_value() == !scope.exception());
if (created.has_value()) {
- JSSourceCode* code = JSSourceCode::create(vm, WTFMove(created.value()));
+ JSSourceCode* code = JSSourceCode::create(vm, WTF::move(created.value()));
promise->resolve(globalObject, code);
scope.assertNoExceptionExceptTermination();
} else {
@@ -956,7 +956,7 @@ static JSValue fetchESMSourceCode(
auto created = Bun::createCommonJSModule(globalObject, specifierJS, res->result.value);
EXCEPTION_ASSERT(created.has_value() == !scope.exception());
if (created.has_value()) {
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(created.value()))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(created.value()))));
}
if constexpr (allowPromise) {
@@ -978,10 +978,10 @@ static JSValue fetchESMSourceCode(
RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, JSC::SourceCode(provider))));
}
-#define CASE(str, name) \
- case (SyntheticModuleType::name): { \
- auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateNativeModule_##name, JSC::SourceOrigin(), WTFMove(moduleKey))); \
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(source)))); \
+#define CASE(str, name) \
+ case (SyntheticModuleType::name): { \
+ auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateNativeModule_##name, JSC::SourceOrigin(), WTF::move(moduleKey))); \
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(source)))); \
}
BUN_FOREACH_ESM_NATIVE_MODULE(CASE)
#undef CASE
@@ -991,7 +991,7 @@ static JSValue fetchESMSourceCode(
if (tag & SyntheticModuleType::InternalModuleRegistryFlag) {
constexpr auto mask = (SyntheticModuleType::InternalModuleRegistryFlag - 1);
auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateInternalModuleSourceCode(globalObject, static_cast(tag & mask)), JSC::SourceOrigin(URL(makeString("builtins://"_s, moduleKey))), moduleKey));
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(source))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(source))));
} else {
auto&& provider = Zig::SourceProvider::create(globalObject, res->result.value, JSC::SourceProviderSourceType::Module, true);
RELEASE_AND_RETURN(scope, rejectOrResolve(JSC::JSSourceCode::create(vm, JSC::SourceCode(provider))));
@@ -1022,7 +1022,7 @@ static JSValue fetchESMSourceCode(
auto created = Bun::createCommonJSModule(globalObject, specifierJS, res->result.value);
EXCEPTION_ASSERT(created.has_value() == !scope.exception());
if (created.has_value()) {
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(created.value()))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(created.value()))));
}
if constexpr (allowPromise) {
@@ -1067,10 +1067,10 @@ static JSValue fetchESMSourceCode(
globalObject,
value);
auto source = JSC::SourceCode(
- JSC::SyntheticSourceProvider::create(WTFMove(function),
+ JSC::SyntheticSourceProvider::create(WTF::move(function),
JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy)));
JSC::ensureStillAliveHere(value);
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source))));
}
// TOML and JSONC may go through here
else if (res->result.value.tag == SyntheticModuleType::ExportsObject) {
@@ -1084,10 +1084,10 @@ static JSValue fetchESMSourceCode(
globalObject,
value);
auto source = JSC::SourceCode(
- JSC::SyntheticSourceProvider::create(WTFMove(function),
+ JSC::SyntheticSourceProvider::create(WTF::move(function),
JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy)));
JSC::ensureStillAliveHere(value);
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source))));
} else if (res->result.value.tag == SyntheticModuleType::ExportDefaultObject) {
JSC::JSValue value = JSC::JSValue::decode(res->result.value.jsvalue_for_export);
if (!value) {
@@ -1099,10 +1099,10 @@ static JSValue fetchESMSourceCode(
globalObject,
value);
auto source = JSC::SourceCode(
- JSC::SyntheticSourceProvider::create(WTFMove(function),
+ JSC::SyntheticSourceProvider::create(WTF::move(function),
JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy)));
JSC::ensureStillAliveHere(value);
- RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source))));
+ RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source))));
}
RELEASE_AND_RETURN(scope, rejectOrResolve(JSC::JSSourceCode::create(vm, JSC::SourceCode(Zig::SourceProvider::create(globalObject, res->result.value)))));
diff --git a/src/bun.js/bindings/NodeDirent.cpp b/src/bun.js/bindings/NodeDirent.cpp
index d4d7fae7a0c334..ac05a494173e4e 100644
--- a/src/bun.js/bindings/NodeDirent.cpp
+++ b/src/bun.js/bindings/NodeDirent.cpp
@@ -349,14 +349,14 @@ extern "C" JSC::EncodedJSValue Bun__Dirent__toJS(Zig::GlobalObject* globalObject
if (!pathValue) {
auto pathString = path->transferToWTFString();
- pathValue = jsString(vm, WTFMove(pathString));
+ pathValue = jsString(vm, WTF::move(pathString));
if (previousPath) {
*previousPath = pathValue;
}
}
auto nameString = name->transferToWTFString();
- auto nameValue = jsString(vm, WTFMove(nameString));
+ auto nameValue = jsString(vm, WTF::move(nameString));
auto typeValue = jsNumber(type);
object->putDirectOffset(vm, 0, nameValue);
object->putDirectOffset(vm, 1, pathValue);
diff --git a/src/bun.js/bindings/NodeHTTP.cpp b/src/bun.js/bindings/NodeHTTP.cpp
index 33fcc4e1c6e8c0..d315e752495ee3 100644
--- a/src/bun.js/bindings/NodeHTTP.cpp
+++ b/src/bun.js/bindings/NodeHTTP.cpp
@@ -115,14 +115,14 @@ static void assignHeadersFromUWebSocketsForCall(uWS::HttpRequest* request, JSVal
{
std::string_view fullURLStdStr = request->getFullUrl();
String fullURL = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(fullURLStdStr.data()), fullURLStdStr.length() });
- args.append(jsString(vm, WTFMove(fullURL)));
+ args.append(jsString(vm, WTF::move(fullURL)));
}
// Get the method.
if (methodString.isUndefinedOrNull()) [[unlikely]] {
std::string_view methodView = request->getMethod();
WTF::String methodString = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(methodView.data()), methodView.length() });
- args.append(jsString(vm, WTFMove(methodString)));
+ args.append(jsString(vm, WTF::move(methodString)));
} else {
args.append(methodString);
}
@@ -216,7 +216,7 @@ static EncodedJSValue assignHeadersFromUWebSockets(uWS::HttpRequest* request, JS
std::string_view fullURLStdStr = request->getFullUrl();
String fullURL = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(fullURLStdStr.data()), fullURLStdStr.length() });
PutPropertySlot slot(objectValue, false);
- objectValue->put(objectValue, globalObject, builtinNames.urlPublicName(), jsString(vm, WTFMove(fullURL)), slot);
+ objectValue->put(objectValue, globalObject, builtinNames.urlPublicName(), jsString(vm, WTF::move(fullURL)), slot);
RETURN_IF_EXCEPTION(scope, {});
}
diff --git a/src/bun.js/bindings/NodeVM.cpp b/src/bun.js/bindings/NodeVM.cpp
index baf305f5b45506..c8e10536725810 100644
--- a/src/bun.js/bindings/NodeVM.cpp
+++ b/src/bun.js/bindings/NodeVM.cpp
@@ -146,7 +146,7 @@ JSC::JSFunction* constructAnonymousFunction(JSC::JSGlobalObject* globalObject, c
EXCEPTION_ASSERT(!!throwScope.exception() == code.isNull());
SourceCode sourceCode(
- JSC::StringSourceProvider::create(code, sourceOrigin, WTFMove(options.filename), sourceTaintOrigin, position, SourceProviderSourceType::Program),
+ JSC::StringSourceProvider::create(code, sourceOrigin, WTF::move(options.filename), sourceTaintOrigin, position, SourceProviderSourceType::Program),
position.m_line.oneBasedInt(), position.m_column.oneBasedInt());
CodeCache* cache = vm.codeCache();
@@ -1276,7 +1276,7 @@ JSC_DEFINE_HOST_FUNCTION(vmModuleCompileFunction, (JSGlobalObject * globalObject
options.parsingContext->setGlobalScopeExtension(functionScope);
// Create the function using constructAnonymousFunction with the appropriate scope chain
- JSFunction* function = constructAnonymousFunction(globalObject, ArgList(constructFunctionArgs), sourceOrigin, WTFMove(options), JSC::SourceTaintedOrigin::Untainted, functionScope);
+ JSFunction* function = constructAnonymousFunction(globalObject, ArgList(constructFunctionArgs), sourceOrigin, WTF::move(options), JSC::SourceTaintedOrigin::Untainted, functionScope);
RETURN_IF_EXCEPTION(scope, {});
if (!function) {
@@ -1573,12 +1573,12 @@ void configureNodeVM(JSC::VM& vm, Zig::GlobalObject* globalObject)
}
BaseVMOptions::BaseVMOptions(String filename)
- : filename(WTFMove(filename))
+ : filename(WTF::move(filename))
{
}
BaseVMOptions::BaseVMOptions(String filename, OrdinalNumber lineOffset, OrdinalNumber columnOffset)
- : filename(WTFMove(filename))
+ : filename(WTF::move(filename))
, lineOffset(lineOffset)
, columnOffset(columnOffset)
{
diff --git a/src/bun.js/bindings/NodeVMModule.cpp b/src/bun.js/bindings/NodeVMModule.cpp
index ff9489c006394e..202692f1f5d544 100644
--- a/src/bun.js/bindings/NodeVMModule.cpp
+++ b/src/bun.js/bindings/NodeVMModule.cpp
@@ -12,14 +12,14 @@
namespace Bun {
NodeVMModuleRequest::NodeVMModuleRequest(WTF::String specifier, WTF::HashMap importAttributes)
- : m_specifier(WTFMove(specifier))
- , m_importAttributes(WTFMove(importAttributes))
+ : m_specifier(WTF::move(specifier))
+ , m_importAttributes(WTF::move(importAttributes))
{
}
void NodeVMModuleRequest::addImportAttribute(WTF::String key, WTF::String value)
{
- m_importAttributes.set(WTFMove(key), WTFMove(value));
+ m_importAttributes.set(WTF::move(key), WTF::move(value));
}
JSArray* NodeVMModuleRequest::toJS(JSGlobalObject* globalObject) const
@@ -152,7 +152,7 @@ JSValue NodeVMModule::evaluate(JSGlobalObject* globalObject, uint32_t timeout, b
NodeVMModule::NodeVMModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, JSValue moduleWrapper)
: Base(vm, structure)
- , m_identifier(WTFMove(identifier))
+ , m_identifier(WTF::move(identifier))
, m_context(context && context.isObject() ? asObject(context) : nullptr, JSC::WriteBarrierEarlyInit)
, m_moduleWrapper(vm, this, moduleWrapper)
{
diff --git a/src/bun.js/bindings/NodeVMModule.h b/src/bun.js/bindings/NodeVMModule.h
index 57179d37f81e4c..67ce3d5ef17582 100644
--- a/src/bun.js/bindings/NodeVMModule.h
+++ b/src/bun.js/bindings/NodeVMModule.h
@@ -56,7 +56,7 @@ class NodeVMModule : public JSC::JSDestructibleObject, public SigintReceiver {
void namespaceObject(JSC::VM& vm, JSModuleNamespaceObject* value) { m_namespaceObject.set(vm, this, value); }
const WTF::Vector& moduleRequests() const { return m_moduleRequests; }
- void addModuleRequest(NodeVMModuleRequest request) { m_moduleRequests.append(WTFMove(request)); }
+ void addModuleRequest(NodeVMModuleRequest request) { m_moduleRequests.append(WTF::move(request)); }
// Purposely not virtual. Dispatches to the correct subclass.
JSValue createModuleRecord(JSC::JSGlobalObject* globalObject);
diff --git a/src/bun.js/bindings/NodeVMScript.cpp b/src/bun.js/bindings/NodeVMScript.cpp
index 7602c80a5003e2..b6ae742d67d223 100644
--- a/src/bun.js/bindings/NodeVMScript.cpp
+++ b/src/bun.js/bindings/NodeVMScript.cpp
@@ -133,7 +133,7 @@ constructScript(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue newT
const bool produceCachedData = options.produceCachedData;
auto filename = options.filename;
- NodeVMScript* script = NodeVMScript::create(vm, globalObject, structure, WTFMove(source), WTFMove(options));
+ NodeVMScript* script = NodeVMScript::create(vm, globalObject, structure, WTF::move(source), WTF::move(options));
RETURN_IF_EXCEPTION(scope, {});
fetcher->owner(vm, script);
@@ -150,7 +150,7 @@ constructScript(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue newT
JSC::LexicallyScopedFeatures lexicallyScopedFeatures = globalObject->globalScopeExtension() ? JSC::TaintedByWithScopeLexicallyScopedFeature : JSC::NoLexicallyScopedFeatures;
JSC::SourceCodeKey key(script->source(), {}, JSC::SourceCodeType::ProgramType, lexicallyScopedFeatures, JSC::JSParserScriptMode::Classic, JSC::DerivedContextType::None, JSC::EvalContextType::None, false, {}, std::nullopt);
Ref cachedBytecode = JSC::CachedBytecode::create(std::span(cachedData), nullptr, {});
- JSC::UnlinkedProgramCodeBlock* unlinkedBlock = JSC::decodeCodeBlock(vm, key, WTFMove(cachedBytecode));
+ JSC::UnlinkedProgramCodeBlock* unlinkedBlock = JSC::decodeCodeBlock(vm, key, WTF::move(cachedBytecode));
if (!unlinkedBlock) {
script->cachedDataRejected(TriState::True);
@@ -264,7 +264,7 @@ void NodeVMScriptConstructor::finishCreation(VM& vm, JSObject* prototype)
NodeVMScript* NodeVMScript::create(VM& vm, JSGlobalObject* globalObject, Structure* structure, SourceCode source, ScriptOptions options)
{
- NodeVMScript* ptr = new (NotNull, allocateCell(vm)) NodeVMScript(vm, structure, WTFMove(source), WTFMove(options));
+ NodeVMScript* ptr = new (NotNull, allocateCell(vm)) NodeVMScript(vm, structure, WTF::move(source), WTF::move(options));
ptr->finishCreation(vm);
return ptr;
}
diff --git a/src/bun.js/bindings/NodeVMScript.h b/src/bun.js/bindings/NodeVMScript.h
index 5637ae939a25a9..356d247a8b7817 100644
--- a/src/bun.js/bindings/NodeVMScript.h
+++ b/src/bun.js/bindings/NodeVMScript.h
@@ -91,8 +91,8 @@ class NodeVMScript final : public JSC::JSDestructibleObject, public SigintReceiv
NodeVMScript(JSC::VM& vm, JSC::Structure* structure, JSC::SourceCode source, ScriptOptions options)
: Base(vm, structure)
- , m_source(WTFMove(source))
- , m_options(WTFMove(options))
+ , m_source(WTF::move(source))
+ , m_options(WTF::move(options))
{
}
diff --git a/src/bun.js/bindings/NodeVMSourceTextModule.cpp b/src/bun.js/bindings/NodeVMSourceTextModule.cpp
index af84196723396a..5c3ad694ec75df 100644
--- a/src/bun.js/bindings/NodeVMSourceTextModule.cpp
+++ b/src/bun.js/bindings/NodeVMSourceTextModule.cpp
@@ -97,17 +97,17 @@ NodeVMSourceTextModule* NodeVMSourceTextModule::create(VM& vm, JSGlobalObject* g
WTF::String sourceText = sourceTextValue.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, nullptr);
- Ref sourceProvider = StringSourceProvider::create(WTFMove(sourceText), sourceOrigin, String {}, SourceTaintedOrigin::Untainted,
+ Ref sourceProvider = StringSourceProvider::create(WTF::move(sourceText), sourceOrigin, String {}, SourceTaintedOrigin::Untainted,
TextPosition { OrdinalNumber::fromZeroBasedInt(lineOffset), OrdinalNumber::fromZeroBasedInt(columnOffset) }, SourceProviderSourceType::Module);
- SourceCode sourceCode(WTFMove(sourceProvider), lineOffset, columnOffset);
+ SourceCode sourceCode(WTF::move(sourceProvider), lineOffset, columnOffset);
auto* zigGlobalObject = defaultGlobalObject(globalObject);
WTF::String identifier = identifierValue.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, nullptr);
NodeVMSourceTextModule* ptr = new (NotNull, allocateCell(vm)) NodeVMSourceTextModule(
- vm, zigGlobalObject->NodeVMSourceTextModuleStructure(), WTFMove(identifier), contextValue,
- WTFMove(sourceCode), moduleWrapper, initializeImportMeta);
+ vm, zigGlobalObject->NodeVMSourceTextModuleStructure(), WTF::move(identifier), contextValue,
+ WTF::move(sourceCode), moduleWrapper, initializeImportMeta);
RETURN_IF_EXCEPTION(scope, nullptr);
ptr->finishCreation(vm);
@@ -127,7 +127,7 @@ NodeVMSourceTextModule* NodeVMSourceTextModule::create(VM& vm, JSGlobalObject* g
SourceCodeKey key(ptr->sourceCode(), {}, SourceCodeType::ProgramType, lexicallyScopedFeatures, JSParserScriptMode::Classic, DerivedContextType::None, EvalContextType::None, false, {}, std::nullopt);
Ref cachedBytecode = CachedBytecode::create(std::span(cachedData), nullptr, {});
RETURN_IF_EXCEPTION(scope, nullptr);
- UnlinkedModuleProgramCodeBlock* unlinkedBlock = decodeCodeBlock(vm, key, WTFMove(cachedBytecode));
+ UnlinkedModuleProgramCodeBlock* unlinkedBlock = decodeCodeBlock(vm, key, WTF::move(cachedBytecode));
RETURN_IF_EXCEPTION(scope, nullptr);
if (unlinkedBlock) {
@@ -274,7 +274,7 @@ JSValue NodeVMSourceTextModule::createModuleRecord(JSGlobalObject* globalObject)
break;
}
- attributeMap.set("type"_s, WTFMove(attributesTypeString));
+ attributeMap.set("type"_s, WTF::move(attributesTypeString));
attributesObject->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), attributesType);
if (const String& hostDefinedImportType = request.m_attributes->hostDefinedImportType(); !hostDefinedImportType.isEmpty()) {
@@ -291,7 +291,7 @@ JSValue NodeVMSourceTextModule::createModuleRecord(JSGlobalObject* globalObject)
}
requestObject->putDirect(vm, attributesIdentifier, attributesObject);
- addModuleRequest({ WTF::String(*request.m_specifier), WTFMove(attributeMap) });
+ addModuleRequest({ WTF::String(*request.m_specifier), WTF::move(attributeMap) });
requestsArray->putDirectIndex(globalObject, i, requestObject);
}
@@ -347,7 +347,7 @@ JSValue NodeVMSourceTextModule::link(JSGlobalObject* globalObject, JSArray* spec
record->setImportedModule(globalObject, Identifier::fromString(vm, specifier), resolvedRecord);
RETURN_IF_EXCEPTION(scope, {});
- m_resolveCache.set(WTFMove(specifier), WriteBarrier { vm, this, moduleNative });
+ m_resolveCache.set(WTF::move(specifier), WriteBarrier { vm, this, moduleNative });
RETURN_IF_EXCEPTION(scope, {});
}
}
diff --git a/src/bun.js/bindings/NodeVMSourceTextModule.h b/src/bun.js/bindings/NodeVMSourceTextModule.h
index e7e27cfdfcd2e7..790c1b5cc53d50 100644
--- a/src/bun.js/bindings/NodeVMSourceTextModule.h
+++ b/src/bun.js/bindings/NodeVMSourceTextModule.h
@@ -58,9 +58,9 @@ class NodeVMSourceTextModule final : public NodeVMModule {
SourceCode m_sourceCode;
NodeVMSourceTextModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, SourceCode sourceCode, JSValue moduleWrapper, JSValue initializeImportMeta)
- : Base(vm, structure, WTFMove(identifier), context, moduleWrapper)
+ : Base(vm, structure, WTF::move(identifier), context, moduleWrapper)
, m_initializeImportMeta(initializeImportMeta && !initializeImportMeta.isUndefined() ? initializeImportMeta : JSValue(), JSC::WriteBarrierEarlyInit)
- , m_sourceCode(WTFMove(sourceCode))
+ , m_sourceCode(WTF::move(sourceCode))
{
}
diff --git a/src/bun.js/bindings/NodeVMSyntheticModule.cpp b/src/bun.js/bindings/NodeVMSyntheticModule.cpp
index 8455d7d88ce080..7cc66b429efd49 100644
--- a/src/bun.js/bindings/NodeVMSyntheticModule.cpp
+++ b/src/bun.js/bindings/NodeVMSyntheticModule.cpp
@@ -80,7 +80,7 @@ NodeVMSyntheticModule* NodeVMSyntheticModule::create(VM& vm, JSGlobalObject* glo
auto* structure = zigGlobalObject->NodeVMSyntheticModuleStructure();
WTF::String identifier = identifierValue.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, nullptr);
- auto* ptr = new (NotNull, allocateCell(vm)) NodeVMSyntheticModule(vm, structure, WTFMove(identifier), contextValue, moduleWrapperValue, WTFMove(exportNames), syntheticEvaluationStepsValue);
+ auto* ptr = new (NotNull, allocateCell(vm)) NodeVMSyntheticModule(vm, structure, WTF::move(identifier), contextValue, moduleWrapperValue, WTF::move(exportNames), syntheticEvaluationStepsValue);
ptr->finishCreation(vm);
return ptr;
}
diff --git a/src/bun.js/bindings/NodeVMSyntheticModule.h b/src/bun.js/bindings/NodeVMSyntheticModule.h
index 3d005d804dd996..e269bd94dc792a 100644
--- a/src/bun.js/bindings/NodeVMSyntheticModule.h
+++ b/src/bun.js/bindings/NodeVMSyntheticModule.h
@@ -52,8 +52,8 @@ class NodeVMSyntheticModule final : public NodeVMModule {
WTF::HashSet m_exportNames;
NodeVMSyntheticModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, JSValue moduleWrapper, WTF::HashSet exportNames, JSValue syntheticEvaluationSteps)
- : Base(vm, structure, WTFMove(identifier), context, moduleWrapper)
- , m_exportNames(WTFMove(exportNames))
+ : Base(vm, structure, WTF::move(identifier), context, moduleWrapper)
+ , m_exportNames(WTF::move(exportNames))
, m_syntheticEvaluationSteps(vm, this, syntheticEvaluationSteps)
{
}
diff --git a/src/bun.js/bindings/ScriptExecutionContext.cpp b/src/bun.js/bindings/ScriptExecutionContext.cpp
index e546e7fc293ac5..c314bddd16530d 100644
--- a/src/bun.js/bindings/ScriptExecutionContext.cpp
+++ b/src/bun.js/bindings/ScriptExecutionContext.cpp
@@ -137,7 +137,7 @@ ScriptExecutionContext::~ScriptExecutionContext()
m_inScriptExecutionContextDestructor = true;
#endif // ASSERT_ENABLED
- auto postMessageCompletionHandlers = WTFMove(m_processMessageWithMessagePortsSoonHandlers);
+ auto postMessageCompletionHandlers = WTF::move(m_processMessageWithMessagePortsSoonHandlers);
for (auto& completionHandler : postMessageCompletionHandlers)
completionHandler();
@@ -157,7 +157,7 @@ bool ScriptExecutionContext::postTaskTo(ScriptExecutionContextIdentifier identif
if (!context)
return false;
- context->postTaskConcurrently(WTFMove(task));
+ context->postTaskConcurrently(WTF::move(task));
return true;
}
@@ -201,7 +201,7 @@ bool ScriptExecutionContext::ensureOnContextThread(ScriptExecutionContextIdentif
return false;
if (!context->isContextThread()) {
- context->postTaskConcurrently(WTFMove(task));
+ context->postTaskConcurrently(WTF::move(task));
return true;
}
}
@@ -218,7 +218,7 @@ bool ScriptExecutionContext::ensureOnMainThread(FunctionpostTaskConcurrently(WTFMove(task));
+ context->postTaskConcurrently(WTF::move(task));
return true;
}
@@ -231,7 +231,7 @@ ScriptExecutionContext* ScriptExecutionContext::getMainThreadScriptExecutionCont
void ScriptExecutionContext::processMessageWithMessagePortsSoon(CompletionHandler&& completionHandler)
{
ASSERT(isContextThread());
- m_processMessageWithMessagePortsSoonHandlers.append(WTFMove(completionHandler));
+ m_processMessageWithMessagePortsSoonHandlers.append(WTF::move(completionHandler));
if (m_willProcessMessageWithMessagePortsSoon) {
return;
@@ -368,13 +368,13 @@ ScriptExecutionContext* executionContext(JSC::JSGlobalObject* globalObject)
void ScriptExecutionContext::postTaskConcurrently(Function&& lambda)
{
- auto* task = new EventLoopTask(WTFMove(lambda));
+ auto* task = new EventLoopTask(WTF::move(lambda));
static_cast(m_globalObject)->queueTaskConcurrently(task);
}
// Executes the task on context's thread asynchronously.
void ScriptExecutionContext::postTask(Function&& lambda)
{
- auto* task = new EventLoopTask(WTFMove(lambda));
+ auto* task = new EventLoopTask(WTF::move(lambda));
static_cast(m_globalObject)->queueTask(task);
}
// Executes the task on context's thread asynchronously.
diff --git a/src/bun.js/bindings/Serialization.cpp b/src/bun.js/bindings/Serialization.cpp
index 9af0d6a492f97c..caaec599f81b45 100644
--- a/src/bun.js/bindings/Serialization.cpp
+++ b/src/bun.js/bindings/Serialization.cpp
@@ -33,7 +33,7 @@ extern "C" SerializedValueSlice Bun__serializeJSValue(JSGlobalObject* globalObje
auto forStorage = (static_cast(flags) & static_cast(SerializedFlags::ForStorage)) ? SerializationForStorage::Yes : SerializationForStorage::No;
auto context = SerializationContext::Default;
auto forTransferEnum = (static_cast(flags) & static_cast(SerializedFlags::ForCrossProcessTransfer)) ? SerializationForCrossProcessTransfer::Yes : SerializationForCrossProcessTransfer::No;
- ExceptionOr][> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), dummyPorts, forStorage, context, forTransferEnum);
+ ExceptionOr][> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), dummyPorts, forStorage, context, forTransferEnum);
EXCEPTION_ASSERT(!!scope.exception() == serialized.hasException());
if (serialized.hasException()) {
@@ -54,13 +54,15 @@ extern "C" SerializedValueSlice Bun__serializeJSValue(JSGlobalObject* globalObje
extern "C" void Bun__SerializedScriptSlice__free(SerializedScriptValue* value)
{
- delete value;
+ // Use deref() instead of delete to properly handle CHECK_REF_COUNTED_LIFECYCLE.
+ // The value was leaked via leakRef() which leaves refcount at 1, so deref() will delete it.
+ value->deref();
}
extern "C" EncodedJSValue Bun__JSValue__deserialize(JSGlobalObject* globalObject, const uint8_t* bytes, size_t size)
{
Vector vector(std::span { bytes, size });
/// ?! did i just give ownership of these bytes to JSC?
- auto scriptValue = SerializedScriptValue::createFromWireBytes(WTFMove(vector));
+ auto scriptValue = SerializedScriptValue::createFromWireBytes(WTF::move(vector));
return JSValue::encode(scriptValue->deserialize(*globalObject, globalObject));
}
diff --git a/src/bun.js/bindings/ShellBindings.cpp b/src/bun.js/bindings/ShellBindings.cpp
index 5d8cc9d6929d60..db11b91f750680 100644
--- a/src/bun.js/bindings/ShellBindings.cpp
+++ b/src/bun.js/bindings/ShellBindings.cpp
@@ -22,7 +22,7 @@ extern "C" SYSV_ABI EncodedJSValue Bun__createShellInterpreter(Zig::GlobalObject
auto* structure = globalObject->JSShellInterpreterStructure();
ASSERT(structure);
- auto* result = WebCore::JSShellInterpreter::create(vm, globalObject, structure, ptr, WTFMove(args), resolveFn, rejectFn);
+ auto* result = WebCore::JSShellInterpreter::create(vm, globalObject, structure, ptr, WTF::move(args), resolveFn, rejectFn);
size_t size = ShellInterpreter__estimatedSize(ptr);
vm.heap.reportExtraMemoryAllocated(result, size);
diff --git a/src/bun.js/bindings/TextCodecCJK.cpp b/src/bun.js/bindings/TextCodecCJK.cpp
index c2dc80f2766736..b09ee6188982ce 100644
--- a/src/bun.js/bindings/TextCodecCJK.cpp
+++ b/src/bun.js/bindings/TextCodecCJK.cpp
@@ -1081,7 +1081,7 @@ static Vector gbEncodeShared(StringView string, Function gb18030Encode(StringView string, Function&)>&& unencodableHandler)
{
- return gbEncodeShared(string, WTFMove(unencodableHandler), IsGBK::No);
+ return gbEncodeShared(string, WTF::move(unencodableHandler), IsGBK::No);
}
// https://encoding.spec.whatwg.org/#gbk-decoder
@@ -1092,7 +1092,7 @@ String TextCodecCJK::gbkDecode(std::span bytes, bool flush, bool
static Vector gbkEncode(StringView string, Function&)>&& unencodableHandler)
{
- return gbEncodeShared(string, WTFMove(unencodableHandler), IsGBK::Yes);
+ return gbEncodeShared(string, WTF::move(unencodableHandler), IsGBK::Yes);
}
constexpr size_t maxUChar32Digits = 10;
diff --git a/src/bun.js/bindings/TextEncodingRegistry.cpp b/src/bun.js/bindings/TextEncodingRegistry.cpp
index cab9ba628fe500..356537245b0691 100644
--- a/src/bun.js/bindings/TextEncodingRegistry.cpp
+++ b/src/bun.js/bindings/TextEncodingRegistry.cpp
@@ -174,7 +174,7 @@ static void addToTextCodecMap(ASCIILiteral name, NewTextCodecFunction&& function
{
ASCIILiteral atomName = textEncodingNameMap().get(name);
ASSERT(!atomName.isNull());
- textCodecMap().add(atomName, WTFMove(function));
+ textCodecMap().add(atomName, WTF::move(function));
}
static void pruneBlocklistedCodecs() WTF_REQUIRES_LOCK(encodingRegistryLock)
diff --git a/src/bun.js/bindings/URLSearchParams.cpp b/src/bun.js/bindings/URLSearchParams.cpp
index e8a15e51948785..7d5f9d225d8ed3 100644
--- a/src/bun.js/bindings/URLSearchParams.cpp
+++ b/src/bun.js/bindings/URLSearchParams.cpp
@@ -35,7 +35,7 @@ extern "C" JSC::EncodedJSValue URLSearchParams__create(JSDOMGlobalObject* global
{
String str = Zig::toString(*input);
auto result = URLSearchParams::create(str, nullptr);
- return JSC::JSValue::encode(WebCore::toJSNewlyCreated(globalObject, globalObject, WTFMove(result)));
+ return JSC::JSValue::encode(WebCore::toJSNewlyCreated(globalObject, globalObject, WTF::move(result)));
}
extern "C" WebCore::URLSearchParams* URLSearchParams__fromJS(JSC::EncodedJSValue value)
@@ -75,7 +75,7 @@ ExceptionOr][> URLSearchParams::create(std::variant>& pairs) -> ExceptionOr][> { return adoptRef(*new URLSearchParams(pairs)); }, [&](const String& string) -> ExceptionOr][> { return adoptRef(*new URLSearchParams(string, nullptr)); });
+ return adoptRef(*new URLSearchParams(WTF::move(pairs))); }, [&](const Vector>& pairs) -> ExceptionOr][> { return adoptRef(*new URLSearchParams(pairs)); }, [&](const String& string) -> ExceptionOr][> { return adoptRef(*new URLSearchParams(string, nullptr)); });
return std::visit(visitor, variant);
}
diff --git a/src/bun.js/bindings/Uint8Array.cpp b/src/bun.js/bindings/Uint8Array.cpp
index 9e37d9225f249d..53feafee1e83e7 100644
--- a/src/bun.js/bindings/Uint8Array.cpp
+++ b/src/bun.js/bindings/Uint8Array.cpp
@@ -15,7 +15,7 @@ extern "C" JSC::EncodedJSValue JSUint8Array__fromDefaultAllocator(JSC::JSGlobalO
mi_free(p);
}));
- uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), WTFMove(buffer), 0, length);
+ uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), WTF::move(buffer), 0, length);
} else {
uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), 0);
}
@@ -36,7 +36,7 @@ extern "C" JSC::EncodedJSValue JSArrayBuffer__fromDefaultAllocator(JSC::JSGlobal
buffer = ArrayBuffer::create(0, 1);
}
- auto arrayBuffer = JSC::JSArrayBuffer::create(lexicalGlobalObject->vm(), lexicalGlobalObject->arrayBufferStructure(), WTFMove(buffer));
+ auto arrayBuffer = JSC::JSArrayBuffer::create(lexicalGlobalObject->vm(), lexicalGlobalObject->arrayBufferStructure(), WTF::move(buffer));
return JSC::JSValue::encode(arrayBuffer);
}
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 0e9e1161e2649f..dbbe784ad0db04 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -531,7 +531,7 @@ extern "C" JSC::JSGlobalObject* Zig__GlobalObject__create(void* console_client,
auto& options = worker.options();
if (options.env.has_value()) {
- HashMap map = WTFMove(*std::exchange(options.env, std::nullopt));
+ HashMap map = *std::exchange(options.env, std::nullopt);
auto size = map.size();
// In theory, a GC could happen before we finish putting all the properties on the object.
@@ -547,7 +547,7 @@ extern "C" JSC::JSGlobalObject* Zig__GlobalObject__create(void* console_client,
for (auto k : map) {
// They can have environment variables with numbers as keys.
// So we must use putDirectMayBeIndex to handle that.
- env->putDirectMayBeIndex(globalObject, JSC::Identifier::fromString(vm, WTFMove(k.key)), strings.at(i++));
+ env->putDirectMayBeIndex(globalObject, JSC::Identifier::fromString(vm, WTF::move(k.key)), strings.at(i++));
}
globalObject->m_processEnvObject.set(vm, globalObject, env);
}
@@ -1073,7 +1073,7 @@ JSC_DEFINE_HOST_FUNCTION(functionQueueMicrotask,
// The runtime inspects argumentCount to determine which arguments are present, so callers may pass only the subset they need.
// Here we pass: function, callback, asyncContext.
JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, function, callback, asyncContext };
- globalObject->vm().queueMicrotask(WTFMove(task));
+ globalObject->vm().queueMicrotask(WTF::move(task));
return JSC::JSValue::encode(JSC::jsUndefined());
}
@@ -1130,7 +1130,7 @@ JSC_DEFINE_HOST_FUNCTION(functionBTOA,
return {};
}
WTF::StringImpl::copyCharacters(ptr, encodedString.span16());
- encodedString = WTFMove(dest);
+ encodedString = WTF::move(dest);
}
unsigned length = encodedString.length();
@@ -1198,7 +1198,7 @@ extern "C" JSC::EncodedJSValue ArrayBuffer__fromSharedMemfd(int64_t fd, JSC::JSG
}));
if (type == JSC::Uint8ArrayType) {
- auto uint8array = JSC::JSUint8Array::create(globalObject, globalObject->m_typedArrayUint8.get(globalObject), WTFMove(buffer), 0, byteLength);
+ auto uint8array = JSC::JSUint8Array::create(globalObject, globalObject->m_typedArrayUint8.get(globalObject), WTF::move(buffer), 0, byteLength);
return JSValue::encode(uint8array);
}
@@ -1210,7 +1210,7 @@ extern "C" JSC::EncodedJSValue ArrayBuffer__fromSharedMemfd(int64_t fd, JSC::JSG
return JSC::JSValue::encode(JSC::JSValue {});
}
- return JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), structure, WTFMove(buffer)));
+ return JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), structure, WTF::move(buffer)));
} else {
RELEASE_ASSERT_NOT_REACHED();
}
@@ -1232,7 +1232,7 @@ extern "C" JSC::EncodedJSValue Bun__createArrayBufferForCopy(JSC::JSGlobalObject
if (len > 0)
memcpy(arrayBuffer->data(), ptr, len);
- RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTFMove(arrayBuffer))));
+ RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTF::move(arrayBuffer))));
}
extern "C" JSC::EncodedJSValue Bun__allocUint8ArrayForCopy(JSC::JSGlobalObject* globalObject, size_t len, void** ptr)
@@ -1286,7 +1286,7 @@ extern "C" JSC::EncodedJSValue Bun__makeArrayBufferWithBytesNoCopy(JSC::JSGlobal
if (deallocator) deallocator(p, deallocatorContext);
}));
- JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTFMove(buffer));
+ JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTF::move(buffer));
RETURN_IF_EXCEPTION(scope, {});
return JSValue::encode(jsBuffer);
}
@@ -1299,7 +1299,7 @@ extern "C" JSC::EncodedJSValue Bun__makeTypedArrayWithBytesNoCopy(JSC::JSGlobalO
auto buffer_ = ArrayBuffer::createFromBytes({ static_cast(ptr), len }, createSharedTask([=](void* p) {
if (deallocator) deallocator(p, deallocatorContext);
}));
- RefPtr&& buffer = WTFMove(buffer_);
+ RefPtr&& buffer = WTF::move(buffer_);
if (!buffer) {
throwOutOfMemoryError(globalObject, scope);
return {};
@@ -1313,7 +1313,7 @@ extern "C" JSC::EncodedJSValue Bun__makeTypedArrayWithBytesNoCopy(JSC::JSGlobalO
switch (ty) {
#define JSC_TYPED_ARRAY_FACTORY(type) \
case Type##type: \
- RELEASE_AND_RETURN(scope, JSValue::encode(JS##type##Array::create(globalObject, globalObject->typedArrayStructure(Type##type, isResizableOrGrowableShared), WTFMove(buffer), offset, length)));
+ RELEASE_AND_RETURN(scope, JSValue::encode(JS##type##Array::create(globalObject, globalObject->typedArrayStructure(Type##type, isResizableOrGrowableShared), WTF::move(buffer), offset, length)));
#undef JSC_TYPED_ARRAY_CHECK
FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(JSC_TYPED_ARRAY_FACTORY)
case NotTypedArray:
@@ -1337,7 +1337,7 @@ JSC_DEFINE_HOST_FUNCTION(functionCreateUninitializedArrayBuffer,
return {};
}
- RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTFMove(arrayBuffer))));
+ RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTF::move(arrayBuffer))));
}
static inline JSC::EncodedJSValue jsFunctionAddEventListenerBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, Zig::GlobalObject* castedThis)
@@ -1358,7 +1358,7 @@ static inline JSC::EncodedJSValue jsFunctionAddEventListenerBody(JSC::JSGlobalOb
EnsureStillAliveScope argument2 = callFrame->argument(2);
auto options = argument2.value().isUndefined() ? false : convert, IDLBoolean>>(*lexicalGlobalObject, argument2.value());
RETURN_IF_EXCEPTION(throwScope, {});
- auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->addEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); }));
+ auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->addEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); }));
RETURN_IF_EXCEPTION(throwScope, {});
vm.writeBarrier(&static_cast(*castedThis), argument1.value());
return result;
@@ -1387,7 +1387,7 @@ static inline JSC::EncodedJSValue jsFunctionRemoveEventListenerBody(JSC::JSGloba
EnsureStillAliveScope argument2 = callFrame->argument(2);
auto options = argument2.value().isUndefined() ? false : convert, IDLBoolean>>(*lexicalGlobalObject, argument2.value());
RETURN_IF_EXCEPTION(throwScope, {});
- auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->removeEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); }));
+ auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->removeEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); }));
RETURN_IF_EXCEPTION(throwScope, {});
vm.writeBarrier(&static_cast(*castedThis), argument1.value());
return result;
@@ -1503,7 +1503,7 @@ JSC_DEFINE_HOST_FUNCTION(createWritableStreamFromInternal, (JSGlobalObject * glo
auto* jsDOMGlobalObject = JSC::jsCast(globalObject);
auto internalWritableStream = InternalWritableStream::fromObject(*jsDOMGlobalObject, *callFrame->uncheckedArgument(0).toObject(globalObject));
- return JSValue::encode(toJSNewlyCreated(globalObject, jsDOMGlobalObject, WritableStream::create(WTFMove(internalWritableStream))));
+ return JSValue::encode(toJSNewlyCreated(globalObject, jsDOMGlobalObject, WritableStream::create(WTF::move(internalWritableStream))));
}
JSC_DEFINE_HOST_FUNCTION(addAbortAlgorithmToSignal, (JSGlobalObject * globalObject, CallFrame* callFrame))
@@ -1518,7 +1518,7 @@ JSC_DEFINE_HOST_FUNCTION(addAbortAlgorithmToSignal, (JSGlobalObject * globalObje
Ref abortAlgorithm = JSAbortAlgorithm::create(vm, callFrame->uncheckedArgument(1).getObject());
- auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->wrapped(), WTFMove(abortAlgorithm));
+ auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->wrapped(), WTF::move(abortAlgorithm));
return JSValue::encode(JSC::jsNumber(algorithmIdentifier));
}
@@ -3104,7 +3104,7 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskCallback(Zig::GlobalObject* g
// Do not use JSCell* here because the GC will try to visit it.
// Use BunInvokeJobWithArguments to pass the two arguments (ptr and callback) to the trampoline function
JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunInvokeJobWithArguments, globalObject, function, JSValue(std::bit_cast(reinterpret_cast(ptr))), JSValue(std::bit_cast(reinterpret_cast(callback))) };
- globalObject->vm().queueMicrotask(WTFMove(task));
+ globalObject->vm().queueMicrotask(WTF::move(task));
}
JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject* jsGlobalObject,
@@ -3450,7 +3450,7 @@ static JSC::JSPromise* handleResponseOnStreamingAction(JSGlobalObject* lexicalGl
return promise;
}
- auto wrapper = WebCore::toJSNewlyCreated(globalObject, globalObject, WTFMove(compiler));
+ auto wrapper = WebCore::toJSNewlyCreated(globalObject, globalObject, WTF::move(compiler));
auto builtin = globalObject->wasmStreamingConsumeStreamFunction();
auto callData = JSC::getCallData(builtin);
MarkedArgumentBuffer arguments;
diff --git a/src/bun.js/bindings/ZigSourceProvider.cpp b/src/bun.js/bindings/ZigSourceProvider.cpp
index 021b567551f52a..ff17060d39a163 100644
--- a/src/bun.js/bindings/ZigSourceProvider.cpp
+++ b/src/bun.js/bindings/ZigSourceProvider.cpp
@@ -110,7 +110,7 @@ Ref SourceProvider::create(
toSourceOrigin(sourceURLString, isBuiltin),
sourceURLString.impl(), TextPosition(),
sourceType));
- provider->m_cachedBytecode = WTFMove(bytecode);
+ provider->m_cachedBytecode = WTF::move(bytecode);
return provider;
}
@@ -348,11 +348,11 @@ int SourceProvider::readCache(JSC::VM& vm, const JSC::SourceCode& sourceCode)
// if (fileTotalSize == 0)
// return 0;
- // Ref cachedBytecode = JSC::CachedBytecode::create(WTFMove(mappedFile));
+ // Ref cachedBytecode = JSC::CachedBytecode::create(WTF::move(mappedFile));
// // auto key = JSC::sourceCodeKeyForSerializedModule(vm, sourceCode);
// // if (isCachedBytecodeStillValid(vm, cachedBytecode.copyRef(), key,
// // JSC::SourceCodeType::ModuleType)) {
- // m_cachedBytecode = WTFMove(cachedBytecode);
+ // m_cachedBytecode = WTF::move(cachedBytecode);
// return 1;
// } else {
// FileSystem::truncateFile(fd, 0);
diff --git a/src/bun.js/bindings/ZigSourceProvider.h b/src/bun.js/bindings/ZigSourceProvider.h
index 2379c883c47204..b1d036791dc957 100644
--- a/src/bun.js/bindings/ZigSourceProvider.h
+++ b/src/bun.js/bindings/ZigSourceProvider.h
@@ -64,7 +64,7 @@ class SourceProvider final : public JSC::SourceProvider {
JSC::SourceTaintedOrigin taintedness,
const SourceOrigin& sourceOrigin, WTF::String&& sourceURL,
const TextPosition& startPosition, JSC::SourceProviderSourceType sourceType)
- : Base(sourceOrigin, WTFMove(sourceURL), String(), taintedness, startPosition, sourceType)
+ : Base(sourceOrigin, WTF::move(sourceURL), String(), taintedness, startPosition, sourceType)
, m_globalObject(globalObject)
, m_source(sourceImpl)
{
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index 0f3b3d07e73efe..3a4130c9838b4f 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -722,9 +722,9 @@ bool Bun__deepEquals(JSC::JSGlobalObject* globalObject, JSValue v1, JSValue v2,
ASSERT(c2);
std::optional isSpecialEqual = specialObjectsDequal(globalObject, gcBuffer, stack, scope, c1, c2);
RETURN_IF_EXCEPTION(scope, false);
- if (isSpecialEqual.has_value()) return std::move(*isSpecialEqual);
+ if (isSpecialEqual.has_value()) return WTF::move(*isSpecialEqual);
isSpecialEqual = specialObjectsDequal(globalObject, gcBuffer, stack, scope, c2, c1);
- if (isSpecialEqual.has_value()) return std::move(*isSpecialEqual);
+ if (isSpecialEqual.has_value()) return WTF::move(*isSpecialEqual);
JSObject* o1 = v1.getObject();
JSObject* o2 = v2.getObject();
@@ -1806,7 +1806,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromJS(JSC::JSGlobalObject*
// `fill` doesn't set an exception on the VM if it fails, it returns an
// ExceptionOr. So we need to check for the exception and, if set,
// translate it to JSValue and throw it.
- WebCore::propagateException(*lexicalGlobalObject, throwScope, headers->fill(WTFMove(init.value())));
+ WebCore::propagateException(*lexicalGlobalObject, throwScope, headers->fill(WTF::move(init.value())));
// If there's an exception, it will be thrown by the above call to fill().
// in that case, let's also free the headers to make memory leaks harder.
@@ -1841,7 +1841,7 @@ JSC::EncodedJSValue WebCore__FetchHeaders__clone(WebCore::FetchHeaders* headers,
Zig::GlobalObject* globalObject = static_cast(arg1);
auto* clone = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
WebCore::propagateException(*arg1, throwScope, clone->fill(*headers));
- return JSC::JSValue::encode(WebCore::toJSNewlyCreated(arg1, globalObject, WTFMove(clone)));
+ return JSC::JSValue::encode(WebCore::toJSNewlyCreated(arg1, globalObject, WTF::move(clone)));
}
WebCore::FetchHeaders* WebCore__FetchHeaders__cloneThis(WebCore::FetchHeaders* headers, JSC::JSGlobalObject* lexicalGlobalObject)
@@ -1972,7 +1972,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromPicoHeaders_(const void*
}
}
- headers->setInternalHeaders(WTFMove(map));
+ headers->setInternalHeaders(WTF::move(map));
}
return headers;
}
@@ -1995,12 +1995,12 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromUWS(void* arg1)
HTTPHeaderName name;
if (WebCore::findHTTPHeaderName(nameView, name)) {
- map.add(name, WTFMove(value));
+ map.add(name, WTF::move(value));
} else {
- map.setUncommonHeader(nameView.toString().isolatedCopy(), WTFMove(value));
+ map.setUncommonHeader(nameView.toString().isolatedCopy(), WTF::move(value));
}
}
- headers->setInternalHeaders(WTFMove(map));
+ headers->setInternalHeaders(WTF::move(map));
return headers;
}
void WebCore__FetchHeaders__deref(WebCore::FetchHeaders* arg0)
@@ -2022,7 +2022,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createValueNotJS(JSC::JSGlobalObje
auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} });
headers->relaxAdoptionRequirement();
- WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTFMove(pairs))));
+ WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTF::move(pairs))));
if (throwScope.exception()) {
headers->deref();
return nullptr;
@@ -2043,9 +2043,9 @@ JSC::EncodedJSValue WebCore__FetchHeaders__createValue(JSC::JSGlobalObject* arg0
}
Ref headers = WebCore::FetchHeaders::create();
- WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTFMove(pairs))));
+ WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTF::move(pairs))));
- JSValue value = WebCore::toJSNewlyCreated(arg0, static_cast(arg0), WTFMove(headers));
+ JSValue value = WebCore::toJSNewlyCreated(arg0, static_cast(arg0), WTF::move(headers));
JSFetchHeaders* fetchHeaders = jsCast(value);
fetchHeaders->computeMemoryCost();
@@ -2552,6 +2552,22 @@ void JSC__JSValue__jsonStringify(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObje
RETURN_IF_EXCEPTION(scope, );
*arg3 = Bun::toStringRef(str);
}
+
+// Fast version of JSON.stringify that uses JSC's FastStringifier optimization.
+// When space is undefined, JSC uses FastStringifier which is significantly faster
+// than the general Stringifier used when space is a number (even 0).
+void JSC__JSValue__jsonStringifyFast(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1,
+ BunString* arg3)
+{
+ ASSERT_NO_PENDING_EXCEPTION(arg1);
+ auto& vm = JSC::getVM(arg1);
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ JSC::JSValue value = JSC::JSValue::decode(JSValue0);
+ // Passing jsUndefined() for space triggers JSC's FastStringifier optimization
+ WTF::String str = JSC::JSONStringify(arg1, value, JSC::jsUndefined());
+ RETURN_IF_EXCEPTION(scope, );
+ *arg3 = Bun::toStringRef(str);
+}
unsigned char JSC__JSValue__jsType(JSC::EncodedJSValue JSValue0)
{
JSC::JSValue jsValue = JSC::JSValue::decode(JSValue0);
@@ -2908,7 +2924,7 @@ JSC::EncodedJSValue JSC__JSModuleLoader__evaluate(JSC::JSGlobalObject* globalObj
JSC::SourceCode sourceCode = JSC::makeSource(
src, JSC::SourceOrigin { origin }, JSC::SourceTaintedOrigin::Untainted, origin.fileSystemPath(),
WTF::TextPosition(), JSC::SourceProviderSourceType::Module);
- globalObject->moduleLoader()->provideFetch(globalObject, jsString(vm, origin.fileSystemPath()), WTFMove(sourceCode));
+ globalObject->moduleLoader()->provideFetch(globalObject, jsString(vm, origin.fileSystemPath()), WTF::move(sourceCode));
auto* promise = JSC::importModule(globalObject, JSC::Identifier::fromString(vm, origin.fileSystemPath()), JSValue(jsString(vm, referrer.fileSystemPath())), JSValue(), JSValue());
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -3138,8 +3154,8 @@ JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObjec
auto& vm = JSC::getVM(globalObject);
auto scope = DECLARE_THROW_SCOPE(vm);
- JSC::JSValue message = JSC::jsOwnedString(vm, Zig::toString(*arg3));
- JSC::JSValue options = JSC::jsUndefined();
+ WTF::String message = Zig::toString(*arg3);
+ JSC::JSValue cause = JSC::jsUndefined();
JSC::JSArray* array = nullptr;
{
JSC::ObjectInitializationScope initializationScope(vm);
@@ -3160,14 +3176,14 @@ JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObjec
JSC::Structure* errorStructure = globalObject->errorStructure(JSC::ErrorType::AggregateError);
- RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::createAggregateError(globalObject, vm, errorStructure, array, message, options, nullptr, JSC::TypeNothing, false)));
+ RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::createAggregateError(vm, errorStructure, array, message, cause, nullptr, JSC::TypeNothing, false)));
}
-JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateErrorWithArray(JSC::JSGlobalObject* global, JSC::JSArray* array, BunString message, JSValue options)
+JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateErrorWithArray(JSC::JSGlobalObject* global, JSC::JSArray* array, BunString message, JSValue cause)
{
auto& vm = JSC::getVM(global);
JSC::Structure* errorStructure = global->errorStructure(JSC::ErrorType::AggregateError);
WTF::String messageString = message.toWTFString();
- return JSC::JSValue::encode(JSC::createAggregateError(global, vm, errorStructure, array, JSC::jsString(vm, messageString), options, nullptr, JSC::TypeNothing, false));
+ return JSC::JSValue::encode(JSC::createAggregateError(vm, errorStructure, array, messageString, cause, nullptr, JSC::TypeNothing, false));
}
JSC::EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC::JSGlobalObject* arg1)
@@ -3178,11 +3194,11 @@ JSC::EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC::JSGloba
if (isTaggedUTF16Ptr(arg0->ptr)) {
if (auto impl = WTF::AtomStringImpl::lookUp(std::span { reinterpret_cast(untag(arg0->ptr)), arg0->len })) {
- return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTFMove(impl))));
+ return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTF::move(impl))));
}
} else {
if (auto impl = WTF::AtomStringImpl::lookUp(std::span { untag(arg0->ptr), arg0->len })) {
- return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTFMove(impl))));
+ return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTF::move(impl))));
}
}
@@ -3203,7 +3219,7 @@ JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t len, J
auto ref = String(ExternalStringImpl::create({ reinterpret_cast(arg0), len }, reinterpret_cast(const_cast(arg0)), free_global_string));
- return JSC::JSValue::encode(JSC::jsString(global->vm(), WTFMove(ref)));
+ return JSC::JSValue::encode(JSC::jsString(global->vm(), WTF::move(ref)));
}
// This must be a globally allocated string
@@ -3215,10 +3231,10 @@ JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t len, J
}
if (Zig::isTaggedUTF16Ptr(str.ptr)) {
auto ref = String(ExternalStringImpl::create({ reinterpret_cast(Zig::untag(str.ptr)), str.len }, Zig::untagVoid(str.ptr), free_global_string));
- return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTFMove(ref)));
+ return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::move(ref)));
} else {
auto ref = String(ExternalStringImpl::create({ Zig::untag(str.ptr), str.len }, Zig::untagVoid(str.ptr), free_global_string));
- return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTFMove(ref)));
+ return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::move(ref)));
}
}
@@ -3525,7 +3541,7 @@ void JSC__JSPromise__rejectOnNextTickWithHandled(JSC::JSPromise* promise, JSC::J
}
JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microtaskFunction, rejectPromiseFunction, globalObject->m_asyncContextData.get()->getInternalField(0), promise, value };
- globalObject->vm().queueMicrotask(WTFMove(task));
+ globalObject->vm().queueMicrotask(WTF::move(task));
RETURN_IF_EXCEPTION(scope, );
}
}
@@ -5412,8 +5428,8 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskJob(JSC::JSGlobalObject* arg0
#endif
- JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microTaskFunction, WTFMove(microtaskArgs[0]), WTFMove(microtaskArgs[1]), WTFMove(microtaskArgs[2]), WTFMove(microtaskArgs[3]) };
- globalObject->vm().queueMicrotask(WTFMove(task));
+ JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microTaskFunction, WTF::move(microtaskArgs[0]), WTF::move(microtaskArgs[1]), WTF::move(microtaskArgs[2]), WTF::move(microtaskArgs[3]) };
+ globalObject->vm().queueMicrotask(WTF::move(task));
}
extern "C" WebCore::AbortSignal* WebCore__AbortSignal__new(JSC::JSGlobalObject* globalObject)
@@ -5430,7 +5446,7 @@ extern "C" JSC::EncodedJSValue WebCore__AbortSignal__create(JSC::JSGlobalObject*
auto* context = thisObject->scriptExecutionContext();
auto abortSignal = WebCore::AbortSignal::create(context);
- return JSValue::encode(toJSNewlyCreated>(*globalObject, *jsCast(globalObject), WTFMove(abortSignal)));
+ return JSValue::encode(toJSNewlyCreated>(*globalObject, *jsCast(globalObject), WTF::move(abortSignal)));
}
extern "C" JSC::EncodedJSValue WebCore__AbortSignal__toJS(WebCore::AbortSignal* arg0, JSC::JSGlobalObject* globalObject)
{
@@ -5697,15 +5713,15 @@ CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__createFromURLQuery(JSC::JSGlo
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
return Bun::ERR::STRING_TOO_LONG(scope, globalObject);
}
- auto formData = DOMFormData::create(globalObject->scriptExecutionContext(), WTFMove(str));
- return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTFMove(formData)));
+ auto formData = DOMFormData::create(globalObject->scriptExecutionContext(), WTF::move(str));
+ return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTF::move(formData)));
}
CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__create(JSC::JSGlobalObject* arg0)
{
Zig::GlobalObject* globalObject = static_cast(arg0);
auto formData = DOMFormData::create(globalObject->scriptExecutionContext());
- return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTFMove(formData)));
+ return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTF::move(formData)));
}
CPP_DECL WebCore::DOMFormData* WebCore__DOMFormData__fromJS(JSC::EncodedJSValue JSValue1)
diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h
index 06e1a7f96a26ae..895bb4f078646f 100644
--- a/src/bun.js/bindings/headers.h
+++ b/src/bun.js/bindings/headers.h
@@ -265,6 +265,7 @@ CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromDouble(double arg0);
CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromInt64(int64_t arg0);
CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsNumberFromU16(uint16_t arg0);
CPP_DECL void JSC__JSValue__jsonStringify(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, uint32_t arg2, BunString* arg3);
+CPP_DECL void JSC__JSValue__jsonStringifyFast(JSC::EncodedJSValue JSValue0, JSC::JSGlobalObject* arg1, BunString* arg3);
CPP_DECL JSC::EncodedJSValue JSC__JSValue__jsTDZValue();
CPP_DECL unsigned char JSC__JSValue__jsType(JSC::EncodedJSValue JSValue0);
CPP_DECL JSC::EncodedJSValue JSC__JSValue__keys(JSC::JSGlobalObject* arg0, JSC::EncodedJSValue arg1);
diff --git a/src/bun.js/bindings/helpers.h b/src/bun.js/bindings/helpers.h
index 4e69126a00165a..16411881e07b82 100644
--- a/src/bun.js/bindings/helpers.h
+++ b/src/bun.js/bindings/helpers.h
@@ -208,14 +208,14 @@ static const WTF::String toStringCopy(ZigString str)
return WTF::String();
}
memcpy(out.data(), untag(str.ptr), str.len * sizeof(char16_t));
- return WTF::String(WTFMove(impl));
+ return WTF::String(WTF::move(impl));
} else {
std::span out;
auto impl = WTF::StringImpl::tryCreateUninitialized(str.len, out);
if (!impl) [[unlikely]]
return WTF::String();
memcpy(out.data(), untag(str.ptr), str.len * sizeof(Latin1Character));
- return WTF::String(WTFMove(impl));
+ return WTF::String(WTF::move(impl));
}
}
diff --git a/src/bun.js/bindings/napi.cpp b/src/bun.js/bindings/napi.cpp
index c68618adf356a4..447287be0e8882 100644
--- a/src/bun.js/bindings/napi.cpp
+++ b/src/bun.js/bindings/napi.cpp
@@ -606,7 +606,7 @@ extern "C" napi_status napi_set_named_property(napi_env env, napi_value object,
JSC::EnsureStillAliveScope ensureAlive2(target);
auto nameStr = WTF::String::fromUTF8({ utf8name, strlen(utf8name) });
- auto name = JSC::PropertyName(JSC::Identifier::fromString(vm, WTFMove(nameStr)));
+ auto name = JSC::PropertyName(JSC::Identifier::fromString(vm, WTF::move(nameStr)));
PutPropertySlot slot(target, false);
target->putInline(globalObject, name, jsValue, slot);
@@ -632,7 +632,7 @@ extern "C" napi_status napi_create_arraybuffer(napi_env env,
return napi_set_last_error(env, napi_generic_failure);
}
- auto* jsArrayBuffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTFMove(arrayBuffer));
+ auto* jsArrayBuffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTF::move(arrayBuffer));
NAPI_RETURN_IF_EXCEPTION(env);
if (data && jsArrayBuffer->impl()) [[likely]] {
@@ -1451,7 +1451,7 @@ node_api_create_external_string_latin1(napi_env env,
});
Zig::GlobalObject* globalObject = toJS(env);
- JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTFMove(impl)));
+ JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTF::move(impl)));
ensureStillAliveHere(out);
*result = toNapi(out, globalObject);
ensureStillAliveHere(out);
@@ -1487,7 +1487,7 @@ node_api_create_external_string_utf16(napi_env env,
});
Zig::GlobalObject* globalObject = toJS(env);
- JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTFMove(impl)));
+ JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTF::move(impl)));
ensureStillAliveHere(out);
*result = toNapi(out, globalObject);
ensureStillAliveHere(out);
@@ -1714,27 +1714,27 @@ static JSC::JSArrayBufferView* createArrayBufferView(
Structure* structure = globalObject->typedArrayStructure(getTypedArrayTypeFromNAPI(type), arrayBuffer->isResizableOrGrowableShared());
switch (type) {
case napi_int8_array:
- return JSC::JSInt8Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSInt8Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_uint8_array:
- return JSC::JSUint8Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSUint8Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_uint8_clamped_array:
- return JSC::JSUint8ClampedArray::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSUint8ClampedArray::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_int16_array:
- return JSC::JSInt16Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSInt16Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_uint16_array:
- return JSC::JSUint16Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSUint16Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_int32_array:
- return JSC::JSInt32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSInt32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_uint32_array:
- return JSC::JSUint32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSUint32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_float32_array:
- return JSC::JSFloat32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSFloat32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_float64_array:
- return JSC::JSFloat64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSFloat64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_bigint64_array:
- return JSC::JSBigInt64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSBigInt64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
case napi_biguint64_array:
- return JSC::JSBigUint64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length);
+ return JSC::JSBigUint64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length);
default:
ASSERT_NOT_REACHED_WITH_MESSAGE("Unexpected napi_typedarray_type");
}
@@ -2031,7 +2031,7 @@ extern "C" napi_status napi_create_external_buffer(napi_env env, size_t length,
// TODO: is there a way to create a detached uint8 array?
auto arrayBuffer = JSC::ArrayBuffer::createUninitialized(0, 1);
- auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTFMove(arrayBuffer), 0, 0);
+ auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTF::move(arrayBuffer), 0, 0);
NAPI_RETURN_IF_EXCEPTION(env);
buffer->existingBuffer()->detach(vm);
@@ -2048,7 +2048,7 @@ extern "C" napi_status napi_create_external_buffer(napi_env env, size_t length,
// do nothing
}));
- auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTFMove(arrayBuffer), 0, length);
+ auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTF::move(arrayBuffer), 0, length);
NAPI_RETURN_IF_EXCEPTION(env);
// setup finalizer after creating the array. if it throws callers of napi_create_external_buffer are expected
@@ -2076,7 +2076,7 @@ extern "C" napi_status napi_create_external_arraybuffer(napi_env env, void* exte
env->doFinalizer(finalize_cb, p, finalize_hint);
}));
- auto* buffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTFMove(arrayBuffer));
+ auto* buffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTF::move(arrayBuffer));
*result = toNapi(buffer, globalObject);
NAPI_RETURN_SUCCESS(env);
diff --git a/src/bun.js/bindings/napi.h b/src/bun.js/bindings/napi.h
index 56346cd0194e92..30efadbcdd987c 100644
--- a/src/bun.js/bindings/napi.h
+++ b/src/bun.js/bindings/napi.h
@@ -669,7 +669,7 @@ class NapiRef {
NapiRef(Ref&& env, uint32_t count, Bun::NapiFinalizer finalizer)
: env(env)
, globalObject(JSC::Weak(env->globalObject()))
- , finalizer(WTFMove(finalizer))
+ , finalizer(WTF::move(finalizer))
, refCount(count)
{
}
diff --git a/src/bun.js/bindings/ncrypto.cpp b/src/bun.js/bindings/ncrypto.cpp
index 446ee74a643591..e1e747ed780651 100644
--- a/src/bun.js/bindings/ncrypto.cpp
+++ b/src/bun.js/bindings/ncrypto.cpp
@@ -206,7 +206,7 @@ DataPointer& DataPointer::operator=(DataPointer&& other) noexcept
{
if (this == &other) return *this;
this->~DataPointer();
- return *new (this) DataPointer(WTFMove(other));
+ return *new (this) DataPointer(WTF::move(other));
}
DataPointer::~DataPointer()
@@ -337,7 +337,7 @@ BignumPointer& BignumPointer::operator=(BignumPointer&& other) noexcept
{
if (this == &other) return *this;
this->~BignumPointer();
- return *new (this) BignumPointer(WTFMove(other));
+ return *new (this) BignumPointer(WTF::move(other));
}
BignumPointer::~BignumPointer()
@@ -515,7 +515,7 @@ BignumPointer BignumPointer::NewPrime(const PrimeConfig& params,
PrimeCheckCallback cb)
{
BignumPointer prime(BN_new());
- if (!prime || !prime.generate(params, WTFMove(cb))) {
+ if (!prime || !prime.generate(params, WTF::move(cb))) {
return {};
}
return prime;
@@ -1039,7 +1039,7 @@ X509Pointer& X509Pointer::operator=(X509Pointer&& other) noexcept
{
if (this == &other) return *this;
this->~X509Pointer();
- return *new (this) X509Pointer(WTFMove(other));
+ return *new (this) X509Pointer(WTF::move(other));
}
X509Pointer::~X509Pointer()
@@ -1276,7 +1276,7 @@ X509View::CheckMatch X509View::checkHost(const std::span]