diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 280b8203ff..95bf4ff7fa 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -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;