diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index bcdc88829..372030698 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -40,6 +40,11 @@ function setUpProcess() { } } +function setUpProfile() { + const Systrace = require('Systrace'); + Systrace.setEnabled(global.__RCTProfileIsProfiling || false); +} + function setUpConsole() { // ExceptionsManager transitively requires Promise so we install it after const ExceptionsManager = require('ExceptionsManager'); @@ -229,6 +234,7 @@ function getPropertyDescriptor(object, name) { } setUpProcess(); +setUpProfile(); setUpConsole(); setUpTimers(); setUpAlert(); diff --git a/Libraries/Utilities/Systrace.js b/Libraries/Utilities/Systrace.js index 8dc207e1e..bdd2c5992 100644 --- a/Libraries/Utilities/Systrace.js +++ b/Libraries/Utilities/Systrace.js @@ -194,8 +194,6 @@ const Systrace = { }, }; -Systrace.setEnabled(global.__RCTProfileIsProfiling || false); - if (__DEV__) { // This is needed, because require callis in polyfills are not processed as // other files. Therefore, calls to `require('moduleId')` are not replaced