Skip to content

Commit

Permalink
[TIMOB-24769] Remove SBJSON from core
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Jun 4, 2017
1 parent c313d2c commit 8296a59
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 1,134 deletions.
4 changes: 2 additions & 2 deletions iphone/Classes/AnalyticsModule.m
Expand Up @@ -7,7 +7,7 @@

#import "AnalyticsModule.h"
#import "APSAnalytics/APSAnalytics.h"
#import "SBJSON.h"

extern BOOL const TI_APPLICATION_ANALYTICS;
static NSMutableArray* _filteredEvents;

Expand Down Expand Up @@ -78,7 +78,7 @@ -(NSInteger)featureEvent:(id)args
value = [NSDictionary dictionaryWithObject:data forKey:@"data"];
} else {
//if all else fails fall back old behavior
value = [SBJSON stringify:data];
value = [TiUtils jsonStringify:data];
value = [NSDictionary dictionaryWithObject:value forKey:@"data"];
}
data = value;
Expand Down
12 changes: 5 additions & 7 deletions iphone/Classes/AppModule.m
Expand Up @@ -8,7 +8,6 @@

#import "AppModule.h"
#import "TiHost.h"
#import "SBJSON.h"
#import "ListenerEntry.h"
#import "TiApp.h"
#if defined(USE_TI_APPIOS)
Expand Down Expand Up @@ -215,11 +214,10 @@ -(void)fireEvent:(NSArray*)args
// since this is cross context, we need to force into a JSON so the data can serialize
// we first force to string json, then we convert the string JSON back to a dictionary to
// eliminate any native things like functions, native objects, etc.
SBJSON *json = [[SBJSON alloc] init];
NSString *json_ = [SBJSON stringify:eventObject];
id jsonObject = [json fragmentWithString:json_ error:nil];
[json release];
for (ListenerEntry *entry in array)
NSString *json_ = [TiUtils jsonStringify:eventObject];
id jsonObject = [TiUtils jsonParse:json_ error:nil];

for (ListenerEntry *entry in array)
{
// fire application level event
[host fireEvent:[entry listener] withObject:jsonObject remove:NO context:[entry context] thisObject:nil];
Expand Down Expand Up @@ -629,4 +627,4 @@ -(id)iOS

@end

#endif
#endif
1 change: 0 additions & 1 deletion iphone/Classes/Bridge.m
Expand Up @@ -6,7 +6,6 @@
*/
#import <Foundation/Foundation.h>
#import "Bridge.h"
#import "SBJSON.h"
#import "TiModule.h"
#import "TiHost.h"

Expand Down
15 changes: 5 additions & 10 deletions iphone/Classes/GeolocationModule.m
Expand Up @@ -9,12 +9,12 @@
#import "GeolocationModule.h"
#import "TiApp.h"
#import "TiEvaluator.h"
#import "SBJSON.h"
#import <sys/utsname.h>
#import "NSData+Additions.h"
#import "APSAnalytics.h"
#import "AnalyticsModule.h"

#import <sys/utsname.h>

extern NSString * const TI_APPLICATION_GUID;
extern BOOL const TI_APPLICATION_ANALYTICS;

Expand Down Expand Up @@ -148,10 +148,8 @@ @implementation ReverseGeoCallback

-(void)requestSuccess:(NSString*)locationString
{
SBJSON *json = [[SBJSON alloc] init];
NSError * error = nil;
id event = [json fragmentWithString:locationString error:&error];
[json release];
id event = [TiUtils jsonParse:locationString error:&error];
if (error != nil) {
[self requestError:error];
}
Expand Down Expand Up @@ -591,15 +589,12 @@ -(void)getCurrentPosition:(id)callback

-(NSString *)lastGeolocation
{
SBJSON *json = [[SBJSON alloc] init];
NSString * result = [json stringWithObject:lastLocationDict error:nil];
[json release];
return result;
return [TiUtils jsonStringify:lastLocationDict error:nil];
}

-(NSNumber*)highAccuracy
{
return NUMBOOL(accuracy==kCLLocationAccuracyBest);
return NUMBOOL(accuracy == kCLLocationAccuracyBest);
}

-(void)setHighAccuracy:(NSNumber *)value
Expand Down
1 change: 0 additions & 1 deletion iphone/Classes/KrollCoverage.m
Expand Up @@ -9,7 +9,6 @@
#import "KrollCoverage.h"
#import "TiUtils.h"
#import "TiModule.h"
#import "SBJSON.h"

@implementation KrollCoverageObject

Expand Down
3 changes: 1 addition & 2 deletions iphone/Classes/KrollObject.m
Expand Up @@ -5,7 +5,6 @@
* Please see the LICENSE included with this distribution for details.
*/
#import <objc/runtime.h>
#import "SBJSON.h"
#import "KrollObject.h"
#import "KrollMethod.h"
#import "KrollCallback.h"
Expand Down Expand Up @@ -73,7 +72,7 @@ BOOL IsDateLike(TiContextRef jsContext, TiObjectRef object, TiValueRef *v)
//
NSString* TiValueToJSON(KrollContext *context, TiValueRef value)
{
return [SBJSON stringify:TiValueToId(context,value)];
return [TiUtils jsonStringify:TiValueToId(context,value)];
}

//
Expand Down
1 change: 0 additions & 1 deletion iphone/Classes/NetworkModule.m
Expand Up @@ -10,7 +10,6 @@
#import "NetworkModule.h"
#import "Reachability.h"
#import "TiApp.h"
#import "SBJSON.h"
#import "TiBlob.h"
#import "TiNetworkSocketProxy.h"
#import "TiUtils.h"
Expand Down
144 changes: 0 additions & 144 deletions iphone/Classes/SBJSON.h

This file was deleted.

0 comments on commit 8296a59

Please sign in to comment.