mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[ReactNative] Remove RCT_IMPORT_METHOD macro and generate lookup table dynamically
Summary: @public This removes the last piece of data that was still stored on the DATA section, `RCT_IMPORT_METHOD`. JS calls now dynamically populate a lookup table simultaneously on JS and Native, instead of creating a mapping at load time. Test Plan: Everything still runs, tests are green.
This commit is contained in:
@@ -305,10 +305,12 @@ var MessageQueueMixin = {
|
||||
return guardReturn(this._callFunction, [moduleID, methodID, params], null, this);
|
||||
},
|
||||
|
||||
_callFunction: function(moduleID, methodID, params) {
|
||||
var moduleName = this._localModuleIDToModuleName[moduleID];
|
||||
_callFunction: function(moduleName, methodName, params) {
|
||||
if (isFinite(moduleName)) {
|
||||
moduleName = this._localModuleIDToModuleName[moduleName];
|
||||
methodName = this._localModuleNameToMethodIDToName[moduleName][methodName];
|
||||
}
|
||||
|
||||
var methodName = this._localModuleNameToMethodIDToName[moduleName][methodID];
|
||||
if (DEBUG_SPY_MODE) {
|
||||
console.log(
|
||||
'N->JS: ' + moduleName + '.' + methodName +
|
||||
|
||||
Reference in New Issue
Block a user