diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 2d5105b3a..ef1ea0940 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -104,6 +104,7 @@ 2DD323EA1DA2DE3F000FE1B8 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */; }; 3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 357859011B28D2C500341EDB /* libRCTLinking.a */; }; 39AA31A41DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 39AA31A31DC1DFDC000F7EBB /* RCTUnicodeDecodeTests.m */; }; + 3D05746D1DE6008900184BB4 /* libRCTPushNotification-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */; }; 3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */; }; 3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */; }; 3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; }; @@ -288,6 +289,41 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTLinking; }; + 3D05746B1DE6008900184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D05745F1DE6004600184BB4; + remoteInfo = "RCTPushNotification-tvOS"; + }; + 3D05748B1DE6008900184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; + remoteInfo = cxxreact; + }; + 3D05748D1DE6008900184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; + remoteInfo = "cxxreact-tvOS"; + }; + 3D05748F1DE6008900184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; + remoteInfo = jschelpers; + }; + 3D0574911DE6008900184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; + remoteInfo = "jschelpers-tvOS"; + }; 3D13F84B1D6F6B5F00E69E0E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; @@ -479,6 +515,7 @@ 2DD323E41DA2DE3F000FE1B8 /* libRCTImage-tvOS.a in Frameworks */, 2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */, 2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */, + 3D05746D1DE6008900184BB4 /* libRCTPushNotification-tvOS.a in Frameworks */, 2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */, 2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */, 2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */, @@ -688,6 +725,10 @@ 2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */, 3D3C08811DE3424E00C268FA /* libCSSLayout.a */, 3D3C08831DE3424E00C268FA /* libCSSLayout-tvOS.a */, + 3D05748C1DE6008900184BB4 /* libcxxreact.a */, + 3D05748E1DE6008900184BB4 /* libcxxreact-tvOS.a */, + 3D0574901DE6008900184BB4 /* libjschelpers.a */, + 3D0574921DE6008900184BB4 /* libjschelpers-tvOS.a */, ); name = Products; sourceTree = ""; @@ -719,6 +760,7 @@ isa = PBXGroup; children = ( 14DC67F11AB71876001358AB /* libRCTPushNotification.a */, + 3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */, ); name = Products; sourceTree = ""; @@ -1210,6 +1252,41 @@ remoteRef = 357859001B28D2C500341EDB /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D05746C1DE6008900184BB4 /* libRCTPushNotification-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTPushNotification-tvOS.a"; + remoteRef = 3D05746B1DE6008900184BB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3D05748C1DE6008900184BB4 /* libcxxreact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcxxreact.a; + remoteRef = 3D05748B1DE6008900184BB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3D05748E1DE6008900184BB4 /* libcxxreact-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libcxxreact-tvOS.a"; + remoteRef = 3D05748D1DE6008900184BB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3D0574901DE6008900184BB4 /* libjschelpers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjschelpers.a; + remoteRef = 3D05748F1DE6008900184BB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3D0574921DE6008900184BB4 /* libjschelpers-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjschelpers-tvOS.a"; + remoteRef = 3D0574911DE6008900184BB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 3D3C08811DE3424E00C268FA /* libCSSLayout.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer-tvOS.xcscheme b/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer-tvOS.xcscheme index cf3a62f5e..4a8c0a340 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer-tvOS.xcscheme +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer-tvOS.xcscheme @@ -3,9 +3,23 @@ LastUpgradeVersion = "0810" version = "1.3"> + + + + @interface RCTConvert (Text) diff --git a/React.podspec b/React.podspec index 7596ccfd7..8d042951e 100644 --- a/React.podspec +++ b/React.podspec @@ -32,12 +32,24 @@ Pod::Spec.new do |s| s.subspec 'Core' do |ss| ss.dependency 'React/CSSLayout' + ss.dependency 'React/cxxreact' ss.source_files = "React/**/*.{c,h,m,mm,S}" ss.exclude_files = "**/__tests__/*", "IntegrationTests/* ReactCommon/CSSLayout/*" ss.frameworks = "JavaScriptCore" ss.libraries = "stdc++" end + s.subspec 'jschelpers' do |ss| + ss.source_files = 'ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper}.{cpp,h}' + ss.header_dir = 'jschelpers' + end + + s.subspec 'cxxreact' do |ss| + ss.dependency 'React/jschelpers' + ss.source_files = 'ReactCommon/cxxreact/{JSBundleType,oss-compat-util}.{cpp,h}' + ss.header_dir = 'cxxreact' + end + s.subspec 'CSSLayout' do |ss| ss.source_files = 'ReactCommon/CSSLayout/**/*.{c,h}' ss.header_dir = 'CSSLayout' diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index 20f3b51fa..2f296acad 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -9,15 +9,16 @@ #import "RCTJavaScriptLoader.h" +#import + +#import +#import + #import "RCTBridge.h" #import "RCTConvert.h" -#import "RCTJSCWrapper.h" -#import "RCTUtils.h" -#import "RCTPerformanceLogger.h" #import "RCTMultipartDataTask.h" - -#include -#include +#import "RCTPerformanceLogger.h" +#import "RCTUtils.h" NSString *const RCTJavaScriptLoaderErrorDomain = @"RCTJavaScriptLoaderErrorDomain"; diff --git a/React/Executors/RCTJSCErrorHandling.h b/React/Executors/RCTJSCErrorHandling.h index ad2f0c928..4e948fe20 100644 --- a/React/Executors/RCTJSCErrorHandling.h +++ b/React/Executors/RCTJSCErrorHandling.h @@ -11,8 +11,6 @@ #import -typedef struct RCTJSCWrapper RCTJSCWrapper; - /** Translates a given exception into an NSError. @@ -32,4 +30,4 @@ RCT_EXTERN NSError *RCTNSErrorFromJSError(JSValue *exception); @see RCTNSErrorFromJSError for details */ -RCT_EXTERN NSError *RCTNSErrorFromJSErrorRef(JSValueRef exception, JSGlobalContextRef ctx, RCTJSCWrapper *jscWrapper); +RCT_EXTERN NSError *RCTNSErrorFromJSErrorRef(JSValueRef exceptionRef, JSGlobalContextRef ctx); diff --git a/React/Executors/RCTJSCErrorHandling.m b/React/Executors/RCTJSCErrorHandling.mm similarity index 84% rename from React/Executors/RCTJSCErrorHandling.m rename to React/Executors/RCTJSCErrorHandling.mm index 000781e07..21dd74b85 100644 --- a/React/Executors/RCTJSCErrorHandling.m +++ b/React/Executors/RCTJSCErrorHandling.mm @@ -9,9 +9,10 @@ #include "RCTJSCErrorHandling.h" +#import + #import "RCTAssert.h" #import "RCTJSStackFrame.h" -#import "RCTJSCWrapper.h" NSString *const RCTJSExceptionUnsymbolicatedStackTraceKey = @"RCTJSExceptionUnsymbolicatedStackTraceKey"; @@ -31,9 +32,9 @@ NSError *RCTNSErrorFromJSError(JSValue *exception) return [NSError errorWithDomain:RCTErrorDomain code:1 userInfo:userInfo]; } -NSError *RCTNSErrorFromJSErrorRef(JSValueRef exceptionRef, JSGlobalContextRef ctx, RCTJSCWrapper *jscWrapper) +NSError *RCTNSErrorFromJSErrorRef(JSValueRef exceptionRef, JSGlobalContextRef ctx) { - JSContext *context = [jscWrapper->JSContext contextWithJSGlobalContextRef:ctx]; - JSValue *exception = [jscWrapper->JSValue valueWithJSValueRef:exceptionRef inContext:context]; + JSContext *context = [JSC_JSContext(ctx) contextWithJSGlobalContextRef:ctx]; + JSValue *exception = [JSC_JSValue(ctx) valueWithJSValueRef:exceptionRef inContext:context]; return RCTNSErrorFromJSError(exception); } diff --git a/React/Executors/RCTJSCExecutor.mm b/React/Executors/RCTJSCExecutor.mm index d69811528..f45067eb3 100644 --- a/React/Executors/RCTJSCExecutor.mm +++ b/React/Executors/RCTJSCExecutor.mm @@ -18,6 +18,7 @@ #import #import +#import #import "JSCSamplingProfiler.h" #import "RCTAssert.h" @@ -26,7 +27,6 @@ #import "RCTDevMenu.h" #import "RCTJSCErrorHandling.h" #import "RCTJSCProfiler.h" -#import "RCTJSCWrapper.h" #import "RCTJavaScriptLoader.h" #import "RCTLog.h" #import "RCTPerformanceLogger.h" @@ -87,7 +87,6 @@ struct RCTJSContextData { BOOL tryBytecode; NSThread *javaScriptThread; JSContext *context; - RCTJSCWrapper *jscWrapper; }; @interface RCTJSContextProvider () @@ -161,7 +160,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init) // Set at setUp time: RCTPerformanceLogger *_performanceLogger; - RCTJSCWrapper *_jscWrapper; RCTJavaScriptContext *_context; // Set as needed: @@ -278,7 +276,6 @@ static NSThread *newJavaScriptThread(void) _tryBytecode = data.tryBytecode; _valid = YES; _javaScriptThread = data.javaScriptThread; - _jscWrapper = data.jscWrapper; _context = [[RCTJavaScriptContext alloc] initWithJSContext:data.context onThread:_javaScriptThread]; } return self; @@ -299,7 +296,6 @@ static NSThread *newJavaScriptThread(void) } return executeApplicationScript(taggedScript, sourceURL, - _jscWrapper, _performanceLogger, _context.context.JSGlobalContextRef); } @@ -335,18 +331,17 @@ static NSThread *newJavaScriptThread(void) return; } + JSGlobalContextRef contextRef = nullptr; JSContext *context = nil; - if (self->_jscWrapper) { - RCTAssert(self->_context != nil, @"If wrapper was pre-initialized, context should be too"); + if (self->_context) { context = self->_context.context; + contextRef = context.JSGlobalContextRef; } else { - [self->_performanceLogger markStartForTag:RCTPLJSCWrapperOpenLibrary]; - self->_jscWrapper = RCTJSCWrapperCreate(self->_useCustomJSCLibrary); - [self->_performanceLogger markStopForTag:RCTPLJSCWrapperOpenLibrary]; - - RCTAssert(self->_context == nil, @"Didn't expect to set up twice"); - self->_jscWrapper->configureJSCForIOS(); - context = [self->_jscWrapper->JSContext new]; + if (self->_useCustomJSCLibrary) { + JSC_configureJSCForIOS(true); + } + contextRef = JSC_JSGlobalContextCreateInGroup(self->_useCustomJSCLibrary, nullptr, nullptr); + context = [JSC_JSContext(contextRef) contextWithJSGlobalContextRef:contextRef]; self->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context onThread:self->_javaScriptThread]; [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification object:context]; @@ -356,12 +351,11 @@ static NSThread *newJavaScriptThread(void) NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary]; if (!threadDictionary[RCTFBJSContextClassKey] || !threadDictionary[RCTFBJSValueClassKey]) { - threadDictionary[RCTFBJSContextClassKey] = self->_jscWrapper->JSContext; - threadDictionary[RCTFBJSValueClassKey] = self->_jscWrapper->JSValue; + threadDictionary[RCTFBJSContextClassKey] = JSC_JSContext(contextRef); + threadDictionary[RCTFBJSValueClassKey] = JSC_JSValue(contextRef); } __weak RCTJSCExecutor *weakSelf = self; - context[@"nativeRequireModuleConfig"] = ^NSArray *(NSString *moduleName) { RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf.valid) { @@ -419,32 +413,38 @@ static NSThread *newJavaScriptThread(void) }; // Add toggles for JSC's sampling profiler, if the profiler is enabled - if (self->_jscWrapper->JSSamplingProfilerEnabled()) { + if (JSC_JSSamplingProfilerEnabled(context.JSGlobalContextRef)) { // Mark this thread as the main JS thread before starting profiling. - self->_jscWrapper->JSStartSamplingProfilingOnMainJSCThread(context.JSGlobalContextRef); + JSC_JSStartSamplingProfilingOnMainJSCThread(context.JSGlobalContextRef); // Allow to toggle the sampling profiler through RN's dev menu __weak JSContext *weakContext = self->_context.context; [self->_bridge.devMenu addItem:[RCTDevMenuItem buttonItemWithTitle:@"Start / Stop JS Sampling Profiler" handler:^{ - // JSPokeSamplingProfiler() toggles the profiling process - JSValueRef jsResult = self->_jscWrapper->JSPokeSamplingProfiler(weakContext.JSGlobalContextRef); + RCTJSCExecutor *strongSelf = weakSelf; + if (!strongSelf.valid || !weakContext) { + return; + } - if (!self->_jscWrapper->JSValueIsNull(weakContext.JSGlobalContextRef, jsResult)) { - NSString *results = [[self->_jscWrapper->JSValue valueWithJSValueRef:jsResult inContext:weakContext] toObject]; - JSCSamplingProfiler *profilerModule = [self->_bridge moduleForClass:[JSCSamplingProfiler class]]; + // JSPokeSamplingProfiler() toggles the profiling process + JSGlobalContextRef ctx = weakContext.JSGlobalContextRef; + JSValueRef jsResult = JSC_JSPokeSamplingProfiler(ctx); + + if (JSC_JSValueGetType(ctx, jsResult) != kJSTypeNull) { + NSString *results = [[JSC_JSValue(ctx) valueWithJSValueRef:jsResult inContext:weakContext] toObject]; + JSCSamplingProfiler *profilerModule = [strongSelf->_bridge moduleForClass:[JSCSamplingProfiler class]]; [profilerModule operationCompletedWithResults:results]; } }]]; // Allow for the profiler to be poked from JS code as well // (see SamplingProfiler.js for an example of how it could be used with the JSCSamplingProfiler module). - context[@"pokeSamplingProfiler"] = ^(NSDictionary *){ - RCTJSCExecutor *strongSelf = weakSelf; - if (!strongSelf.isValid) { + context[@"pokeSamplingProfiler"] = ^NSDictionary *() { + if (!weakContext) { return @{}; } - JSValueRef result = strongSelf->_jscWrapper->JSPokeSamplingProfiler(weakContext.JSGlobalContextRef); - return (NSDictionary *)[[strongSelf->_jscWrapper->JSValue valueWithJSValueRef:result inContext:weakContext] toObject]; + JSGlobalContextRef ctx = weakContext.JSGlobalContextRef; + JSValueRef result = JSC_JSPokeSamplingProfiler(ctx); + return [[JSC_JSValue(ctx) valueWithJSValueRef:result inContext:weakContext] toObject]; }; } #endif @@ -459,12 +459,12 @@ static NSThread *newJavaScriptThread(void) return; } - RCTJSCWrapper *jscWrapper = strongSelf->_jscWrapper; - JSStringRef execJSString = jscWrapper->JSStringCreateWithUTF8CString(sourceCode.UTF8String); - JSStringRef jsURL = jscWrapper->JSStringCreateWithUTF8CString(sourceCodeURL.UTF8String); - jscWrapper->JSEvaluateScript(strongSelf->_context.context.JSGlobalContextRef, execJSString, NULL, jsURL, 0, NULL); - jscWrapper->JSStringRelease(jsURL); - jscWrapper->JSStringRelease(execJSString); + JSGlobalContextRef ctx = strongSelf->_context.context.JSGlobalContextRef; + JSStringRef execJSString = JSC_JSStringCreateWithUTF8CString(ctx, sourceCode.UTF8String); + JSStringRef jsURL = JSC_JSStringCreateWithUTF8CString(ctx, sourceCodeURL.UTF8String); + JSC_JSEvaluateScript(ctx, execJSString, NULL, jsURL, 0, NULL); + JSC_JSStringRelease(ctx, jsURL); + JSC_JSStringRelease(ctx, execJSString); }; #endif }]; @@ -544,7 +544,7 @@ static void installBasicSynchronousHooksOnContext(JSContext *context) - (int32_t)bytecodeFileFormatVersion { return _tryBytecode - ? _jscWrapper->JSBytecodeFileFormatVersion + ? facebook::react::customJSCWrapper()->JSBytecodeFileFormatVersion : JSNoBytecodeFileFormatVersion; } @@ -570,11 +570,6 @@ RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)contextName) _randomAccessBundle.bundle.reset(); _randomAccessBundle.table.reset(); - - if (_jscWrapper) { - RCTJSCWrapperRelease(_jscWrapper); - _jscWrapper = NULL; - } } - (void)flushedQueue:(RCTJavaScriptCallback)onComplete @@ -628,42 +623,41 @@ RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)contextName) RCT_PROFILE_BEGIN_EVENT(0, @"executeJSCall", (@{@"method": method, @"args": arguments})); - RCTJSCWrapper *jscWrapper = strongSelf->_jscWrapper; JSContext *context = strongSelf->_context.context; - JSGlobalContextRef contextJSRef = context.JSGlobalContextRef; + JSGlobalContextRef ctx = context.JSGlobalContextRef; // get the BatchedBridge object JSValueRef errorJSRef = NULL; JSValueRef batchedBridgeRef = strongSelf->_batchedBridgeRef; if (!batchedBridgeRef) { - JSStringRef moduleNameJSStringRef = jscWrapper->JSStringCreateWithUTF8CString("__fbBatchedBridge"); - JSObjectRef globalObjectJSRef = jscWrapper->JSContextGetGlobalObject(contextJSRef); - batchedBridgeRef = jscWrapper->JSObjectGetProperty(contextJSRef, globalObjectJSRef, moduleNameJSStringRef, &errorJSRef); - jscWrapper->JSStringRelease(moduleNameJSStringRef); + JSStringRef moduleNameJSStringRef = JSC_JSStringCreateWithUTF8CString(ctx, "__fbBatchedBridge"); + JSObjectRef globalObjectJSRef = JSC_JSContextGetGlobalObject(ctx); + batchedBridgeRef = JSC_JSObjectGetProperty(ctx, globalObjectJSRef, moduleNameJSStringRef, &errorJSRef); + JSC_JSStringRelease(ctx, moduleNameJSStringRef); strongSelf->_batchedBridgeRef = batchedBridgeRef; } NSError *error; JSValueRef resultJSRef = NULL; - if (batchedBridgeRef != NULL && errorJSRef == NULL && !jscWrapper->JSValueIsUndefined(contextJSRef, batchedBridgeRef)) { + if (batchedBridgeRef != NULL && errorJSRef == NULL && JSC_JSValueGetType(ctx, batchedBridgeRef) != kJSTypeUndefined) { // get method - JSStringRef methodNameJSStringRef = jscWrapper->JSStringCreateWithCFString((__bridge CFStringRef)method); - JSValueRef methodJSRef = jscWrapper->JSObjectGetProperty(contextJSRef, (JSObjectRef)batchedBridgeRef, methodNameJSStringRef, &errorJSRef); - jscWrapper->JSStringRelease(methodNameJSStringRef); + JSStringRef methodNameJSStringRef = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)method); + JSValueRef methodJSRef = JSC_JSObjectGetProperty(ctx, (JSObjectRef)batchedBridgeRef, methodNameJSStringRef, &errorJSRef); + JSC_JSStringRelease(ctx, methodNameJSStringRef); - if (methodJSRef != NULL && errorJSRef == NULL && !jscWrapper->JSValueIsUndefined(contextJSRef, methodJSRef)) { + if (methodJSRef != NULL && errorJSRef == NULL && JSC_JSValueGetType(ctx, methodJSRef) != kJSTypeUndefined) { JSValueRef jsArgs[arguments.count]; for (NSUInteger i = 0; i < arguments.count; i++) { - jsArgs[i] = [jscWrapper->JSValue valueWithObject:arguments[i] inContext:context].JSValueRef; + jsArgs[i] = [JSC_JSValue(ctx) valueWithObject:arguments[i] inContext:context].JSValueRef; } - resultJSRef = jscWrapper->JSObjectCallAsFunction(contextJSRef, (JSObjectRef)methodJSRef, (JSObjectRef)batchedBridgeRef, arguments.count, jsArgs, &errorJSRef); + resultJSRef = JSC_JSObjectCallAsFunction(ctx, (JSObjectRef)methodJSRef, (JSObjectRef)batchedBridgeRef, arguments.count, jsArgs, &errorJSRef); } else { - if (!errorJSRef && jscWrapper->JSValueIsUndefined(contextJSRef, methodJSRef)) { + if (!errorJSRef && JSC_JSValueGetType(ctx, methodJSRef) == kJSTypeUndefined) { error = RCTErrorWithMessage([NSString stringWithFormat:@"Unable to execute JS call: method %@ is undefined", method]); } } } else { - if (!errorJSRef && jscWrapper->JSValueIsUndefined(contextJSRef, batchedBridgeRef)) { + if (!errorJSRef && JSC_JSValueGetType(ctx, batchedBridgeRef) == kJSTypeUndefined) { error = RCTErrorWithMessage(@"Unable to execute JS call: __fbBatchedBridge is undefined"); } } @@ -671,13 +665,13 @@ RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)contextName) id objcValue; if (errorJSRef || error) { if (!error) { - error = RCTNSErrorFromJSError([jscWrapper->JSValue valueWithJSValueRef:errorJSRef inContext:context]); + error = RCTNSErrorFromJSError([JSC_JSValue(ctx) valueWithJSValueRef:errorJSRef inContext:context]); } } else { // We often return `null` from JS when there is nothing for native side. [JSValue toValue] // returns [NSNull null] in this case, which we don't want. - if (!jscWrapper->JSValueIsNull(contextJSRef, resultJSRef)) { - JSValue *result = [jscWrapper->JSValue valueWithJSValueRef:resultJSRef inContext:context]; + if (JSC_JSValueGetType(ctx, resultJSRef) != kJSTypeNull) { + JSValue *result = [JSC_JSValue(ctx) valueWithJSValueRef:resultJSRef inContext:context]; objcValue = unwrapResult ? [result toObject] : result; } } @@ -719,7 +713,6 @@ RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)contextName) } NSError *error = executeApplicationScript(taggedScript, sourceURL, - self->_jscWrapper, self->_performanceLogger, self->_context.context.JSGlobalContextRef); if (onComplete) { @@ -774,7 +767,6 @@ static void registerNativeRequire(JSContext *context, RCTJSCExecutor *executor) static NSError *executeApplicationScript(TaggedScript taggedScript, NSURL *sourceURL, - RCTJSCWrapper *jscWrapper, RCTPerformanceLogger *performanceLogger, JSGlobalContextRef ctx) { @@ -784,15 +776,15 @@ static NSError *executeApplicationScript(TaggedScript taggedScript, [performanceLogger markStartForTag:RCTPLScriptExecution]; JSValueRef jsError = NULL; - JSStringRef bundleURL = jscWrapper->JSStringCreateWithUTF8CString(sourceURL.absoluteString.UTF8String); + JSStringRef bundleURL = JSC_JSStringCreateWithUTF8CString(ctx, sourceURL.absoluteString.UTF8String); switch (taggedScript.tag) { case facebook::react::ScriptTag::RAMBundle: /* fallthrough */ case facebook::react::ScriptTag::String: { - JSStringRef execJSString = jscWrapper->JSStringCreateWithUTF8CString((const char *)taggedScript.script.bytes); - jscWrapper->JSEvaluateScript(ctx, execJSString, NULL, bundleURL, 0, &jsError); - jscWrapper->JSStringRelease(execJSString); + JSStringRef execJSString = JSC_JSStringCreateWithUTF8CString(ctx, (const char *)taggedScript.script.bytes); + JSC_JSEvaluateScript(ctx, execJSString, NULL, bundleURL, 0, &jsError); + JSC_JSStringRelease(ctx, execJSString); break; } @@ -800,16 +792,16 @@ static NSError *executeApplicationScript(TaggedScript taggedScript, file_ptr source(fopen(sourceURL.path.UTF8String, "r"), fclose); int sourceFD = fileno(source.get()); - jscWrapper->JSEvaluateBytecodeBundle(ctx, NULL, sourceFD, bundleURL, &jsError); + JSC_JSEvaluateBytecodeBundle(ctx, NULL, sourceFD, bundleURL, &jsError); break; } } - jscWrapper->JSStringRelease(bundleURL); + JSC_JSStringRelease(ctx, bundleURL); [performanceLogger markStopForTag:RCTPLScriptExecution]; NSError *error = jsError - ? RCTNSErrorFromJSErrorRef(jsError, ctx, jscWrapper) + ? RCTNSErrorFromJSErrorRef(jsError, ctx) : nil; RCT_PROFILE_END_EVENT(0, @"js_call"); @@ -853,11 +845,10 @@ static NSError *executeApplicationScript(TaggedScript taggedScript, } RCT_PROFILE_BEGIN_EVENT(0, @"injectJSONText", @{@"objectName": objectName}); - RCTJSCWrapper *jscWrapper = strongSelf->_jscWrapper; - JSStringRef execJSString = jscWrapper->JSStringCreateWithCFString((__bridge CFStringRef)script); JSGlobalContextRef ctx = strongSelf->_context.context.JSGlobalContextRef; - JSValueRef valueToInject = jscWrapper->JSValueMakeFromJSONString(ctx, execJSString); - jscWrapper->JSStringRelease(execJSString); + JSStringRef execJSString = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)script); + JSValueRef valueToInject = JSC_JSValueMakeFromJSONString(ctx, execJSString); + JSC_JSStringRelease(ctx, execJSString); NSError *error; if (!valueToInject) { @@ -865,14 +856,14 @@ static NSError *executeApplicationScript(TaggedScript taggedScript, error = [NSError errorWithDomain:RCTErrorDomain code:2 userInfo:@{NSLocalizedDescriptionKey: errorMessage}]; RCTLogError(@"%@", errorMessage); } else { - JSObjectRef globalObject = jscWrapper->JSContextGetGlobalObject(ctx); - JSStringRef JSName = jscWrapper->JSStringCreateWithCFString((__bridge CFStringRef)objectName); + JSObjectRef globalObject = JSC_JSContextGetGlobalObject(ctx); + JSStringRef JSName = JSC_JSStringCreateWithCFString(ctx, (__bridge CFStringRef)objectName); JSValueRef jsError = NULL; - jscWrapper->JSObjectSetProperty(ctx, globalObject, JSName, valueToInject, kJSPropertyAttributeNone, &jsError); - jscWrapper->JSStringRelease(JSName); + JSC_JSObjectSetProperty(ctx, globalObject, JSName, valueToInject, kJSPropertyAttributeNone, &jsError); + JSC_JSStringRelease(ctx, JSName); if (jsError) { - error = RCTNSErrorFromJSErrorRef(jsError, ctx, jscWrapper); + error = RCTNSErrorFromJSErrorRef(jsError, ctx); } } RCT_PROFILE_END_EVENT(0, @"js_call,json_call"); @@ -900,18 +891,17 @@ static void executeRandomAccessModule(RCTJSCExecutor *executor, uint32_t moduleI char url[14]; // 10 = maximum decimal digits in a 32bit unsigned int + ".js" + null byte sprintf(url, "%" PRIu32 ".js", moduleID); - RCTJSCWrapper *jscWrapper = executor->_jscWrapper; - JSStringRef code = jscWrapper->JSStringCreateWithUTF8CString(data.get()); - JSValueRef jsError = NULL; - JSStringRef sourceURL = jscWrapper->JSStringCreateWithUTF8CString(url); JSGlobalContextRef ctx = executor->_context.context.JSGlobalContextRef; - JSValueRef result = jscWrapper->JSEvaluateScript(ctx, code, NULL, sourceURL, 0, &jsError); + JSStringRef code = JSC_JSStringCreateWithUTF8CString(ctx, data.get()); + JSValueRef jsError = NULL; + JSStringRef sourceURL = JSC_JSStringCreateWithUTF8CString(ctx, url); + JSValueRef result = JSC_JSEvaluateScript(ctx, code, NULL, sourceURL, 0, &jsError); - jscWrapper->JSStringRelease(code); - jscWrapper->JSStringRelease(sourceURL); + JSC_JSStringRelease(ctx, code); + JSC_JSStringRelease(ctx, sourceURL); if (!result) { - NSError *error = RCTNSErrorFromJSErrorRef(jsError, ctx, jscWrapper); + NSError *error = RCTNSErrorFromJSErrorRef(jsError, ctx); dispatch_async(dispatch_get_main_queue(), ^{ RCTFatal(error); [executor invalidate]; @@ -1017,7 +1007,6 @@ static NSData *loadRAMBundle(NSURL *sourceURL, NSError **error, RandomAccessBund dispatch_semaphore_t _semaphore; NSThread *_javaScriptThread; JSContext *_context; - RCTJSCWrapper *_jscWrapper; } - (instancetype)initWithUseCustomJSCLibrary:(BOOL)useCustomJSCLibrary @@ -1035,9 +1024,11 @@ static NSData *loadRAMBundle(NSURL *sourceURL, NSError **error, RandomAccessBund - (void)_createContext { - _jscWrapper = RCTJSCWrapperCreate(_useCustomJSCLibrary); - _jscWrapper->configureJSCForIOS(); - _context = [_jscWrapper->JSContext new]; + if (_useCustomJSCLibrary) { + JSC_configureJSCForIOS(true); + } + JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(_useCustomJSCLibrary, nullptr, nullptr); + _context = [JSC_JSContext(ctx) contextWithJSGlobalContextRef:ctx]; installBasicSynchronousHooksOnContext(_context); dispatch_semaphore_signal(_semaphore); } @@ -1051,7 +1042,6 @@ static NSData *loadRAMBundle(NSURL *sourceURL, NSError **error, RandomAccessBund .tryBytecode = _tryBytecode, .javaScriptThread = _javaScriptThread, .context = _context, - .jscWrapper = _jscWrapper, }; } diff --git a/React/Executors/RCTJSCWrapper.h b/React/Executors/RCTJSCWrapper.h deleted file mode 100644 index 769d696d1..000000000 --- a/React/Executors/RCTJSCWrapper.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import "RCTDefines.h" - -typedef void (*voidWithNoParamsFuncType)(); -typedef JSStringRef (*JSStringCreateWithCFStringFuncType)(CFStringRef); -typedef JSStringRef (*JSStringCreateWithUTF8CStringFuncType)(const char *); -typedef CFStringRef (*JSStringCopyCFStringFuncType)(CFAllocatorRef, JSStringRef); -typedef void (*JSStringReleaseFuncType)(JSStringRef); -typedef void (*JSGlobalContextSetNameFuncType)(JSGlobalContextRef, JSStringRef); -typedef void (*JSObjectSetPropertyFuncType)(JSContextRef, JSObjectRef, JSStringRef, JSValueRef, JSPropertyAttributes, JSValueRef *); -typedef JSObjectRef (*JSContextGetGlobalObjectFuncType)(JSContextRef); -typedef JSValueRef (*JSObjectGetPropertyFuncType)(JSContextRef, JSObjectRef, JSStringRef, JSValueRef *); -typedef bool (*JSObjectIsFunctionFuncType)(JSContextRef, JSObjectRef); -typedef bool (*JSObjectIsConstructorFuncType)(JSContextRef, JSObjectRef); -typedef JSPropertyNameArrayRef (*JSObjectCopyPropertyNamesFuncType)(JSContextRef, JSObjectRef); -typedef size_t (*JSPropertyNameArrayGetCountFuncType)(JSPropertyNameArrayRef); -typedef JSStringRef (*JSPropertyNameArrayGetNameAtIndexFuncType)(JSPropertyNameArrayRef, size_t); -typedef void (*JSPropertyNameArrayReleaseFuncType)(JSPropertyNameArrayRef); -typedef JSValueRef (*JSValueMakeFromJSONStringFuncType)(JSContextRef, JSStringRef); -typedef JSValueRef (*JSObjectCallAsFunctionFuncType)(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef *, JSValueRef *); -typedef JSValueRef (*JSValueRefWithJSContextRefFuncType)(JSContextRef); -typedef JSStringRef (*JSValueCreateJSONStringFuncType)(JSContextRef, JSValueRef, unsigned, JSValueRef *); -typedef bool (*JSValueIsUndefinedFuncType)(JSContextRef, JSValueRef); -typedef bool (*JSValueIsNullFuncType)(JSContextRef, JSValueRef); -typedef JSObjectRef (*JSValueToObjectFuncType)(JSContextRef, JSValueRef, JSValueRef *); -typedef JSValueRef (*JSEvaluateScriptFuncType)(JSContextRef, JSStringRef, JSObjectRef, JSStringRef, int, JSValueRef *); -typedef JSValueRef (*JSEvaluateBytecodeBundleFuncType)(JSContextRef, JSObjectRef, int, JSStringRef, JSValueRef *); -typedef bool (*JSSamplingProfilerEnabledFuncType)(); -typedef void (*JSStartSamplingProfilingOnMainJSCThreadFuncType)(JSGlobalContextRef); - -/** - * JSNoBytecodeFileFormatVersion - * - * Version number indicating that bytecode is not supported by this runtime. - */ -extern const int32_t JSNoBytecodeFileFormatVersion; - -typedef struct RCTJSCWrapper { - JSStringCreateWithCFStringFuncType JSStringCreateWithCFString; - JSStringCreateWithUTF8CStringFuncType JSStringCreateWithUTF8CString; - JSStringCopyCFStringFuncType JSStringCopyCFString; - JSStringReleaseFuncType JSStringRelease; - JSGlobalContextSetNameFuncType JSGlobalContextSetName; - JSObjectSetPropertyFuncType JSObjectSetProperty; - JSContextGetGlobalObjectFuncType JSContextGetGlobalObject; - JSObjectGetPropertyFuncType JSObjectGetProperty; - JSObjectIsFunctionFuncType JSObjectIsFunction; - JSObjectIsConstructorFuncType JSObjectIsConstructor; - JSObjectCopyPropertyNamesFuncType JSObjectCopyPropertyNames; - JSPropertyNameArrayGetCountFuncType JSPropertyNameArrayGetCount; - JSPropertyNameArrayGetNameAtIndexFuncType JSPropertyNameArrayGetNameAtIndex; - JSPropertyNameArrayReleaseFuncType JSPropertyNameArrayRelease; - JSValueMakeFromJSONStringFuncType JSValueMakeFromJSONString; - JSObjectCallAsFunctionFuncType JSObjectCallAsFunction; - JSValueRefWithJSContextRefFuncType JSValueMakeNull; - JSValueCreateJSONStringFuncType JSValueCreateJSONString; - JSValueIsUndefinedFuncType JSValueIsUndefined; - JSValueIsNullFuncType JSValueIsNull; - JSValueToObjectFuncType JSValueToObject; - JSEvaluateScriptFuncType JSEvaluateScript; - JSEvaluateBytecodeBundleFuncType JSEvaluateBytecodeBundle; - voidWithNoParamsFuncType configureJSCForIOS; - JSSamplingProfilerEnabledFuncType JSSamplingProfilerEnabled; - JSValueRefWithJSContextRefFuncType JSPokeSamplingProfiler; - JSStartSamplingProfilingOnMainJSCThreadFuncType JSStartSamplingProfilingOnMainJSCThread; - const int32_t JSBytecodeFileFormatVersion; - Class JSContext; - Class JSValue; -} RCTJSCWrapper; - -RCT_EXTERN RCTJSCWrapper *RCTJSCWrapperCreate(BOOL useCustomJSC); -RCT_EXTERN void RCTJSCWrapperRelease(RCTJSCWrapper *wrapper); - -/** - * Link time overridable initialization function to execute custom - * initialization code when loading custom JSC. - * - * By default it does nothing. - * - * @param handle to the dlopen'd JSC library. - */ -void __attribute__((visibility("hidden"))) RCTCustomJSCInit(void *handle); diff --git a/React/Executors/RCTJSCWrapper.mm b/React/Executors/RCTJSCWrapper.mm deleted file mode 100644 index adca825b2..000000000 --- a/React/Executors/RCTJSCWrapper.mm +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "RCTJSCWrapper.h" - -#import -#import - -#import "RCTLog.h" - -#include - -// Crash the app (with a descriptive stack trace) if a function that is not -// supported by the system JSC is called. -#define UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(FUNC_NAME) \ -static void Unimplemented##FUNC_NAME(void* args...) { \ -assert(false);\ -} - -UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSEvaluateBytecodeBundle) -UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSPokeSamplingProfiler) -UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSStartSamplingProfilingOnMainJSCThread) - -#undef UNIMPLEMENTED_SYSTEM_JSC_FUNCTION - -// A no-op function, to replace void functions that do no exist in the system JSC -// with a function that does nothing. -static void noOpSystemJSCFunc(void *args...){ } -static bool alwaysFalseSystemJSCFunc(void *args...){ return false; } - -static void *RCTCustomLibraryHandler(void) -{ - static dispatch_once_t token; - static void *handler; - dispatch_once(&token, ^{ - handler = dlopen("@loader_path/Frameworks/JSC.framework/JSC", RTLD_LAZY | RTLD_LOCAL); - if (!handler) { - const char *err = dlerror(); - - // Ignore the dlopen failure if custom JSC wasn't included in our app - // bundle. Unfortunately dlopen only provides string based errors. - if (err != nullptr && strstr(err, "image not found") == nullptr) { - RCTLogWarn(@"Can't load custom JSC library: %s", err); - } - } - }); - - return handler; -} - -const int32_t JSNoBytecodeFileFormatVersion = -1; - -static RCTJSCWrapper *RCTSetUpSystemLibraryPointers() -{ - return new RCTJSCWrapper { - .JSStringCreateWithCFString = JSStringCreateWithCFString, - .JSStringCreateWithUTF8CString = JSStringCreateWithUTF8CString, - .JSStringCopyCFString = JSStringCopyCFString, - .JSStringRelease = JSStringRelease, - .JSGlobalContextSetName = JSGlobalContextSetName, - .JSObjectSetProperty = JSObjectSetProperty, - .JSContextGetGlobalObject = JSContextGetGlobalObject, - .JSObjectGetProperty = JSObjectGetProperty, - .JSObjectIsFunction = JSObjectIsFunction, - .JSObjectIsConstructor = JSObjectIsConstructor, - .JSObjectCopyPropertyNames = JSObjectCopyPropertyNames, - .JSPropertyNameArrayGetCount = JSPropertyNameArrayGetCount, - .JSPropertyNameArrayGetNameAtIndex = JSPropertyNameArrayGetNameAtIndex, - .JSPropertyNameArrayRelease = JSPropertyNameArrayRelease, - .JSValueMakeFromJSONString = JSValueMakeFromJSONString, - .JSObjectCallAsFunction = JSObjectCallAsFunction, - .JSValueMakeNull = JSValueMakeNull, - .JSValueCreateJSONString = JSValueCreateJSONString, - .JSValueIsUndefined = JSValueIsUndefined, - .JSValueIsNull = JSValueIsNull, - .JSValueToObject = JSValueToObject, - .JSEvaluateScript = JSEvaluateScript, - .JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion, - .JSEvaluateBytecodeBundle = (JSEvaluateBytecodeBundleFuncType)UnimplementedJSEvaluateBytecodeBundle, - .configureJSCForIOS = (voidWithNoParamsFuncType)noOpSystemJSCFunc, - .JSSamplingProfilerEnabled = (JSSamplingProfilerEnabledFuncType)alwaysFalseSystemJSCFunc, - .JSPokeSamplingProfiler = (JSValueRefWithJSContextRefFuncType)UnimplementedJSPokeSamplingProfiler, - .JSStartSamplingProfilingOnMainJSCThread = (JSStartSamplingProfilingOnMainJSCThreadFuncType)UnimplementedJSStartSamplingProfilingOnMainJSCThread, - .JSContext = [JSContext class], - .JSValue = [JSValue class], - }; -} - -static RCTJSCWrapper *RCTSetUpCustomLibraryPointers() -{ - void *libraryHandle = RCTCustomLibraryHandler(); - if (!libraryHandle) { - return RCTSetUpSystemLibraryPointers(); - } - - auto wrapper = new RCTJSCWrapper { - .JSStringCreateWithCFString = (JSStringCreateWithCFStringFuncType)dlsym(libraryHandle, "JSStringCreateWithCFString"), - .JSStringCreateWithUTF8CString = (JSStringCreateWithUTF8CStringFuncType)dlsym(libraryHandle, "JSStringCreateWithUTF8CString"), - .JSStringCopyCFString = (JSStringCopyCFStringFuncType)dlsym(libraryHandle, "JSStringCopyCFString"), - .JSStringRelease = (JSStringReleaseFuncType)dlsym(libraryHandle, "JSStringRelease"), - .JSGlobalContextSetName = (JSGlobalContextSetNameFuncType)dlsym(libraryHandle, "JSGlobalContextSetName"), - .JSObjectSetProperty = (JSObjectSetPropertyFuncType)dlsym(libraryHandle, "JSObjectSetProperty"), - .JSContextGetGlobalObject = (JSContextGetGlobalObjectFuncType)dlsym(libraryHandle, "JSContextGetGlobalObject"), - .JSObjectGetProperty = (JSObjectGetPropertyFuncType)dlsym(libraryHandle, "JSObjectGetProperty"), - .JSObjectIsFunction = (JSObjectIsFunctionFuncType)dlsym(libraryHandle, "JSObjectIsFunction"), - .JSObjectIsConstructor = (JSObjectIsConstructorFuncType)dlsym(libraryHandle, "JSObjectIsConstructor"), - .JSObjectCopyPropertyNames = (JSObjectCopyPropertyNamesFuncType)dlsym(libraryHandle, "JSObjectCopyPropertyNames"), - .JSPropertyNameArrayGetCount = (JSPropertyNameArrayGetCountFuncType)dlsym(libraryHandle, "JSPropertyNameArrayGetCount"), - .JSPropertyNameArrayGetNameAtIndex = (JSPropertyNameArrayGetNameAtIndexFuncType)dlsym(libraryHandle, "JSPropertyNameArrayGetNameAtIndex"), - .JSPropertyNameArrayRelease = (JSPropertyNameArrayReleaseFuncType)dlsym(libraryHandle, "JSPropertyNameArrayRelease"), - .JSValueMakeFromJSONString = (JSValueMakeFromJSONStringFuncType)dlsym(libraryHandle, "JSValueMakeFromJSONString"), - .JSObjectCallAsFunction = (JSObjectCallAsFunctionFuncType)dlsym(libraryHandle, "JSObjectCallAsFunction"), - .JSValueMakeNull = (JSValueRefWithJSContextRefFuncType)dlsym(libraryHandle, "JSValueMakeNull"), - .JSValueCreateJSONString = (JSValueCreateJSONStringFuncType)dlsym(libraryHandle, "JSValueCreateJSONString"), - .JSValueIsUndefined = (JSValueIsUndefinedFuncType)dlsym(libraryHandle, "JSValueIsUndefined"), - .JSValueIsNull = (JSValueIsNullFuncType)dlsym(libraryHandle, "JSValueIsNull"), - .JSValueToObject = (JSValueToObjectFuncType)dlsym(libraryHandle, "JSValueToObject"), - .JSEvaluateScript = (JSEvaluateScriptFuncType)dlsym(libraryHandle, "JSEvaluateScript"), - .JSEvaluateBytecodeBundle = (JSEvaluateBytecodeBundleFuncType)dlsym(libraryHandle, "JSEvaluateBytecodeBundle"), - .configureJSCForIOS = (voidWithNoParamsFuncType)dlsym(libraryHandle, "configureJSCForIOS"), - .JSSamplingProfilerEnabled = (JSSamplingProfilerEnabledFuncType)dlsym(libraryHandle, "JSSamplingProfilerEnabled"), - .JSPokeSamplingProfiler = (JSValueRefWithJSContextRefFuncType)dlsym(libraryHandle, "JSPokeSamplingProfiler"), - .JSStartSamplingProfilingOnMainJSCThread = (JSStartSamplingProfilingOnMainJSCThreadFuncType)dlsym(libraryHandle, "JSStartSamplingProfilingOnMainJSCThread"), - .JSBytecodeFileFormatVersion = *(const int32_t *)dlsym(libraryHandle, "JSBytecodeFileFormatVersion"), - .JSContext = (__bridge Class)dlsym(libraryHandle, "OBJC_CLASS_$_JSContext"), - .JSValue = (__bridge Class)dlsym(libraryHandle, "OBJC_CLASS_$_JSValue"), - }; - - return wrapper; -} - -RCTJSCWrapper *RCTJSCWrapperCreate(BOOL useCustomJSC) -{ - return useCustomJSC - ? RCTSetUpCustomLibraryPointers() - : RCTSetUpSystemLibraryPointers(); -} - -void RCTJSCWrapperRelease(RCTJSCWrapper *wrapper) -{ - delete wrapper; -} diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 12e0d0210..f33e25be0 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -99,7 +99,6 @@ 2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; }; 2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; }; 2D3B5EAC1D9B08EF00451313 /* RCTJSCExecutor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */; }; - 2D3B5EAD1D9B08F200451313 /* RCTJSCWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */; }; 2D3B5EAE1D9B08F800451313 /* RCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */; }; 2D3B5EAF1D9B08FB00451313 /* RCTAccessibilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */; }; 2D3B5EB01D9B08FE00451313 /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; }; @@ -163,6 +162,7 @@ 352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */; }; 369123E11DDC75850095B341 /* JSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* JSCSamplingProfiler.m */; }; 391E86A41C623EC800009732 /* RCTTouchEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 391E86A21C623EC800009732 /* RCTTouchEvent.m */; }; + 3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; }; 3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */; }; 3D1FA07C1DE4F2EA00E03CC6 /* RCTNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07A1DE4F2EA00E03CC6 /* RCTNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D1FA07D1DE4F2EA00E03CC6 /* RCTNetworkTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D1FA07B1DE4F2EA00E03CC6 /* RCTNetworkTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -194,6 +194,27 @@ 3D3C085F1DE33E6100C268FA /* CSSNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 1321C8CE1D3EB50800D58318 /* CSSNodeList.c */; }; 3D3C08891DE342FB00C268FA /* libCSSLayout.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C059A1DE3340900C268FA /* libCSSLayout.a */; }; 3D3C088C1DE3430500C268FA /* libCSSLayout-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3C06751DE3340C00C268FA /* libCSSLayout-tvOS.a */; }; + 3D3CD8F81DE5FB2D00167DC4 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; }; + 3D3CD9061DE5FBD600167DC4 /* CSSLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = 133683441D37ACA10077D0C3 /* CSSLayout.c */; }; + 3D3CD9071DE5FBD600167DC4 /* CSSNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 1321C8CE1D3EB50800D58318 /* CSSNodeList.c */; }; + 3D3CD9131DE5FBD800167DC4 /* CSSLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = 133683441D37ACA10077D0C3 /* CSSLayout.c */; }; + 3D3CD9141DE5FBD800167DC4 /* CSSNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 1321C8CE1D3EB50800D58318 /* CSSNodeList.c */; }; + 3D3CD9201DE5FBEC00167DC4 /* CSSLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = 133683441D37ACA10077D0C3 /* CSSLayout.c */; }; + 3D3CD9211DE5FBEC00167DC4 /* CSSNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 1321C8CE1D3EB50800D58318 /* CSSNodeList.c */; }; + 3D3CD92D1DE5FBEE00167DC4 /* CSSLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = 133683441D37ACA10077D0C3 /* CSSLayout.c */; }; + 3D3CD92E1DE5FBEE00167DC4 /* CSSNodeList.c in Sources */ = {isa = PBXBuildFile; fileRef = 1321C8CE1D3EB50800D58318 /* CSSNodeList.c */; }; + 3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD93F1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD9401DE5FC1400167DC4 /* JSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */; }; + 3D3CD9421DE5FC5300167DC4 /* libjschelpers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */; }; + 3D3CD9431DE5FC6500167DC4 /* libcxxreact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact-tvOS.a */; }; + 3D3CD9441DE5FC6500167DC4 /* libjschelpers-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3CD9181DE5FBD800167DC4 /* libjschelpers-tvOS.a */; }; + 3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD9461DE5FC7100167DC4 /* JSBundleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; }; + 3D3CD9481DE5FC7800167DC4 /* oss-compat-util.h in Headers */ = {isa = PBXBuildFile; fileRef = AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */; }; 3D4545AC1DE32FB300C6C478 /* RCTAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D4545AD1DE32FB300C6C478 /* RCTBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D4545AE1DE32FB300C6C478 /* RCTBridge+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A43DB81C1F849600794BC8 /* RCTBridge+Private.h */; }; @@ -428,7 +449,10 @@ 3D5FA6881DE4B9B30058FD77 /* RCTJSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C199EC1CD2407900DAD810 /* RCTJSCWrapper.h */; }; 3D5FA6891DE4B9B30058FD77 /* RCTJSCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 85C199EC1CD2407900DAD810 /* RCTJSCWrapper.h */; }; 3D7749441DC1065C007EC8D8 /* RCTPlatform.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */; }; - 3DC724321D8BF99A00808C32 /* RCTJSCErrorHandling.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DC724311D8BF99A00808C32 /* RCTJSCErrorHandling.m */; }; + 3D7A27DF1DE32541002E3F95 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; }; + 3D7A27E01DE32559002E3F95 /* JSCWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */; }; + 3D7A27E21DE325B7002E3F95 /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27E11DE325B7002E3F95 /* RCTJSCErrorHandling.mm */; }; + 3D7A27E31DE325DA002E3F95 /* RCTJSCErrorHandling.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D7A27E11DE325B7002E3F95 /* RCTJSCErrorHandling.mm */; }; 3DDEC1521DDCE0CA0020BBDF /* JSCSamplingProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 369123E01DDC75850095B341 /* JSCSamplingProfiler.m */; }; 3EDCA8A51D3591E700450C31 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; }; 58114A161AAE854800E7D092 /* RCTPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A131AAE854800E7D092 /* RCTPicker.m */; }; @@ -447,7 +471,6 @@ 83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */; }; 83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */; }; 83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBACB1A6023D300E9B192 /* RCTConvert.m */; }; - 85C199EE1CD2407900DAD810 /* RCTJSCWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */; }; AC70D2E91DE489E4002E6351 /* RCTJavaScriptLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */; }; AC70D2ED1DE48A22002E6351 /* JSBundleType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */; }; B233E6EA1D2D845D00BC68BA /* RCTI18nManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */; }; @@ -456,20 +479,55 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 3D14D9F11DE48E1600386448 /* PBXContainerItemProxy */ = { + 3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; proxyType = 1; remoteGlobalIDString = 3D3C059B1DE3340C00C268FA; remoteInfo = "CSSLayout-tvOS"; }; - 3D14D9F31DE48E1F00386448 /* PBXContainerItemProxy */ = { + 3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D3CD9261DE5FBEE00167DC4; + remoteInfo = "cxxreact-tvOS"; + }; + 3D0574581DE5FF9600184BB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D3CD90C1DE5FBD800167DC4; + remoteInfo = "jschelpers-tvOS"; + }; + 3D3CD9491DE5FCE700167DC4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; proxyType = 1; remoteGlobalIDString = 3D3C04B91DE3340900C268FA; remoteInfo = CSSLayout; }; + 3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D3CD9191DE5FBEC00167DC4; + remoteInfo = cxxreact; + }; + 3D3CD94D1DE5FCE700167DC4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D3CD8FF1DE5FBD600167DC4; + remoteInfo = jschelpers; + }; + 3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3D3CD8FF1DE5FBD600167DC4; + remoteInfo = jschelpers; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -649,12 +707,20 @@ 3D37B5811D522B190042D5B5 /* RCTFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTFont.mm; sourceTree = ""; }; 3D3C059A1DE3340900C268FA /* libCSSLayout.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCSSLayout.a; sourceTree = BUILT_PRODUCTS_DIR; }; 3D3C06751DE3340C00C268FA /* libCSSLayout-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCSSLayout-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBundleType.h; sourceTree = ""; }; + 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjschelpers.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3CD9181DE5FBD800167DC4 /* libjschelpers-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libjschelpers-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 3D3CD9321DE5FBEE00167DC4 /* libcxxreact-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcxxreact-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3D7749421DC1065C007EC8D8 /* RCTPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPlatform.h; sourceTree = ""; }; 3D7749431DC1065C007EC8D8 /* RCTPlatform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPlatform.m; sourceTree = ""; }; + 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCore.h; sourceTree = ""; }; + 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCWrapper.cpp; sourceTree = ""; }; + 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCWrapper.h; sourceTree = ""; }; + 3D7A27E11DE325B7002E3F95 /* RCTJSCErrorHandling.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCErrorHandling.mm; sourceTree = ""; }; 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketProxy.h; sourceTree = ""; }; 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketProxyDelegate.h; sourceTree = ""; }; 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCErrorHandling.h; sourceTree = ""; }; - 3DC724311D8BF99A00808C32 /* RCTJSCErrorHandling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCErrorHandling.m; sourceTree = ""; }; 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorCustomizer.h; sourceTree = ""; }; 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorInfo.h; sourceTree = ""; }; 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTErrorInfo.m; sourceTree = ""; }; @@ -697,11 +763,9 @@ 83CBBACB1A6023D300E9B192 /* RCTConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert.m; sourceTree = ""; }; 83F15A171B7CC46900F10295 /* UIView+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Private.h"; sourceTree = ""; }; 85C199EC1CD2407900DAD810 /* RCTJSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCWrapper.h; sourceTree = ""; }; - 85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = RCTJSCWrapper.mm; sourceTree = ""; }; AC70D2E81DE489E4002E6351 /* RCTJavaScriptLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJavaScriptLoader.mm; sourceTree = ""; }; - AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSBundleType.cpp; path = cxxreact/JSBundleType.cpp; sourceTree = ""; }; - AC70D2EC1DE48A22002E6351 /* JSBundleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSBundleType.h; path = cxxreact/JSBundleType.h; sourceTree = ""; }; - AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "oss-compat-util.h"; path = "cxxreact/oss-compat-util.h"; sourceTree = ""; }; + AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBundleType.cpp; sourceTree = ""; }; + AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "oss-compat-util.h"; sourceTree = ""; }; ACDD3FDA1BC7430D00E7DE33 /* RCTBorderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBorderStyle.h; sourceTree = ""; }; B233E6E81D2D843200BC68BA /* RCTI18nManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTI18nManager.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTI18nManager.m; sourceTree = ""; }; @@ -717,6 +781,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3D3CD9411DE5FC5300167DC4 /* libcxxreact.a in Frameworks */, + 3D3CD9421DE5FC5300167DC4 /* libjschelpers.a in Frameworks */, 3D3C08891DE342FB00C268FA /* libCSSLayout.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -725,6 +791,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3D3CD9431DE5FC6500167DC4 /* libcxxreact-tvOS.a in Frameworks */, + 3D3CD9441DE5FC6500167DC4 /* libjschelpers-tvOS.a in Frameworks */, 3D3C088C1DE3430500C268FA /* libCSSLayout-tvOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -750,11 +818,9 @@ isa = PBXGroup; children = ( 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */, - 3DC724311D8BF99A00808C32 /* RCTJSCErrorHandling.m */, + 3D7A27E11DE325B7002E3F95 /* RCTJSCErrorHandling.mm */, 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */, 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.mm */, - 85C199EC1CD2407900DAD810 /* RCTJSCWrapper.h */, - 85C199ED1CD2407900DAD810 /* RCTJSCWrapper.mm */, ); path = Executors; sourceTree = ""; @@ -764,8 +830,6 @@ children = ( 369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */, 369123E01DDC75850095B341 /* JSCSamplingProfiler.m */, - 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */, - 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */, E9B20B791B500126007A2DA7 /* RCTAccessibilityManager.h */, E9B20B7A1B500126007A2DA7 /* RCTAccessibilityManager.m */, 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, @@ -780,20 +844,22 @@ 13A0C2861B74F71200B29F6F /* RCTDevLoadingView.m */, 13A0C2871B74F71200B29F6F /* RCTDevMenu.h */, 13A0C2881B74F71200B29F6F /* RCTDevMenu.m */, + 13D9FEE91CDCCECF00158BD7 /* RCTEventEmitter.h */, + 13D9FEEA1CDCCECF00158BD7 /* RCTEventEmitter.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */, + B233E6E81D2D843200BC68BA /* RCTI18nManager.h */, + B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */, + 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */, + 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */, + 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */, + 13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */, 13F17A831B8493E5007D4C75 /* RCTRedBox.h */, 13F17A841B8493E5007D4C75 /* RCTRedBox.m */, 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */, 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */, 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */, 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */, - 352DCFEE1D19F4C20056D623 /* RCTI18nUtil.h */, - 352DCFEF1D19F4C20056D623 /* RCTI18nUtil.m */, - B233E6E91D2D845D00BC68BA /* RCTI18nManager.m */, - B233E6E81D2D843200BC68BA /* RCTI18nManager.h */, - 13D9FEEC1CDCD93000158BD7 /* RCTKeyboardObserver.h */, - 13D9FEED1CDCD93000158BD7 /* RCTKeyboardObserver.m */, 13B07FED1A69327A00A75B9A /* RCTTiming.h */, 13B07FEE1A69327A00A75B9A /* RCTTiming.m */, 13E067481A70F434002CDEE1 /* RCTUIManager.h */, @@ -911,12 +977,12 @@ 1450FF7F1BCFF28A00208362 /* Profiler */ = { isa = PBXGroup; children = ( + 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */, + 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */, 14A43DF11C20B1C900794BC8 /* RCTJSCProfiler.h */, 14A43DF21C20B1C900794BC8 /* RCTJSCProfiler.m */, 14BF71811C04795500C97D0C /* RCTMacros.h */, 14F7A0EB1BDA3B3C003C6C10 /* RCTPerfMonitor.m */, - 14F7A0EE1BDA714B003C6C10 /* RCTFPSGraph.h */, - 14F7A0EF1BDA714B003C6C10 /* RCTFPSGraph.m */, 1450FF801BCFF28A00208362 /* RCTProfile.h */, 1450FF811BCFF28A00208362 /* RCTProfile.m */, 1450FF821BCFF28A00208362 /* RCTProfileTrampoline-arm.S */, @@ -932,6 +998,7 @@ children = ( 133683431D37ACA10077D0C3 /* CSSLayout */, AC70D2EA1DE489FC002E6351 /* cxxreact */, + 3D4A621D1DDD3985001F41B4 /* jschelpers */, ); name = ReactCommon; path = ../ReactCommon; @@ -984,6 +1051,16 @@ name = PushNotificationIOS; sourceTree = ""; }; + 3D4A621D1DDD3985001F41B4 /* jschelpers */ = { + isa = PBXGroup; + children = ( + 3D7A27DC1DE32541002E3F95 /* JavaScriptCore.h */, + 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */, + 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */, + ); + path = jschelpers; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -1003,6 +1080,10 @@ 2D2A28131D9B038B00D4039D /* libReact-tvOS.a */, 3D3C059A1DE3340900C268FA /* libCSSLayout.a */, 3D3C06751DE3340C00C268FA /* libCSSLayout-tvOS.a */, + 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */, + 3D3CD9181DE5FBD800167DC4 /* libjschelpers-tvOS.a */, + 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */, + 3D3CD9321DE5FBEE00167DC4 /* libcxxreact-tvOS.a */, ); name = Products; sourceTree = ""; @@ -1093,11 +1174,11 @@ AC70D2EA1DE489FC002E6351 /* cxxreact */ = { isa = PBXGroup; children = ( + 3D3CD8F51DE5FB2300167DC4 /* JSBundleType.h */, AC70D2EB1DE48A22002E6351 /* JSBundleType.cpp */, - AC70D2EC1DE48A22002E6351 /* JSBundleType.h */, AC70D2EE1DE48AC5002E6351 /* oss-compat-util.h */, ); - name = cxxreact; + path = cxxreact; sourceTree = ""; }; /* End PBXGroup section */ @@ -1125,6 +1206,42 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3D3CD9001DE5FBD600167DC4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD93D1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */, + 3D3CD93E1DE5FC1400167DC4 /* JSCWrapper.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD90D1DE5FBD800167DC4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD93F1DE5FC1400167DC4 /* JavaScriptCore.h in Headers */, + 3D3CD9401DE5FC1400167DC4 /* JSCWrapper.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD91A1DE5FBEC00167DC4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD9471DE5FC7800167DC4 /* oss-compat-util.h in Headers */, + 3D3CD9451DE5FC7100167DC4 /* JSBundleType.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD9271DE5FBEE00167DC4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD9481DE5FC7800167DC4 /* oss-compat-util.h in Headers */, + 3D3CD9461DE5FC7100167DC4 /* JSBundleType.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 3D4545AB1DE32F8E00C6C478 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1403,7 +1520,9 @@ buildRules = ( ); dependencies = ( - 3D14D9F21DE48E1600386448 /* PBXTargetDependency */, + 3D0574551DE5FF9600184BB4 /* PBXTargetDependency */, + 3D0574571DE5FF9600184BB4 /* PBXTargetDependency */, + 3D0574591DE5FF9600184BB4 /* PBXTargetDependency */, ); name = "React-tvOS"; productName = "React-tvOS"; @@ -1442,6 +1561,71 @@ productReference = 3D3C06751DE3340C00C268FA /* libCSSLayout-tvOS.a */; productType = "com.apple.product-type.library.static"; }; + 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget "jschelpers" */; + buildPhases = ( + 3D3CD9001DE5FBD600167DC4 /* Headers */, + 3D3CD9051DE5FBD600167DC4 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = jschelpers; + productName = React; + productReference = 3D3CD90B1DE5FBD600167DC4 /* libjschelpers.a */; + productType = "com.apple.product-type.library.static"; + }; + 3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget "jschelpers-tvOS" */; + buildPhases = ( + 3D3CD90D1DE5FBD800167DC4 /* Headers */, + 3D3CD9121DE5FBD800167DC4 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "jschelpers-tvOS"; + productName = "React-tvOS"; + productReference = 3D3CD9181DE5FBD800167DC4 /* libjschelpers-tvOS.a */; + productType = "com.apple.product-type.library.static"; + }; + 3D3CD9191DE5FBEC00167DC4 /* cxxreact */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget "cxxreact" */; + buildPhases = ( + 3D3CD91A1DE5FBEC00167DC4 /* Headers */, + 3D3CD91F1DE5FBEC00167DC4 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + 3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */, + ); + name = cxxreact; + productName = React; + productReference = 3D3CD9251DE5FBEC00167DC4 /* libcxxreact.a */; + productType = "com.apple.product-type.library.static"; + }; + 3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget "cxxreact-tvOS" */; + buildPhases = ( + 3D3CD9271DE5FBEE00167DC4 /* Headers */, + 3D3CD92C1DE5FBEE00167DC4 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "cxxreact-tvOS"; + productName = "React-tvOS"; + productReference = 3D3CD9321DE5FBEE00167DC4 /* libcxxreact-tvOS.a */; + productType = "com.apple.product-type.library.static"; + }; 83CBBA2D1A601D0E00E9B192 /* React */ = { isa = PBXNativeTarget; buildConfigurationList = 83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget "React" */; @@ -1455,7 +1639,9 @@ buildRules = ( ); dependencies = ( - 3D14D9F41DE48E1F00386448 /* PBXTargetDependency */, + 3D3CD94A1DE5FCE700167DC4 /* PBXTargetDependency */, + 3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */, + 3D3CD94E1DE5FCE700167DC4 /* PBXTargetDependency */, ); name = React; productName = React; @@ -1497,6 +1683,10 @@ 2D2A28121D9B038B00D4039D /* React-tvOS */, 3D3C04B91DE3340900C268FA /* CSSLayout */, 3D3C059B1DE3340C00C268FA /* CSSLayout-tvOS */, + 3D3CD9191DE5FBEC00167DC4 /* cxxreact */, + 3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */, + 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */, + 3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */, ); }; /* End PBXProject section */ @@ -1589,7 +1779,6 @@ 2D3B5EF11D9B09E700451313 /* UIView+React.m in Sources */, 2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */, 2D3B5EE01D9B09AD00451313 /* RCTRootShadowView.m in Sources */, - 2D3B5EAD1D9B08F200451313 /* RCTJSCWrapper.mm in Sources */, 2D3B5EBA1D9B092100451313 /* RCTI18nUtil.m in Sources */, 2D3B5EB41D9B090A00451313 /* RCTDevLoadingView.m in Sources */, 2D3B5EED1D9B09D700451313 /* RCTTabBarManager.m in Sources */, @@ -1602,6 +1791,7 @@ 2D3B5EEB1D9B09D000451313 /* RCTTabBarItem.m in Sources */, 2D3B5E961D9B088500451313 /* RCTBatchedBridge.m in Sources */, 2D3B5ED41D9B097D00451313 /* RCTModalHostView.m in Sources */, + 3D7A27E01DE32559002E3F95 /* JSCWrapper.cpp in Sources */, 2D3B5E9F1D9B08AF00451313 /* RCTKeyCommands.m in Sources */, 2D3B5EA51D9B08C700451313 /* RCTRootView.m in Sources */, 2D3B5EAC1D9B08EF00451313 /* RCTJSCExecutor.mm in Sources */, @@ -1612,15 +1802,18 @@ 2D3B5ECC1D9B096500451313 /* RCTConvert+MapKit.m in Sources */, 2D3B5E981D9B089500451313 /* RCTConvert.m in Sources */, 2D3B5EA71D9B08CE00451313 /* RCTTouchHandler.m in Sources */, + 3D05745A1DE5FFF500184BB4 /* RCTJavaScriptLoader.mm in Sources */, 2D3B5EA41D9B08C200451313 /* RCTPerformanceLogger.m in Sources */, 2D3B5E9E1D9B08AD00451313 /* RCTJSStackFrame.m in Sources */, 2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */, 2D3B5EB81D9B091B00451313 /* RCTSourceCode.m in Sources */, 2D3B5EB51D9B091100451313 /* RCTDevMenu.m in Sources */, 2D3B5EBD1D9B092A00451313 /* RCTTiming.m in Sources */, + 3D3CD8F81DE5FB2D00167DC4 /* JSBundleType.cpp in Sources */, 2D3B5EA81D9B08D300451313 /* RCTUtils.m in Sources */, 2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */, 2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */, + 3D7A27E31DE325DA002E3F95 /* RCTJSCErrorHandling.mm in Sources */, 2D3B5ED01D9B097200451313 /* RCTMap.m in Sources */, 2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */, 2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */, @@ -1667,6 +1860,42 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3D3CD9051DE5FBD600167DC4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD9061DE5FBD600167DC4 /* CSSLayout.c in Sources */, + 3D3CD9071DE5FBD600167DC4 /* CSSNodeList.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD9121DE5FBD800167DC4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD9131DE5FBD800167DC4 /* CSSLayout.c in Sources */, + 3D3CD9141DE5FBD800167DC4 /* CSSNodeList.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD91F1DE5FBEC00167DC4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD9201DE5FBEC00167DC4 /* CSSLayout.c in Sources */, + 3D3CD9211DE5FBEC00167DC4 /* CSSNodeList.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3D3CD92C1DE5FBEE00167DC4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D3CD92D1DE5FBEE00167DC4 /* CSSLayout.c in Sources */, + 3D3CD92E1DE5FBEE00167DC4 /* CSSNodeList.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 83CBBA2A1A601D0E00E9B192 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1698,6 +1927,7 @@ 14F7A0F01BDA714B003C6C10 /* RCTFPSGraph.m in Sources */, 14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */, 3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */, + 3D7A27DF1DE32541002E3F95 /* JSCWrapper.cpp in Sources */, 14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */, 13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */, 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */, @@ -1716,6 +1946,7 @@ 13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */, 13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */, E9B20B7B1B500126007A2DA7 /* RCTAccessibilityManager.m in Sources */, + 3D7A27E21DE325B7002E3F95 /* RCTJSCErrorHandling.mm in Sources */, 13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */, 13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */, 1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */, @@ -1724,7 +1955,6 @@ 13E067591A70F44B002CDEE1 /* UIView+React.m in Sources */, 14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */, 13D033631C1837FE0021DC29 /* RCTClipboard.m in Sources */, - 85C199EE1CD2407900DAD810 /* RCTJSCWrapper.mm in Sources */, 14C2CA741B3AC64300E6CBB2 /* RCTModuleData.mm in Sources */, 142014191B32094000CC17BA /* RCTPerformanceLogger.m in Sources */, 83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */, @@ -1759,7 +1989,6 @@ B95154321D1B34B200FE7B80 /* RCTActivityIndicatorView.m in Sources */, 13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */, 137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */, - 3DC724321D8BF99A00808C32 /* RCTJSCErrorHandling.m in Sources */, 13F17A851B8493E5007D4C75 /* RCTRedBox.m in Sources */, 83392EB31B6634E10013B15F /* RCTModalHostViewController.m in Sources */, 14435CE51AAC4AE100FC20F4 /* RCTMap.m in Sources */, @@ -1777,15 +2006,40 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 3D14D9F21DE48E1600386448 /* PBXTargetDependency */ = { + 3D0574551DE5FF9600184BB4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 3D3C059B1DE3340C00C268FA /* CSSLayout-tvOS */; - targetProxy = 3D14D9F11DE48E1600386448 /* PBXContainerItemProxy */; + targetProxy = 3D0574541DE5FF9600184BB4 /* PBXContainerItemProxy */; }; - 3D14D9F41DE48E1F00386448 /* PBXTargetDependency */ = { + 3D0574571DE5FF9600184BB4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D3CD9261DE5FBEE00167DC4 /* cxxreact-tvOS */; + targetProxy = 3D0574561DE5FF9600184BB4 /* PBXContainerItemProxy */; + }; + 3D0574591DE5FF9600184BB4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D3CD90C1DE5FBD800167DC4 /* jschelpers-tvOS */; + targetProxy = 3D0574581DE5FF9600184BB4 /* PBXContainerItemProxy */; + }; + 3D3CD94A1DE5FCE700167DC4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 3D3C04B91DE3340900C268FA /* CSSLayout */; - targetProxy = 3D14D9F31DE48E1F00386448 /* PBXContainerItemProxy */; + targetProxy = 3D3CD9491DE5FCE700167DC4 /* PBXContainerItemProxy */; + }; + 3D3CD94C1DE5FCE700167DC4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D3CD9191DE5FBEC00167DC4 /* cxxreact */; + targetProxy = 3D3CD94B1DE5FCE700167DC4 /* PBXContainerItemProxy */; + }; + 3D3CD94E1DE5FCE700167DC4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */; + targetProxy = 3D3CD94D1DE5FCE700167DC4 /* PBXContainerItemProxy */; + }; + 3D3CD9501DE5FDB900167DC4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3D3CD8FF1DE5FBD600167DC4 /* jschelpers */; + targetProxy = 3D3CD94F1DE5FDB900167DC4 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -1908,6 +2162,154 @@ }; name = Release; }; + 3D3CD9091DE5FBD600167DC4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_STATIC_ANALYZER_MODE = deep; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers; + RUN_CLANG_STATIC_ANALYZER = YES; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 3D3CD90A1DE5FBD600167DC4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_STATIC_ANALYZER_MODE = deep; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers; + RUN_CLANG_STATIC_ANALYZER = NO; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 3D3CD9161DE5FBD800167DC4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.2; + }; + name = Debug; + }; + 3D3CD9171DE5FBD800167DC4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/jschelpers; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.2; + }; + name = Release; + }; + 3D3CD9231DE5FBEC00167DC4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_STATIC_ANALYZER_MODE = deep; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact; + RUN_CLANG_STATIC_ANALYZER = YES; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 3D3CD9241DE5FBEC00167DC4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_STATIC_ANALYZER_MODE = deep; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact; + RUN_CLANG_STATIC_ANALYZER = NO; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 3D3CD9301DE5FBEE00167DC4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.2; + }; + name = Debug; + }; + 3D3CD9311DE5FBEE00167DC4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/cxxreact; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TVOS_DEPLOYMENT_TARGET = 9.2; + }; + name = Release; + }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2066,6 +2468,42 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 3D3CD9081DE5FBD600167DC4 /* Build configuration list for PBXNativeTarget "jschelpers" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3CD9091DE5FBD600167DC4 /* Debug */, + 3D3CD90A1DE5FBD600167DC4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D3CD9151DE5FBD800167DC4 /* Build configuration list for PBXNativeTarget "jschelpers-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3CD9161DE5FBD800167DC4 /* Debug */, + 3D3CD9171DE5FBD800167DC4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D3CD9221DE5FBEC00167DC4 /* Build configuration list for PBXNativeTarget "cxxreact" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3CD9231DE5FBEC00167DC4 /* Debug */, + 3D3CD9241DE5FBEC00167DC4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3D3CD92F1DE5FBEE00167DC4 /* Build configuration list for PBXNativeTarget "cxxreact-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3D3CD9301DE5FBEE00167DC4 /* Debug */, + 3D3CD9311DE5FBEE00167DC4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "React" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ReactCommon/cxxreact/JSCNativeModules.cpp b/ReactCommon/cxxreact/JSCNativeModules.cpp index d0937f460..decf86dde 100644 --- a/ReactCommon/cxxreact/JSCNativeModules.cpp +++ b/ReactCommon/cxxreact/JSCNativeModules.cpp @@ -2,8 +2,7 @@ #include "JSCNativeModules.h" -#include - +#include #include namespace facebook { diff --git a/ReactCommon/jschelpers/JSCWrapper.cpp b/ReactCommon/jschelpers/JSCWrapper.cpp index 5c177610a..d03543761 100644 --- a/ReactCommon/jschelpers/JSCWrapper.cpp +++ b/ReactCommon/jschelpers/JSCWrapper.cpp @@ -12,7 +12,15 @@ #if defined(__APPLE__) #include + +// TODO: use glog in OSS too +#if __has_include() +#define USE_GLOG 1 #include +#else +#define USE_GLOG 0 +#endif + #include // Crash the app (with a descriptive stack trace) if a function that is not supported by @@ -34,6 +42,8 @@ bool JSSamplingProfilerEnabled() { return false; } +const int32_t JSNoBytecodeFileFormatVersion = -1; + namespace facebook { namespace react { @@ -42,12 +52,16 @@ static const JSCWrapper* s_customWrapper = nullptr; static JSCWrapper s_systemWrapper = {}; const JSCWrapper* customJSCWrapper() { + #if USE_GLOG CHECK(s_customWrapper != nullptr) << "Accessing custom JSC wrapper before it's set"; + #endif return s_customWrapper; } void setCustomJSCWrapper(const JSCWrapper* wrapper) { + #if USE_GLOG CHECK(s_customWrapper == nullptr) << "Can't set custom JSC wrapper multiple times"; + #endif s_customWrapper = wrapper; } @@ -135,7 +149,7 @@ const JSCWrapper* systemJSCWrapper() { .JSContext = objc_getClass("JSContext"), .JSValue = objc_getClass("JSValue"), - .JSBytecodeFileFormatVersion = -1, + .JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion, }; }); return &s_systemWrapper; diff --git a/ReactCommon/jschelpers/JSCWrapper.h b/ReactCommon/jschelpers/JSCWrapper.h index f3b635dcb..13fb05d29 100644 --- a/ReactCommon/jschelpers/JSCWrapper.h +++ b/ReactCommon/jschelpers/JSCWrapper.h @@ -27,6 +27,13 @@ extern bool JSSamplingProfilerEnabled(); extern void JSStartSamplingProfilingOnMainJSCThread(JSGlobalContextRef); extern JSValueRef JSPokeSamplingProfiler(JSContextRef); +/** + * JSNoBytecodeFileFormatVersion + * + * Version number indicating that bytecode is not supported by this runtime. + */ +extern const int32_t JSNoBytecodeFileFormatVersion; + namespace facebook { namespace react {