mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-30 17:18:41 +08:00
[ReactNative] s/RK/RCT in OSS
This commit is contained in:
@@ -60,7 +60,7 @@ function setupDocumentShim() {
|
||||
var sourceMapPromise;
|
||||
|
||||
function handleErrorWithRedBox(e) {
|
||||
var RKExceptionsManager = require('NativeModules').RKExceptionsManager;
|
||||
var RCTExceptionsManager = require('NativeModules').RCTExceptionsManager;
|
||||
var errorToString = require('errorToString');
|
||||
var loadSourceMap = require('loadSourceMap');
|
||||
|
||||
@@ -72,13 +72,13 @@ function handleErrorWithRedBox(e) {
|
||||
'\n message: ' + e.message
|
||||
);
|
||||
|
||||
if (RKExceptionsManager) {
|
||||
RKExceptionsManager.reportUnhandledException(e.message, errorToString(e));
|
||||
if (RCTExceptionsManager) {
|
||||
RCTExceptionsManager.reportUnhandledException(e.message, errorToString(e));
|
||||
if (__DEV__) {
|
||||
(sourceMapPromise = sourceMapPromise || loadSourceMap())
|
||||
.then(map => {
|
||||
var prettyStack = errorToString(e, map);
|
||||
RKExceptionsManager.updateExceptionMessage(e.message, prettyStack);
|
||||
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack);
|
||||
})
|
||||
.then(null, error => {
|
||||
GLOBAL.console.error('#CLOWNTOWN (error while displaying error): ' + error.message);
|
||||
@@ -95,7 +95,7 @@ function setupRedBoxErrorHandler() {
|
||||
/**
|
||||
* Sets up a set of window environment wrappers that ensure that the
|
||||
* BatchedBridge is flushed after each tick. In both the case of the
|
||||
* `UIWebView` based `RKJavaScriptCaller` and `RKContextCaller`, we
|
||||
* `UIWebView` based `RCTJavaScriptCaller` and `RCTContextCaller`, we
|
||||
* implement our own custom timing bridge that should be immune to
|
||||
* unexplainably dropped timing signals.
|
||||
*/
|
||||
@@ -115,7 +115,7 @@ function setupTimers() {
|
||||
}
|
||||
|
||||
function setupAlert() {
|
||||
var RKAlertManager = require('RKAlertManager');
|
||||
var RCTAlertManager = require('RCTAlertManager');
|
||||
if (!GLOBAL.alert) {
|
||||
GLOBAL.alert = function(text) {
|
||||
var alertOpts = {
|
||||
@@ -123,7 +123,7 @@ function setupAlert() {
|
||||
message: '' + text,
|
||||
buttons: [{'cancel': 'Okay'}],
|
||||
};
|
||||
RKAlertManager.alertWithArgs(alertOpts, null);
|
||||
RCTAlertManager.alertWithArgs(alertOpts, null);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// Note that the module JSTimers is split into two in order to solve a cycle
|
||||
// in dependencies. NativeModules > BatchedBridge > MessageQueue > JSTimersExecution
|
||||
var RKTiming = require('NativeModules').RKTiming;
|
||||
var RCTTiming = require('NativeModules').RCTTiming;
|
||||
var JSTimersExecution = require('JSTimersExecution');
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ var JSTimers = {
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.setTimeout;
|
||||
RKTiming.createTimer(newID, duration, Date.now(), /** recurring */ false);
|
||||
RCTTiming.createTimer(newID, duration, Date.now(), /** recurring */ false);
|
||||
return newID;
|
||||
},
|
||||
|
||||
@@ -60,7 +60,7 @@ var JSTimers = {
|
||||
return func.apply(undefined, args);
|
||||
};
|
||||
JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.setInterval;
|
||||
RKTiming.createTimer(newID, duration, Date.now(), /** recurring */ true);
|
||||
RCTTiming.createTimer(newID, duration, Date.now(), /** recurring */ true);
|
||||
return newID;
|
||||
},
|
||||
|
||||
@@ -90,7 +90,7 @@ var JSTimers = {
|
||||
JSTimersExecution.timerIDs[freeIndex] = newID;
|
||||
JSTimersExecution.callbacks[freeIndex] = func;
|
||||
JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.requestAnimationFrame;
|
||||
RKTiming.createTimer(newID, 0, Date.now(), /** recurring */ false);
|
||||
RCTTiming.createTimer(newID, 0, Date.now(), /** recurring */ false);
|
||||
return newID;
|
||||
},
|
||||
|
||||
@@ -126,7 +126,7 @@ var JSTimers = {
|
||||
if (index !== -1) {
|
||||
JSTimersExecution._clearIndex(index);
|
||||
if (JSTimersExecution.types[index] !== JSTimersExecution.Type.setImmediate) {
|
||||
RKTiming.deleteTimer(timerID);
|
||||
RCTTiming.deleteTimer(timerID);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user