support latest version

This commit is contained in:
Ari Lazier 2015-11-13 10:13:33 -08:00
parent 935b72bdac
commit 283826e687
2 changed files with 6 additions and 5 deletions

View File

@ -14,8 +14,8 @@ extern "C" {
#import <GCDWebServers/GCDWebServers.h>
#endif
@interface NSObject (RCTJavaScriptContext)
- (instancetype)initWithJSContext:(JSGlobalContextRef)context;
@interface NSObject ()
- (instancetype)initWithJSContext:(JSContext *)context NS_DESIGNATED_INITIALIZER;
- (JSGlobalContextRef)ctx;
@end
@ -29,8 +29,9 @@ JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executor, bool cre
if (!rctJSContext && create) {
Class RCTJavaScriptContext = NSClassFromString(@"RCTJavaScriptContext");
if (RCTJavaScriptContext) {
JSGlobalContextRef ctx = JSGlobalContextCreate(NULL);
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:ctx];
JSContext *context = [[JSContext alloc] init];
//JSGlobalContextRef ctx = JSGlobalContextCreate(NULL);
rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:context];
object_setIvar(executor, contextIvar, rctJSContext);
}
else {

View File

@ -6,7 +6,7 @@
"start": "node_modules/react-native/packager/packager.sh"
},
"dependencies": {
"react-native": "0.13.2",
"react-native": "0.14.2",
"realm": "file:../../lib",
"realm-tests": "file:.."
}