Skip to content

Commit

Permalink
Implement RCTJSCWrapper
Browse files Browse the repository at this point in the history
Reviewed By: tadeuzagallo

Differential Revision: D3258713

fbshipit-source-id: 418eb9d350bf3541c976b631bd9799a1c578f5e5
  • Loading branch information
alexeylang authored and Facebook Github Bot 8 committed May 31, 2016
1 parent 0f57702 commit abe0b34
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 77 deletions.
2 changes: 2 additions & 0 deletions React/Base/RCTPerformanceLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ typedef NS_ENUM(NSUInteger, RCTPLTag) {
RCTPLNativeModulePrepareConfig,
RCTPLNativeModuleInjectConfig,
RCTPLNativeModuleMainThreadUsesCount,
RCTPLJSCWrapperOpenLibrary,
RCTPLJSCWrapperLoadFunctions,
RCTPLJSCExecutorSetup,
RCTPLBridgeStartup,
RCTPLTTI,
Expand Down
2 changes: 2 additions & 0 deletions React/Base/RCTPerformanceLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ void RCTPerformanceLoggerAppendEnd(RCTPLTag tag)
@"NativeModulePrepareConfig",
@"NativeModuleInjectConfig",
@"NativeModuleMainThreadUsesCount",
@"JSCWrapperOpenLibrary",
@"JSCWrapperLoadFunctions",
@"JSCExecutorSetup",
@"BridgeStartup",
@"RootViewTTI",
Expand Down
26 changes: 20 additions & 6 deletions React/Executors/RCTJSCExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,31 @@ RCT_EXTERN NSString *const RCTJSCThreadName;
*/
RCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification;

/**
* Uses a JavaScriptCore context as the execution engine.
*/
@interface RCTJSCExecutor : NSObject <RCTJavaScriptExecutor>

/**
* Sets a type of JSC library (system or custom) that's used
* to initialize RCTJSCWrapper.
* @default is NO.
*/
+ (void)setUseCustomJSCLibrary:(BOOL)useCustomLibrary;

/**
* Gets a type of JSC library (system or custom) that's used
* to initialize RCTJSCWrapper.
* @default is NO.
*/
+ (BOOL)useCustomJSCLibrary;

/**
* Create a NSError from a JSError object.
*
* If available, the error's userInfo property will contain the JS stacktrace under
* the RCTJSStackTraceKey key.
*/
RCT_EXTERN NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError);

/**
* Uses a JavaScriptCore context as the execution engine.
*/
@interface RCTJSCExecutor : NSObject <RCTJavaScriptExecutor>
- (NSError *)convertJSErrorToNSError:(JSValueRef)jsError context:(JSContextRef)context;

@end
Loading

0 comments on commit abe0b34

Please sign in to comment.