From 4a326979f45a610b606a3f1fb45bf6bd2480f5a4 Mon Sep 17 00:00:00 2001 From: "taylor.fish" Date: Wed, 5 Nov 2025 12:45:43 -0800 Subject: [PATCH] Fix bindgenv2 type annotations (#24139) --- src/codegen/bindgenv2/internal/any.ts | 4 ++-- src/codegen/bindgenv2/internal/primitives.ts | 10 +++++----- src/codegen/bindgenv2/internal/string.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/codegen/bindgenv2/internal/any.ts b/src/codegen/bindgenv2/internal/any.ts index 8ca3199762..024d175805 100644 --- a/src/codegen/bindgenv2/internal/any.ts +++ b/src/codegen/bindgenv2/internal/any.ts @@ -1,6 +1,6 @@ import { CodeStyle, Type } from "./base"; -export const RawAny: Type = new (class extends Type { +export const RawAny = new (class extends Type { get idlType() { return "::Bun::IDLRawAny"; } @@ -15,7 +15,7 @@ export const RawAny: Type = new (class extends Type { } })(); -export const StrongAny: Type = new (class extends Type { +export const StrongAny = new (class extends Type { get idlType() { return "::Bun::Bindgen::IDLStrongAny"; } diff --git a/src/codegen/bindgenv2/internal/primitives.ts b/src/codegen/bindgenv2/internal/primitives.ts index 8711398867..1a8bfec31b 100644 --- a/src/codegen/bindgenv2/internal/primitives.ts +++ b/src/codegen/bindgenv2/internal/primitives.ts @@ -2,7 +2,7 @@ import assert from "node:assert"; import util from "node:util"; import { CodeStyle, Type } from "./base"; -export const bool: Type = new (class extends Type { +export const bool = new (class extends Type { /** Converts to a boolean, as if by calling `Boolean`. */ get loose() { return LooseBool; @@ -23,7 +23,7 @@ export const bool: Type = new (class extends Type { } })(); -export const LooseBool: Type = new (class extends Type { +export const LooseBool = new (class extends Type { get idlType() { return "::WebCore::IDLBoolean"; } @@ -163,7 +163,7 @@ const looseSignedTypes: { [width: number]: LooseIntegerType } = { 64: LooseI64, }; -export const f64: Type = new (class extends Type { +export const f64 = new (class extends Type { /** Does not allow NaN or infinities. */ get finite() { return FiniteF64; @@ -196,7 +196,7 @@ export const f64: Type = new (class extends Type { } })(); -export const FiniteF64: Type = new (class extends Type { +export const FiniteF64 = new (class extends Type { get idlType() { return "::Bun::IDLFiniteDouble"; } @@ -213,7 +213,7 @@ export const FiniteF64: Type = new (class extends Type { } })(); -export const LooseF64: Type = new (class extends Type { +export const LooseF64 = new (class extends Type { get idlType() { return "::WebCore::IDLUnrestrictedDouble"; } diff --git a/src/codegen/bindgenv2/internal/string.ts b/src/codegen/bindgenv2/internal/string.ts index cfd4712f88..48c7f86766 100644 --- a/src/codegen/bindgenv2/internal/string.ts +++ b/src/codegen/bindgenv2/internal/string.ts @@ -1,7 +1,7 @@ import assert from "node:assert"; import { CodeStyle, Type, toASCIILiteral } from "./base"; -export const String: Type = new (class extends Type { +export const String = new (class extends Type { /** Converts to a string, as if by calling `String`. */ get loose() { return LooseString; @@ -25,7 +25,7 @@ export const String: Type = new (class extends Type { } })(); -export const LooseString: Type = new (class extends Type { +export const LooseString = new (class extends Type { get idlType() { return "::Bun::IDLDOMString"; }