Skip to content

Commit

Permalink
remove jsErrorHandlingFunc from constructor of RCTHost
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

after D45720132, we don't need this!

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D45720130

fbshipit-source-id: dd3d8a5bd95faffefb94264d67dfb785dff50ade
  • Loading branch information
philIip authored and facebook-github-bot committed May 12, 2023
1 parent d1348f6 commit 2acd5c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ typedef std::shared_ptr<facebook::react::JSEngineInstance> (^RCTHostJSEngineProv
- (instancetype)initWithHostDelegate:(id<RCTHostDelegate>)hostDelegate
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
bindingsInstallFunc:(facebook::react::ReactInstance::BindingsInstallFunc)bindingsInstallFunc
jsErrorHandlingFunc:(facebook::react::JsErrorHandler::JsErrorHandlingFunc)jsErrorHandlingFunc
jsEngineProvider:(nullable RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER
FB_OBJC_DIRECT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ @implementation RCTHost {
NSURL *_bundleURL;
RCTBundleManager *_bundleManager;
facebook::react::ReactInstance::BindingsInstallFunc _bindingsInstallFunc;
JsErrorHandler::JsErrorHandlingFunc _jsErrorHandlingFunc;
RCTHostJSEngineProvider _jsEngineProvider;

// All the surfaces that need to be started after main bundle execution
Expand All @@ -59,7 +58,6 @@ + (void)initialize
- (instancetype)initWithHostDelegate:(id<RCTHostDelegate>)hostDelegate
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
bindingsInstallFunc:(facebook::react::ReactInstance::BindingsInstallFunc)bindingsInstallFunc
jsErrorHandlingFunc:(JsErrorHandler::JsErrorHandlingFunc)jsErrorHandlingFunc
jsEngineProvider:(nullable RCTHostJSEngineProvider)jsEngineProvider
{
if (self = [super init]) {
Expand All @@ -69,7 +67,6 @@ - (instancetype)initWithHostDelegate:(id<RCTHostDelegate>)hostDelegate
_bundleManager = [RCTBundleManager new];
_bindingsInstallFunc = bindingsInstallFunc;
_moduleRegistry = [RCTModuleRegistry new];
_jsErrorHandlingFunc = jsErrorHandlingFunc;
_jsEngineProvider = [jsEngineProvider copy];

__weak RCTHost *weakHost = self;
Expand Down Expand Up @@ -159,8 +156,7 @@ - (void)preload
turboModuleManagerDelegate:_turboModuleManagerDelegate
onInitialBundleLoad:_onInitialBundleLoad
bindingsInstallFunc:_bindingsInstallFunc
moduleRegistry:_moduleRegistry
jsErrorHandlingFunc:_jsErrorHandlingFunc];
moduleRegistry:_moduleRegistry];
}

- (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName
Expand Down Expand Up @@ -229,8 +225,7 @@ - (void)didReceiveReloadCommand
turboModuleManagerDelegate:_turboModuleManagerDelegate
onInitialBundleLoad:_onInitialBundleLoad
bindingsInstallFunc:_bindingsInstallFunc
moduleRegistry:_moduleRegistry
jsErrorHandlingFunc:_jsErrorHandlingFunc];
moduleRegistry:_moduleRegistry];
[[NSNotificationCenter defaultCenter]
postNotification:[NSNotification notificationWithName:RCTHostDidReloadNotification object:nil]];

Expand All @@ -256,7 +251,7 @@ - (void)instance:(RCTInstance *)instance didReceiveErrorMap:(facebook::react::Ma
NSString *message = [NSString stringWithCString:errorMap.getString(JSErrorHandlerKey::kErrorMessage).c_str()
encoding:[NSString defaultCStringEncoding]];
std::vector<facebook::react::MapBuffer> frames = errorMap.getMapBufferList(JSErrorHandlerKey::kAllStackFrames);
NSMutableArray *stack = [NSMutableArray new];
NSMutableArray<NSDictionary<NSString *, id> *> *stack = [NSMutableArray new];
for (facebook::react::MapBuffer const &mapBuffer : frames) {
NSDictionary *frame = @{
@"file" : [NSString stringWithCString:mapBuffer.getString(JSErrorHandlerKey::kFrameFileName).c_str()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ typedef void (^_Null_unspecified RCTInstanceInitialBundleLoadCompletionBlock)();
turboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
bindingsInstallFunc:(facebook::react::ReactInstance::BindingsInstallFunc)bindingsInstallFunc
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
jsErrorHandlingFunc:(facebook::react::JsErrorHandler::JsErrorHandlingFunc)jsErrorHandlingFunc
FB_OBJC_DIRECT;
moduleRegistry:(RCTModuleRegistry *)moduleRegistry FB_OBJC_DIRECT;

- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ @implementation RCTInstance {
RCTInstanceInitialBundleLoadCompletionBlock _onInitialBundleLoad;
ReactInstance::BindingsInstallFunc _bindingsInstallFunc;
RCTTurboModuleManager *_turboModuleManager;
JsErrorHandler::JsErrorHandlingFunc _jsErrorHandlingFunc;
std::mutex _invalidationMutex;
std::atomic<bool> _valid;
RCTJSThreadManager *_jsThreadManager;
Expand All @@ -91,7 +90,6 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad
bindingsInstallFunc:(ReactInstance::BindingsInstallFunc)bindingsInstallFunc
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
jsErrorHandlingFunc:(JsErrorHandler::JsErrorHandlingFunc)jsErrorHandlingFunc;
{
if (self = [super init]) {
_performanceLogger = [RCTPerformanceLogger new];
Expand All @@ -104,7 +102,6 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
_jsThreadManager = [RCTJSThreadManager new];
_onInitialBundleLoad = onInitialBundleLoad;
_bindingsInstallFunc = bindingsInstallFunc;
_jsErrorHandlingFunc = jsErrorHandlingFunc;
_bridgeModuleDecorator = [[RCTBridgeModuleDecorator alloc] initWithViewRegistry:[RCTViewRegistry new]
moduleRegistry:moduleRegistry
bundleManager:bundleManager
Expand Down

0 comments on commit 2acd5c0

Please sign in to comment.