mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6991e28653
Summary: `NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec. NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review. Reviewed By: RSNara Differential Revision: D16812212 fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911
35 lines
844 B
Plaintext
35 lines
844 B
Plaintext
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @generated by an internal plugin build system
|
|
*/
|
|
|
|
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
|
|
|
|
// OSS-compatibility layer
|
|
|
|
#import "CoreModulesPlugins.h"
|
|
|
|
#import <string>
|
|
#import <unordered_map>
|
|
|
|
static std::unordered_map<std::string, Class (*)(void)> sCoreModuleClassMap = {
|
|
{"ExceptionsManager", RCTExceptionsManagerCls},
|
|
{"ImageLoader", RCTImageLoaderCls},
|
|
{"PlatformConstants", RCTPlatformCls},
|
|
};
|
|
|
|
Class RCTCoreModulesClassProvider(const char *name) {
|
|
auto p = sCoreModuleClassMap.find(name);
|
|
if (p != sCoreModuleClassMap.end()) {
|
|
auto classFunc = p->second;
|
|
return classFunc();
|
|
}
|
|
return nil;
|
|
}
|
|
|
|
#endif // RN_DISABLE_OSS_PLUGIN_HEADER
|