mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-01 11:42:55 -05:00
use typeof to check for presence of JSON global
This commit is contained in:
@@ -2400,7 +2400,7 @@ namespace ts {
|
||||
* Serialize an object graph into a JSON string. This is intended only for use on an acyclic graph
|
||||
* as the fallback implementation does not check for circular references by default.
|
||||
*/
|
||||
export const stringify: (value: any) => string = JSON && JSON.stringify
|
||||
export const stringify: (value: any) => string = typeof JSON !== "undefined" && JSON.stringify
|
||||
? JSON.stringify
|
||||
: stringifyFallback;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user