mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
[ReactNative] Allow JSON fragments on RCTJSONStringify
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
NSString *RCTJSONStringify(id jsonObject, NSError **error)
|
NSString *RCTJSONStringify(id jsonObject, NSError **error)
|
||||||
{
|
{
|
||||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:error];
|
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonObject options:(NSJSONWritingOptions)NSJSONReadingAllowFragments error:error];
|
||||||
return jsonData ? [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] : nil;
|
return jsonData ? [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] : nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user