diff --git a/src/async/windows_event_loop.zig b/src/async/windows_event_loop.zig index 6ac815a849..c5c3d3bd29 100644 --- a/src/async/windows_event_loop.zig +++ b/src/async/windows_event_loop.zig @@ -187,7 +187,7 @@ pub const FilePoll = struct { pub fn unregister(this: *FilePoll, loop: *Loop) bool { _ = loop; - // TODO(@paperdave): This cast is extremely suspicious. At best, `fd` is + // TODO(@paperclover): This cast is extremely suspicious. At best, `fd` is // the wrong type (it should be a uv handle), at worst this code is a // crash due to invalid memory access. uv.uv_unref(@ptrFromInt(@intFromEnum(this.fd))); diff --git a/src/bun.js/bindings/ImportMetaObject.h b/src/bun.js/bindings/ImportMetaObject.h index 401107aaf1..eb8779ecc9 100644 --- a/src/bun.js/bindings/ImportMetaObject.h +++ b/src/bun.js/bindings/ImportMetaObject.h @@ -33,7 +33,7 @@ public: /// - other -> assertion failure static ImportMetaObject* create(JSC::JSGlobalObject* globalObject, JSValue specifierOrURL); - /// TODO(@paperdave): + /// TODO(@paperclover): /// The rules for this function's input is a bit weird. `specifier` is an import path specifier aka a file path. /// /// - Should be an absolute path or name of a plugin module diff --git a/src/bun.js/bindings/JSArray.zig b/src/bun.js/bindings/JSArray.zig index c51ee1b5cb..6cd53231f4 100644 --- a/src/bun.js/bindings/JSArray.zig +++ b/src/bun.js/bindings/JSArray.zig @@ -6,7 +6,7 @@ const JSValue = JSC.JSValue; const JSArrayIterator = @import("./JSArrayIterator.zig").JSArrayIterator; pub const JSArray = opaque { - // TODO(@paperdave): this can throw + // TODO(@paperclover): this can throw extern fn JSArray__constructArray(*JSGlobalObject, [*]const JSValue, usize) JSValue; pub fn create(global: *JSGlobalObject, items: []const JSValue) JSValue { diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 2fd039f4ab..77b30297b9 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -4465,7 +4465,7 @@ public: // /path/to/file.js: // /path/to/file.js:1 // node:child_process - // C:\Users\dave\bun\file.js + // C:\Users\chloe\bun\file.js marker3 = lineInner.length(); @@ -4484,9 +4484,9 @@ public: // /path/to/file.js:1: // /path/to/file.js:1:2 // node:child_process:1:2 - // C:\Users\dave\bun\file.js: - // C:\Users\dave\bun\file.js:1 - // C:\Users\dave\bun\file.js:1:2 + // C:\Users\chloe\bun\file.js: + // C:\Users\chloe\bun\file.js:1 + // C:\Users\chloe\bun\file.js:1:2 while (true) { auto newcolon = lineInner.find(':', marker3 + 1); diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig index ca139469a7..6f75988b59 100644 --- a/src/bun.js/node/types.zig +++ b/src/bun.js/node/types.zig @@ -57,7 +57,7 @@ pub fn Maybe(comptime ReturnTypeT: type, comptime ErrorTypeT: type) type { /// creating the `err` variant of this type /// resulted in Zig incorrectly setting the tag, leading to a switch /// statement to just not work. - /// we (Zack, Dylan, Dave, Mason) observed that it was set to 0xFF in ReleaseFast in the debugger + /// we (Zack, Dylan, Chloe, Mason) observed that it was set to 0xFF in ReleaseFast in the debugger pub const Tag = enum(u8) { err, result }; pub const retry: @This() = if (has_retry) .{ .err = ErrorType.retry } else .{ .err = .{} }; diff --git a/src/bun.zig b/src/bun.zig index 9c4b6b4405..aa53116416 100644 --- a/src/bun.zig +++ b/src/bun.zig @@ -183,7 +183,7 @@ pub const FileDescriptor = enum(FileDescriptorInt) { /// Interpreting a FD as an integer is almost certainly a mistake. /// On Windows, it is always a mistake, as the integer is bitcast of a tagged packed struct. /// - /// TODO(@paperdave): remove this API. + /// TODO(@paperclover): remove this API. pub fn int(self: FileDescriptor) std.posix.fd_t { if (Environment.isWindows) @compileError("FileDescriptor.int() is not allowed on Windows."); @@ -2190,7 +2190,7 @@ pub inline fn uvfdcast(fd: anytype) FDImpl.UV { const T = @TypeOf(fd); if (Environment.isWindows) { const decoded = (switch (T) { - FDImpl.System => @compileError("This cast (FDImpl.System -> FDImpl.UV) makes this file descriptor very hard to close. Use toLibUVOwnedFD() and FileDescriptor instead. If you truly need to do this conversion (dave will probably reject your PR), use bun.FDImpl.fromSystem(fd).uv()"), + FDImpl.System => @compileError("This cast (FDImpl.System -> FDImpl.UV) makes this file descriptor very hard to close. Use toLibUVOwnedFD() and FileDescriptor instead. If you truly need to do this conversion (Chloe will probably reject your PR), use bun.FDImpl.fromSystem(fd).uv()"), FDImpl => fd, FDImpl.UV => return fd, FileDescriptor => FDImpl.decode(fd), @@ -2756,7 +2756,7 @@ pub inline fn OSPathLiteral(comptime literal: anytype) *const [literal.len:0]OSP pub const MakePath = struct { const w = std.os.windows; - // TODO(@paperdave): upstream making this public into zig std + // TODO(@paperclover): upstream making this public into zig std // there is zero reason this must be copied // /// Calls makeOpenDirAccessMaskW iteratively to make an entire path diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index eb61fe62a7..dfcd13dd29 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -1386,7 +1386,7 @@ pub const BundleV2 = struct { scbs.items(.ssr_source_index), ) |use, source_id, ssr_index| { if (use == .client) { - // TODO(@paperdave/bake): this file is being generated far too + // TODO(@paperclover/bake): this file is being generated far too // early. we don't know which exports are dead and which exports // are live. Tree-shaking figures that out. However, // tree-shaking happens after import binding, which would @@ -2755,7 +2755,7 @@ pub const BundleV2 = struct { }, .content = .{ .javascript = .{ - // TODO(@paperdave): remove this ptrCast when Source Index is fixed + // TODO(@paperclover): remove this ptrCast when Source Index is fixed .files_in_chunk_order = @ptrCast(js_reachable_files), .parts_in_chunk_in_order = js_part_ranges, }, @@ -14550,7 +14550,7 @@ pub const LinkerContext = struct { bun.assert(chunks.len > 0); { - // TODO(@paperdave/bake): instead of running a renamer per chunk, run it per file + // TODO(@paperclover/bake): instead of running a renamer per chunk, run it per file debug(" START {d} renamers", .{chunks.len}); defer debug(" DONE {d} renamers", .{chunks.len}); var wait_group = try c.allocator.create(sync.WaitGroup); diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index 8b50e3120f..f0d81c831a 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -1644,13 +1644,13 @@ pub const RunCommand = struct { Global.exit(1); } - // TODO(@paperdave): merge windows branch + // TODO(@paperclover): merge windows branch // var win_resolver = resolve_path.PosixToWinNormalizer{}; const filename = ctx.positionals[0]; const normalized_filename = if (std.fs.path.isAbsolute(filename)) - // TODO(@paperdave): merge windows branch + // TODO(@paperclover): merge windows branch // try win_resolver.resolveCWD("/dev/bun/test/etc.js"); filename else brk: { diff --git a/src/crash_handler.zig b/src/crash_handler.zig index 519052dce4..10d40d7972 100644 --- a/src/crash_handler.zig +++ b/src/crash_handler.zig @@ -1594,7 +1594,7 @@ pub fn dumpStackTrace(trace: std.builtin.StackTrace) void { }, .linux => { // Linux doesnt seem to be able to decode it's own debug info. - // TODO(@paperdave): see if zig 0.14 fixes this + // TODO(@paperclover): see if zig 0.14 fixes this }, else => { stdDumpStackTrace(trace); diff --git a/src/fd.zig b/src/fd.zig index 32b255e922..78f9079bf9 100644 --- a/src/fd.zig +++ b/src/fd.zig @@ -131,7 +131,7 @@ pub const FDImpl = packed struct { pub fn isValid(this: FDImpl) bool { return switch (environment.os) { // the 'zero' value on posix is debatable. it can be standard in. - // TODO(@paperdave): steamroll away every use of bun.FileDescriptor.zero + // TODO(@paperclover): steamroll away every use of bun.FileDescriptor.zero else => this.value.as_system != invalid_value, .windows => switch (this.kind) { // zero is not allowed in addition to the invalid value (zero would be a null ptr) diff --git a/src/fs.zig b/src/fs.zig index 7d9ba839ca..4966d48e54 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -1718,7 +1718,7 @@ pub const Path = struct { /// an absolute path with native slashes. text: string, namespace: string, - // TODO(@paperdave): investigate removing or simplifying this property (it's 64 bytes) + // TODO(@paperclover): investigate removing or simplifying this property (it's 64 bytes) name: PathName, is_disabled: bool = false, is_symlink: bool = false, diff --git a/src/install/windows-shim/BinLinkingShim.zig b/src/install/windows-shim/BinLinkingShim.zig index b4000502bc..e546579304 100644 --- a/src/install/windows-shim/BinLinkingShim.zig +++ b/src/install/windows-shim/BinLinkingShim.zig @@ -90,7 +90,7 @@ pub const Shebang = struct { pub fn init(launcher: []const u8, is_node_or_bun: bool) !Shebang { return .{ .launcher = launcher, - // TODO(@paperdave): what if this is invalid utf8? + // TODO(@paperclover): what if this is invalid utf8? .utf16_len = @intCast(bun.simdutf.length.utf16.from.utf8(launcher)), .is_node_or_bun = is_node_or_bun, }; diff --git a/src/install/windows-shim/bun_shim_impl.zig b/src/install/windows-shim/bun_shim_impl.zig index e3d7872413..d40e497bbe 100644 --- a/src/install/windows-shim/bun_shim_impl.zig +++ b/src/install/windows-shim/bun_shim_impl.zig @@ -359,7 +359,7 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { @as(*align(1) u64, @ptrCast(&buf1_u8[0])).* = @as(u64, @bitCast(nt_object_prefix)); } - // BUF1: '\??\C:\Users\dave\project\node_modules\.bin\hello.!!!!!!!!!!!!!!!!!!!!!!!!!!' + // BUF1: '\??\C:\Users\chloe\project\node_modules\.bin\hello.!!!!!!!!!!!!!!!!!!!!!!!!!!' const suffix = comptime (if (is_standalone) wliteral("exe") else wliteral("bunx")); if (dbg) if (!std.mem.endsWith(u16, image_path_u16, suffix)) { std.debug.panic("assert failed: image path expected to end with {}, got {}", .{ @@ -377,7 +377,7 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { var metadata_handle: w.HANDLE = undefined; var io: w.IO_STATUS_BLOCK = undefined; if (is_standalone) { - // BUF1: '\??\C:\Users\dave\project\node_modules\.bin\hello.bunx!!!!!!!!!!!!!!!!!!!!!!' + // BUF1: '\??\C:\Users\chloe\project\node_modules\.bin\hello.bunx!!!!!!!!!!!!!!!!!!!!!!' @as(*align(1) u64, @ptrCast(&buf1_u8[image_path_b_len + 2 * (nt_object_prefix.len - "exe".len)])).* = @as(u64, @bitCast([4]u16{ 'b', 'u', 'n', 'x' })); const path_len_bytes: c_ushort = image_path_b_len + @as(c_ushort, 2 * (nt_object_prefix.len - "exe".len + "bunx".len)); @@ -468,11 +468,11 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { // without needing to store the absolute path in the '.bunx' file // // we do this by reusing the memory in the first buffer - // BUF1: '\??\C:\Users\dave\project\node_modules\.bin\hello.bunx!!!!!!!!!!!!!!!!!!!!!!' - // ^^ ^ ^ - // S| | image_path_b_len + nt_object_prefix.len - // | 'ptr' initial value - // the read ptr + // BUF1: '\??\C:\Users\chloe\project\node_modules\.bin\hello.bunx!!!!!!!!!!!!!!!!!!!!!!' + // ^^ ^ ^ + // S| | image_path_b_len + nt_object_prefix.len + // | 'ptr' initial value + // the read ptr var read_ptr: [*]u16 = brk: { var left = image_path_b_len / 2 - (if (is_standalone) ".exe".len else ".bunx".len) - 1; var ptr: [*]u16 = buf1_u16[nt_object_prefix.len + left ..]; @@ -531,10 +531,10 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { // Do the read! // // v overwritten data - // BUF1: '\??\C:\Users\dave\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' - // ^^ ^ ^ flags u16 - // a zero u16| shebang meta - // |shebang data + // BUF1: '\??\C:\Users\chloe\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' + // ^^ ^ ^ flags u16 + // a zero u16| shebang meta + // |shebang data // // We are intentionally only reading one chunk. The metadata file is almost always going to be < 200 bytes // If this becomes a problem we will fix it. @@ -588,31 +588,31 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { // (a package distributing an exe [like esbuild] usually has their own wrapper script) // // Instead of the above, the buffer would actually look like: - // BUF1: '\??"C:\Users\dave\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' - // ^^ flags - // zero char| + // BUF1: '\??"C:\Users\chloe\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' + // ^^ flags + // zero char| // change the \ from '\??\' to '"" // the ending quote is assumed to already exist as per the format - // BUF1: '\??"C:\Users\dave\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' + // BUF1: '\??"C:\Users\chloe\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' // ^ buf1_u16[3] = '"'; // Copy user arguments in, overwriting old data. Remember that we ensured the arguments // this started with a space. - // BUF1: '\??"C:\Users\dave\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' - // ^ ^^ - // read_ptr (old) |read_ptr (right now) - // argument_start_ptr + // BUF1: '\??"C:\Users\chloe\project\node_modules\my-cli\src\app.js"##!!!!!!!!!!' + // ^ ^^ + // read_ptr (old) |read_ptr (right now) + // argument_start_ptr // - // BUF1: '\??"C:\Users\dave\project\node_modules\my-cli\src\app.js" --flag!!!!!' + // BUF1: '\??"C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flag!!!!!' const argument_start_ptr: [*]u8 = @ptrFromInt(@intFromPtr(read_ptr) - 2 * "\x00".len); if (user_arguments_u8.len > 0) { @memcpy(argument_start_ptr, user_arguments_u8); } - // BUF1: '\??"C:\Users\dave\project\node_modules\my-cli\src\app.js" --flag#!!!!' - // ^ lpCommandLine ^ null terminator + // BUF1: '\??"C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flag#!!!!' + // ^ lpCommandLine ^ null terminator @as(*align(1) u16, @ptrCast(argument_start_ptr + user_arguments_u8.len)).* = 0; break :spawn_command_line @alignCast(@ptrCast(buf1_u8 + 2 * (nt_object_prefix.len - "\"".len))); @@ -625,8 +625,8 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { args_len_bytes: u32, }; - // BUF1: '\??\C:\Users\dave\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' - // ^ new read_ptr + // BUF1: '\??\C:\Users\chloe\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' + // ^ new read_ptr read_ptr = @ptrFromInt(@intFromPtr(read_ptr) - @sizeOf(ShebangMetadataPacked)); const shebang_metadata: ShebangMetadataPacked = @as(*align(1) ShebangMetadataPacked, @ptrCast(read_ptr)).*; @@ -663,8 +663,8 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { // This optimization can save an additional ~10-20ms depending on the machine // as we do not have to launch a second process. if (dbg) debug("direct_launch_with_bun_js", .{}); - // BUF1: '\??\C:\Users\dave\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' - // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ^ read_ptr + // BUF1: '\??\C:\Users\chloe\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' + // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ^ read_ptr const len = (@intFromPtr(read_ptr) - @intFromPtr(buf1_u8) - shebang_arg_len_u8) / 2 - nt_object_prefix.len - "\"\x00".len; const launch_slice = buf1_u16[nt_object_prefix.len..][0..len :'"']; // assert we slice at the " bun_ctx.direct_launch_with_bun_js( @@ -675,9 +675,9 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { } // Copy the shebang bin path - // BUF1: '\??\C:\Users\dave\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' - // ^~~~^ - // ^ read_ptr + // BUF1: '\??\C:\Users\chloe\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' + // ^~~~^ + // ^ read_ptr // BUF2: 'node !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' read_ptr = @ptrFromInt(@intFromPtr(read_ptr) - shebang_arg_len_u8); @memcpy(buf2_u8, @as([*]u8, @ptrCast(read_ptr))[0..shebang_arg_len_u8]); @@ -686,9 +686,9 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { @as(*align(1) u16, @ptrCast(buf2_u8 + shebang_arg_len_u8)).* = '"'; // Copy the filename in. There is no leading " but there is a trailing " - // BUF1: '\??\C:\Users\dave\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' - // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ^ read_ptr - // BUF2: 'node "C:\Users\dave\project\node_modules\my-cli\src\app.js"!!!!!!!!!!!!!!!!!!!!' + // BUF1: '\??\C:\Users\chloe\project\node_modules\my-cli\src\app.js"#node #####!!!!!!!!!!' + // ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ^ read_ptr + // BUF2: 'node "C:\Users\chloe\project\node_modules\my-cli\src\app.js"!!!!!!!!!!!!!!!!!!!!' const length_of_filename_u8 = @intFromPtr(read_ptr) - @intFromPtr(buf1_u8) - 2 * (nt_object_prefix.len + "\x00".len); const filename = buf1_u8[2 * nt_object_prefix.len ..][0..length_of_filename_u8]; @@ -705,8 +705,8 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { ); // the pointer is now going to act as a write pointer for remaining data. // note that it points into buf2 now, not buf1. this will write arguments and the null terminator - // BUF2: 'node "C:\Users\dave\project\node_modules\my-cli\src\app.js"!!!!!!!!!!!!!!!!!!!!' - // ^ write_ptr + // BUF2: 'node "C:\Users\chloe\project\node_modules\my-cli\src\app.js"!!!!!!!!!!!!!!!!!!!!' + // ^ write_ptr if (dbg) { debug("advance = {} + {} + {}\n", .{ shebang_arg_len_u8, "\"".len, length_of_filename_u8 }); } @@ -716,17 +716,17 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { if (user_arguments_u8.len > 0) { // Copy the user arguments in: - // BUF2: 'node "C:\Users\dave\project\node_modules\my-cli\src\app.js" --flags!!!!!!!!!!!' - // ^~~~~X^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ - // | |filename_len write_ptr + // BUF2: 'node "C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flags!!!!!!!!!!!' + // ^~~~~X^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + // | |filename_len write_ptr // | the quote // shebang_arg_len @memcpy(@as([*]u8, @ptrCast(write_ptr)), user_arguments_u8); write_ptr = @ptrFromInt(@intFromPtr(write_ptr) + user_arguments_u8.len); } - // BUF2: 'node "C:\Users\dave\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' - // ^ null terminator + // BUF2: 'node "C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' + // ^ null terminator write_ptr[0] = 0; break :spawn_command_line @ptrCast(buf2_u16); @@ -821,11 +821,11 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { // To go from node -> bun, it is a matter of writing three chars, and incrementing a pointer. // - // lpCommandLine: 'node "C:\Users\dave\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' + // lpCommandLine: 'node "C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' // ^~~ replace these three bytes with 'bun' @memcpy(spawn_command_line[1..][0..3], comptime wliteral("bun")); - // lpCommandLine: 'nbun "C:\Users\dave\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' + // lpCommandLine: 'nbun "C:\Users\chloe\project\node_modules\my-cli\src\app.js" --flags#!!!!!!!!!!' // ^ increment pointer by one char spawn_command_line += 1; @@ -889,7 +889,7 @@ fn launcher(comptime mode: LauncherMode, bun_ctx: anytype) mode.RetType() { pub const FromBunRunContext = struct { const CommandContext = bun.CLI.Command.Context; - /// Path like 'C:\Users\dave\project\node_modules\.bin\foo.bunx' + /// Path like 'C:\Users\chloe\project\node_modules\.bin\foo.bunx' base_path: []u16, /// Command line arguments which does NOT include the bin name: /// like '--port 3000 --config ./config.json' @@ -922,7 +922,7 @@ pub fn tryStartupFromBunJS(context: FromBunRunContext) void { } pub const FromBunShellContext = struct { - /// Path like 'C:\Users\dave\project\node_modules\.bin\foo.bunx' + /// Path like 'C:\Users\chloe\project\node_modules\.bin\foo.bunx' base_path: []u16, /// Command line arguments which does NOT include the bin name: /// like '--port 3000 --config ./config.json' diff --git a/src/js/README.md b/src/js/README.md index 087bb70d6f..b1ee01d710 100644 --- a/src/js/README.md +++ b/src/js/README.md @@ -97,7 +97,7 @@ The build process is built on top of Bun's bundler. The first step is scanning a The `$` for private names is actually a lie, and in JSC it actually uses `@`; though that is a syntax error in regular JS/TS, so we opted for better IDE support. So first we have to pre-process the files to spot all instances of `$` at the start of an identifier and we convert it to `__intrinsic__`. We also scan for `require(string)` and replace it with `$requireId(n)` after resolving it to the integer id, which is defined in `./functions/Module.ts`. `export default` is transformed into `return ...;`, however this transform is a little more complicated that a string replace because it supports that not being the final statement, and access to the underlying variable `$exports`, etc. -The preprocessor is smart enough to not replace `$` in strings, comments, regex, etc. However, it is not a real JS parser and instead a recursive regex-based nightmare, so may hit some edge cases. Yell at Dave if it breaks. +The preprocessor is smart enough to not replace `$` in strings, comments, regex, etc. However, it is not a real JS parser and instead a recursive regex-based nightmare, so may hit some edge cases. Yell at Chloe if it breaks. The module is then printed like: diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig index 636020d919..db0a646f8c 100644 --- a/src/resolver/resolver.zig +++ b/src/resolver/resolver.zig @@ -581,7 +581,7 @@ pub const Resolver = struct { } pub inline fn usePackageManager(self: *const ThisResolver) bool { - // TODO(@paperdave): make this configurable. the rationale for disabling + // TODO(@paperclover): make this configurable. the rationale for disabling // auto-install in standalone mode is that such executable must either: // // - bundle the dependency itself. dynamic `require`/`import` could be diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 5ad2dd5616..cfd65526ae 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -5775,7 +5775,7 @@ pub fn convertUTF8toUTF16InBuffer( buf: []u16, input: []const u8, ) []u16 { - // TODO(@paperdave): implement error handling here. + // TODO(@paperclover): implement error handling here. // for now this will cause invalid utf-8 to be ignored and become empty. // this is lame because of https://github.com/oven-sh/bun/issues/8197 // it will cause process.env.whatever to be len=0 instead of the data @@ -5811,7 +5811,7 @@ pub fn convertUTF16toUTF8InBuffer( const result = bun.simdutf.convert.utf16.to.utf8.le(input, buf); // switch (result.status) { // .success => return buf[0..result.count], - // // TODO(@paperdave): handle surrogate + // // TODO(@paperclover): handle surrogate // .surrogate => @panic("TODO: handle surrogate in convertUTF8toUTF16"), // else => @panic("TODO: handle error in convertUTF16toUTF8InBuffer"), // } diff --git a/test/bundler/bundler_compile.test.ts b/test/bundler/bundler_compile.test.ts index aa5a22a2ba..a7132d4df0 100644 --- a/test/bundler/bundler_compile.test.ts +++ b/test/bundler/bundler_compile.test.ts @@ -229,7 +229,7 @@ describe("bundler", () => { }, }); itBundled("compile/VariousBunAPIs", { - todo: isWindows, // TODO(@paperdave) + todo: isWindows, // TODO(@paperclover) compile: true, files: { "/entry.ts": ` diff --git a/test/bundler/bundler_edgecase.test.ts b/test/bundler/bundler_edgecase.test.ts index d46947ecb6..c2f4dbadc8 100644 --- a/test/bundler/bundler_edgecase.test.ts +++ b/test/bundler/bundler_edgecase.test.ts @@ -2065,7 +2065,7 @@ describe("bundler", () => { run: true, }); - // TODO(@paperdave): test every case of this. I had already tested it manually, but it may break later + // TODO(@paperclover): test every case of this. I had already tested it manually, but it may break later const requireTranspilationListESM = [ // input, output:bun, output:node ["require", "import.meta.require", "__require"], diff --git a/test/bundler/bundler_npm.test.ts b/test/bundler/bundler_npm.test.ts index 58eb0aa8f2..8e26c7ed33 100644 --- a/test/bundler/bundler_npm.test.ts +++ b/test/bundler/bundler_npm.test.ts @@ -4,7 +4,7 @@ import { itBundled } from "./expectBundled"; describe("bundler", () => { itBundled("npm/ReactSSR", { - todo: isWindows, // TODO(@paperdave) + todo: isWindows, // TODO(@paperclover) install: ["react@18.3.1", "react-dom@18.3.1"], files: { "/entry.tsx": /* tsx */ ` diff --git a/test/bundler/esbuild/loader.test.ts b/test/bundler/esbuild/loader.test.ts index bb765099ff..a3e1c48b5b 100644 --- a/test/bundler/esbuild/loader.test.ts +++ b/test/bundler/esbuild/loader.test.ts @@ -63,7 +63,7 @@ describe("bundler", () => { ], }); itBundled("loader/File", { - todo: process.platform === "win32", // TODO(@paperdave) + todo: process.platform === "win32", // TODO(@paperclover) files: { "/entry.js": ` import path from 'path'; @@ -84,7 +84,7 @@ describe("bundler", () => { }, }); itBundled("loader/FileMultipleNoCollision", { - todo: process.platform === "win32", // TODO(@paperdave) + todo: process.platform === "win32", // TODO(@paperclover) files: { "/entry.js": /* js */ ` import path from 'path'; @@ -110,7 +110,7 @@ describe("bundler", () => { }, }); itBundled("loader/FileMultipleNoCollisionAssetNames", { - todo: process.platform === "win32", // TODO(@paperdave) + todo: process.platform === "win32", // TODO(@paperclover) files: { "/entry.js": /* js */ ` import path from 'path'; diff --git a/test/js/bun/resolve/resolve-bad-parent.test.mjs b/test/js/bun/resolve/resolve-bad-parent.test.mjs index c313014eb5..af765af382 100644 --- a/test/js/bun/resolve/resolve-bad-parent.test.mjs +++ b/test/js/bun/resolve/resolve-bad-parent.test.mjs @@ -4,14 +4,14 @@ test("you can't crash the resolver with import.meta.resolve/Sync", () => { expect(() => { - console.log(import.meta.resolveSync("#foo", "file:/Users/dave")); + console.log(import.meta.resolveSync("#foo", "file:/Users/chloe")); }).toThrow(); expect(() => { - console.log(import.meta.resolve("#foo", "file:/Users/dave")); + console.log(import.meta.resolve("#foo", "file:/Users/chloe")); }).toThrow(); }); -// TODO(@paperdave): ensure this crash isn't possible. +// TODO(@paperclover): ensure this crash isn't possible. test.todo("you can't crash the resolver with Bun.plugin", () => { // }); diff --git a/test/js/bun/sqlite/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js index 58034f8e91..d00a9c01f0 100644 --- a/test/js/bun/sqlite/sqlite.test.js +++ b/test/js/bun/sqlite/sqlite.test.js @@ -77,7 +77,12 @@ describe("safeIntegers", () => { const query = db.query("SELECT * FROM foo"); expect(query.all()).toEqual([{ id: 1, age: Number.MAX_SAFE_INTEGER + 10 }]); query.safeIntegers(true); - expect(query.all()).toEqual([{ id: 1n, age: BigInt(Number.MAX_SAFE_INTEGER) + 10n }]); + expect(query.all()).toEqual([ + { + id: 1n, + age: BigInt(Number.MAX_SAFE_INTEGER) + 10n, + }, + ]); }); it("should allow overwriting default", () => { @@ -85,7 +90,12 @@ describe("safeIntegers", () => { db.exec("CREATE TABLE foo (id INTEGER PRIMARY KEY AUTOINCREMENT, age INTEGER NOT NULL)"); db.run("INSERT INTO foo (age) VALUES (?)", BigInt(Number.MAX_SAFE_INTEGER) + 10n); const query = db.query("SELECT * FROM foo"); - expect(query.all()).toEqual([{ id: 1n, age: BigInt(Number.MAX_SAFE_INTEGER) + 10n }]); + expect(query.all()).toEqual([ + { + id: 1n, + age: BigInt(Number.MAX_SAFE_INTEGER) + 10n, + }, + ]); query.safeIntegers(false); query.as; expect(query.all()).toEqual([{ id: 1, age: Number.MAX_SAFE_INTEGER + 10 }]); @@ -135,7 +145,13 @@ describe("safeIntegers", () => { expect(changes).toBe(1); expect(lastInsertRowid).toBe(1); - expect(db.query("SELECT * FROM cats").all()).toStrictEqual([{ id: 1, name: "myname", age: 42 }]); + expect(db.query("SELECT * FROM cats").all()).toStrictEqual([ + { + id: 1, + name: "myname", + age: 42, + }, + ]); expect(db.query(`SELECT * FROM cats WHERE (name, age) = (${query})`).all(input)).toStrictEqual([ { id: 1, name: "myname", age: 42 }, ]); @@ -252,7 +268,9 @@ it("Database.open", () => { // in a file which doesn't exist try { - Database.open(tmpbase + `database-${Math.random()}.sqlite`, { readonly: true }); + Database.open(tmpbase + `database-${Math.random()}.sqlite`, { + readonly: true, + }); throw new Error("Expected an error to be thrown"); } catch (error) { expect(error.message).toBe("unable to open database file"); @@ -260,7 +278,9 @@ it("Database.open", () => { // in a file which doesn't exist try { - Database.open(tmpbase + `database-${Math.random()}.sqlite`, { readwrite: true }); + Database.open(tmpbase + `database-${Math.random()}.sqlite`, { + readwrite: true, + }); throw new Error("Expected an error to be thrown"); } catch (error) { expect(error.message).toBe("unable to open database file"); @@ -291,7 +311,12 @@ it("upsert cross-process, see #1366", () => { const db2 = Database.open(dir + "get-persist.sqlite"); - expect(db2.query(`SELECT id FROM examples`).all()).toEqual([{ id: "hello" }, { id: "world" }]); + expect(db2.query(`SELECT id FROM examples`).all()).toEqual([ + { id: "hello" }, + { + id: "world", + }, + ]); }); it("creates", () => { @@ -662,7 +687,9 @@ it("db.query()", () => { // iterate (args) i = 0; - for (const row of db.query("SELECT * FROM test WHERE name = $name").iterate({ $name: "World" })) { + for (const row of db.query("SELECT * FROM test WHERE name = $name").iterate({ + $name: "World", + })) { i === 0 && expect(JSON.stringify(row)).toBe(JSON.stringify({ id: 2, name: "World" })); i++; } @@ -936,7 +963,11 @@ it("supports FTS5", () => { { $title: "City of God" }, { $title: "Spirited Away" }, ]); - expect(db.query("SELECT * FROM movies('game')").all()).toEqual([{ title: "WarGames" }]); + expect(db.query("SELECT * FROM movies('game')").all()).toEqual([ + { + title: "WarGames", + }, + ]); }); describe("Database.run", () => { @@ -1139,10 +1170,26 @@ it.skipIf( )("math functions", () => { const db = new Database(":memory:"); - expect(db.prepare("SELECT ABS(-243.5)").all()).toEqual([{ "ABS(-243.5)": 243.5 }]); - expect(db.prepare("SELECT ACOS(0.25)").all()).toEqual([{ "ACOS(0.25)": 1.318116071652818 }]); - expect(db.prepare("SELECT ASIN(0.25)").all()).toEqual([{ "ASIN(0.25)": 0.25268025514207865 }]); - expect(db.prepare("SELECT ATAN(0.25)").all()).toEqual([{ "ATAN(0.25)": 0.24497866312686414 }]); + expect(db.prepare("SELECT ABS(-243.5)").all()).toEqual([ + { + "ABS(-243.5)": 243.5, + }, + ]); + expect(db.prepare("SELECT ACOS(0.25)").all()).toEqual([ + { + "ACOS(0.25)": 1.318116071652818, + }, + ]); + expect(db.prepare("SELECT ASIN(0.25)").all()).toEqual([ + { + "ASIN(0.25)": 0.25268025514207865, + }, + ]); + expect(db.prepare("SELECT ATAN(0.25)").all()).toEqual([ + { + "ATAN(0.25)": 0.24497866312686414, + }, + ]); db.exec( ` CREATE TABLE num_table (value TEXT NOT NULL); @@ -1150,21 +1197,77 @@ it.skipIf( `, ); expect(db.prepare(`SELECT AVG(value) as value FROM num_table`).all()).toEqual([{ value: 3 }]); - expect(db.prepare("SELECT CEILING(0.25)").all()).toEqual([{ "CEILING(0.25)": 1 }]); - expect(db.prepare("SELECT COUNT(*) FROM num_table").all()).toEqual([{ "COUNT(*)": 3 }]); - expect(db.prepare("SELECT COS(0.25)").all()).toEqual([{ "COS(0.25)": 0.9689124217106447 }]); - expect(db.prepare("SELECT DEGREES(0.25)").all()).toEqual([{ "DEGREES(0.25)": 14.32394487827058 }]); - expect(db.prepare("SELECT EXP(0.25)").all()).toEqual([{ "EXP(0.25)": 1.2840254166877414 }]); - expect(db.prepare("SELECT FLOOR(0.25)").all()).toEqual([{ "FLOOR(0.25)": 0 }]); - expect(db.prepare("SELECT LOG10(0.25)").all()).toEqual([{ "LOG10(0.25)": -0.6020599913279624 }]); - expect(db.prepare("SELECT PI()").all()).toEqual([{ "PI()": 3.141592653589793 }]); - expect(db.prepare("SELECT POWER(0.25, 3)").all()).toEqual([{ "POWER(0.25, 3)": 0.015625 }]); - expect(db.prepare("SELECT RADIANS(0.25)").all()).toEqual([{ "RADIANS(0.25)": 0.004363323129985824 }]); - expect(db.prepare("SELECT ROUND(0.25)").all()).toEqual([{ "ROUND(0.25)": 0 }]); + expect(db.prepare("SELECT CEILING(0.25)").all()).toEqual([ + { + "CEILING(0.25)": 1, + }, + ]); + expect(db.prepare("SELECT COUNT(*) FROM num_table").all()).toEqual([ + { + "COUNT(*)": 3, + }, + ]); + expect(db.prepare("SELECT COS(0.25)").all()).toEqual([ + { + "COS(0.25)": 0.9689124217106447, + }, + ]); + expect(db.prepare("SELECT DEGREES(0.25)").all()).toEqual([ + { + "DEGREES(0.25)": 14.32394487827058, + }, + ]); + expect(db.prepare("SELECT EXP(0.25)").all()).toEqual([ + { + "EXP(0.25)": 1.2840254166877414, + }, + ]); + expect(db.prepare("SELECT FLOOR(0.25)").all()).toEqual([ + { + "FLOOR(0.25)": 0, + }, + ]); + expect(db.prepare("SELECT LOG10(0.25)").all()).toEqual([ + { + "LOG10(0.25)": -0.6020599913279624, + }, + ]); + expect(db.prepare("SELECT PI()").all()).toEqual([ + { + "PI()": 3.141592653589793, + }, + ]); + expect(db.prepare("SELECT POWER(0.25, 3)").all()).toEqual([ + { + "POWER(0.25, 3)": 0.015625, + }, + ]); + expect(db.prepare("SELECT RADIANS(0.25)").all()).toEqual([ + { + "RADIANS(0.25)": 0.004363323129985824, + }, + ]); + expect(db.prepare("SELECT ROUND(0.25)").all()).toEqual([ + { + "ROUND(0.25)": 0, + }, + ]); expect(db.prepare("SELECT SIGN(0.25)").all()).toEqual([{ "SIGN(0.25)": 1 }]); - expect(db.prepare("SELECT SIN(0.25)").all()).toEqual([{ "SIN(0.25)": 0.24740395925452294 }]); - expect(db.prepare("SELECT SQRT(0.25)").all()).toEqual([{ "SQRT(0.25)": 0.5 }]); - expect(db.prepare("SELECT TAN(0.25)").all()).toEqual([{ "TAN(0.25)": 0.25534192122103627 }]); + expect(db.prepare("SELECT SIN(0.25)").all()).toEqual([ + { + "SIN(0.25)": 0.24740395925452294, + }, + ]); + expect(db.prepare("SELECT SQRT(0.25)").all()).toEqual([ + { + "SQRT(0.25)": 0.5, + }, + ]); + expect(db.prepare("SELECT TAN(0.25)").all()).toEqual([ + { + "TAN(0.25)": 0.25534192122103627, + }, + ]); }); it("issue#6597", () => {