mirror of
https://gitee.com/openharmony/third_party_typescript
synced 2025-02-09 04:48:38 +00:00
Merge pull request #5909 from Microsoft/patch-stringify
Use typeof to check for presence of `JSON` global
This commit is contained in:
commit
b14b7e9172
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user