[react-native] Fix Chrome debugging

Summary:
Requiring ExceptionsManager in renderApplication (added in D2023119) led to a transitive require of ExecutionEnvironment, which has to run after InitializeJavaScriptAppEngine.

InitializeJavaScriptAppEngine is the right place for this sort of logic because we control the order that things are loaded, so move the console.error hook initialization there.

@public

Test Plan: Loaded shell app in simulator with Chrome debugging with no errors.
This commit is contained in:
Ben Alpert 2015-04-30 02:45:00 -07:00
parent 648cdfeb18
commit 261a0af9bb
2 changed files with 7 additions and 2 deletions

View File

@ -79,6 +79,12 @@ function setupRedBoxErrorHandler() {
ErrorUtils.setGlobalHandler(handleErrorWithRedBox);
}
function setupRedBoxConsoleErrorHandler() {
// ExceptionsManager transitively requires Promise so we install it after
var ExceptionsManager = require('ExceptionsManager');
ExceptionsManager.installConsoleErrorReporter();
}
/**
* Sets up a set of window environment wrappers that ensure that the
* BatchedBridge is flushed after each tick. In both the case of the
@ -139,4 +145,5 @@ setupTimers();
setupAlert();
setupPromise();
setupXHR();
setupRedBoxConsoleErrorHandler();
setupGeolocation();

View File

@ -11,8 +11,6 @@
*/
'use strict';
require('ExceptionsManager').installConsoleErrorReporter();
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');