Invoking devMenu from RCTBridge in prod will crash

Summary: While we shouldn't invoke `bridge.devMenu` in production, doing it will result into a crash.

1. `devMenu` internally calls `RCTBridgeModuleNameForClass([RCTDevMenu class])`
2. `RCTBridgeModuleNameForClass()` calls `moduleName`
3. In the release code `RCTDevMenu` doesn't export the `moduleName` class method.
Closes https://github.com/facebook/react-native/pull/2910

Reviewed By: svcscm

Differential Revision: D2550797

Pulled By: tadeuzagallo

fb-gh-sync-id: 5dfbf905e5a02d9fd3b52f8b3d6eefc4e3ff30b2
This commit is contained in:
Patrik Tomas Chamelo 2015-10-16 12:12:44 -07:00 committed by facebook-github-bot-6
parent 256f69f4e6
commit 1511d8ca1d
1 changed files with 4 additions and 0 deletions

View File

@ -623,7 +623,11 @@ RCT_EXPORT_METHOD(reload)
- (RCTDevMenu *)devMenu
{
#if RCT_DEV
return self.modules[RCTBridgeModuleNameForClass([RCTDevMenu class])];
#else
return nil;
#endif
}
@end