From d88d3a46810bfae0b072beb023a2b09b8026b82c Mon Sep 17 00:00:00 2001 From: Joseph Martin Date: Sat, 3 May 2025 00:20:58 +0200 Subject: [PATCH] docs(lib): add @throws JSDoc for JSON methods (#61596) Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> --- src/lib/es5.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 786c953b42c..33f1a983208 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1140,6 +1140,7 @@ interface JSON { * @param text A valid JSON string. * @param reviver A function that transforms the results. This function is called for each member of the object. * If a member contains nested objects, the nested objects are transformed before the parent object is. + * @throws {SyntaxError} If `text` is not valid JSON. */ parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; /** @@ -1147,6 +1148,7 @@ interface JSON { * @param value A JavaScript value, usually an object or array, to be converted. * @param replacer A function that transforms the results. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @throws {TypeError} If a circular reference or a BigInt value is found. */ stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; /** @@ -1154,6 +1156,7 @@ interface JSON { * @param value A JavaScript value, usually an object or array, to be converted. * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @throws {TypeError} If a circular reference or a BigInt value is found. */ stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; }