From 109ee8f95ff66f078197ade3b3d35786d722efa6 Mon Sep 17 00:00:00 2001 From: Joseph Martre Date: Sun, 4 May 2025 16:35:35 +0200 Subject: [PATCH 1/2] Add @throws JSDoc comments for BigInt methods and constructor --- src/lib/es2020.bigint.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index f1f3282306136..592dd77601ff5 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -90,6 +90,7 @@ interface BigInt { /** * Returns a string representation of an object. * @param radix Specifies a radix for converting numeric values to strings. + * @throws {RangeError} If `radix` is less than 2 or greater than 36. */ toString(radix?: number): string; @@ -103,6 +104,14 @@ interface BigInt { } interface BigIntConstructor { + /** + * Creates a BigInt value from a number, string, boolean, or another BigInt. + * + * @param value The value to convert to a BigInt. + * @throws {RangeError} If `value` is a non-integer number. + * @throws {TypeError} If `value` cannot be converted to a primitive, or if the primitive is undefined, null, or a symbol. + * @throws {SyntaxError} If `value` is a string that cannot be parsed as a BigInt. + */ (value: bigint | boolean | number | string): bigint; readonly prototype: BigInt; @@ -111,6 +120,7 @@ interface BigIntConstructor { * All higher bits are discarded. * @param bits The number of low bits to use * @param int The BigInt whose bits to extract + * @throws {RangeError} If `bits` is negative or greater than 2 ** 53 - 1. */ asIntN(bits: number, int: bigint): bigint; /** @@ -118,6 +128,7 @@ interface BigIntConstructor { * All higher bits are discarded. * @param bits The number of low bits to use * @param int The BigInt whose bits to extract + * @throws {RangeError} If `bits` is negative or greater than 2 ** 53 - 1. */ asUintN(bits: number, int: bigint): bigint; } From b2d153a4b6925ce5550e2a4a61ae8f55fed1ac5a Mon Sep 17 00:00:00 2001 From: Joseph Martre Date: Sun, 4 May 2025 17:11:33 +0200 Subject: [PATCH 2/2] Fix trailing whitespace to satisfy lint check --- src/lib/es2020.bigint.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 592dd77601ff5..b3293bb284555 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -106,7 +106,7 @@ interface BigInt { interface BigIntConstructor { /** * Creates a BigInt value from a number, string, boolean, or another BigInt. - * + * * @param value The value to convert to a BigInt. * @throws {RangeError} If `value` is a non-integer number. * @throws {TypeError} If `value` cannot be converted to a primitive, or if the primitive is undefined, null, or a symbol.