TM Create: log error when method queue is nil

Summary:
When TurboModuleManager creates TurboModules, it creates and assigns a method queue to the module using ObjC's Associated Object API:

https://www.internalfb.com/code/fbsource/[c91dc16f4b63]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=636

Down the line, we retrieve this method queue, and use it to create a native CallInvoker:

https://www.internalfb.com/code/fbsource/[c91dc16f4b63abd05c7c9a038e88ca692a453c69]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=279-284

We should assert that this method queue isn't nil.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27956219

fbshipit-source-id: 2554cf2bffc732bb895e6dc082338a38b05f6580
This commit is contained in:
Ramanpreet Nara 2021-04-23 15:57:58 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 497eb578ab
Коммит da150343f7
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -277,6 +277,9 @@ static Class getFallbackClassFromName(const char *name)
Class moduleClass = [module class];
dispatch_queue_t methodQueue = (dispatch_queue_t)objc_getAssociatedObject(module, &kAssociatedMethodQueueKey);
if (methodQueue == nil) {
RCTLogError(@"TurboModule \"%@\" was not associated with a method queue.", moduleClass);
}
/**
* Step 2c: Create and native CallInvoker from the TurboModule's method queue.