From ca1bf28023d05e3952cb588be78fe989a64bf1c8 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 11 Dec 2025 02:45:06 +0000 Subject: [PATCH] fix: Add CLI flag reference to JSDoc, improve initComptime warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add "Equivalent to the CLI --feature flag" to bun.d.ts JSDoc - Improve initComptime doc comment warning about undefined behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/bun-types/bun.d.ts | 2 ++ src/bun.zig | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 81bb193423..06352b4a35 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -1897,6 +1897,8 @@ declare module "bun" { * When `feature("FLAG_NAME")` is called, it returns `true` if FLAG_NAME is in this array, * or `false` otherwise. This enables static dead-code elimination at bundle time. * + * Equivalent to the CLI `--feature` flag. + * * @example * ```ts * await Bun.build({ diff --git a/src/bun.zig b/src/bun.zig index 81ecce2f82..a01c74c3dd 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -1623,8 +1623,8 @@ pub const StringSet = struct { } /// Initialize an empty StringSet at comptime (for use as a static constant). - /// WARNING: The resulting set has an undefined allocator and must not be mutated. - /// Do not call insert(), clone(), or any method that allocates on a comptime-initialized set. + /// WARNING: The resulting set must not be mutated. Any attempt to call insert(), + /// clone(), or other allocating methods will result in undefined behavior. pub fn initComptime() StringSet { return StringSet{ .map = Map.initContext(undefined, .{}),