You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d50561
Browse filesBrowse the repository at this point in the historyBrowse files
Migrate begin/endEvent try/finally patterns to Systrace.trace (#56937)
Summary:
Pull Request resolved: #56937
Migrates existing `Systrace.beginEvent` / `Systrace.endEvent` (and bare `beginEvent`/`endEvent`) try/finally blocks to the new `Systrace.trace` helper, which keeps the same semantics but is more concise.
Other existing `beginEvent`/`endEvent` call sites are left untouched because they have `__DEV__` guards that do not wrap the entire body and would require additional restructuring.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D106073157
fbshipit-source-id: 3e8328b79ec7c03a6f17c130bfde4489eefdcc33
// TODO(T122225939): Remove after investigation: Why are we getting to this line in bridgeless mode?
425
-
constisBridgelessMode=
426
-
global.RN$Bridgeless===true ? 'true' : 'false';
427
-
invariant(
428
-
false,
429
-
`Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Bridgeless Mode: ${isBridgelessMode}. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}.
// TODO(T122225939): Remove after investigation: Why are we getting to this line in bridgeless mode?
421
+
constisBridgelessMode=
422
+
global.RN$Bridgeless===true ? 'true' : 'false';
423
+
invariant(
424
+
false,
425
+
`Failed to call into JavaScript module method ${module}.${method}(). Module has not been registered as callable. Bridgeless Mode: ${isBridgelessMode}. Registered callable JavaScript modules (n = ${n}): ${callableModuleNameList}.
430
426
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.`,
431
-
);
432
-
}
433
-
// $FlowFixMe[invalid-computed-prop]
434
-
if(!moduleMethods[method]){
435
-
invariant(
436
-
false,
437
-
`Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`,
438
-
);
439
-
}
440
-
moduleMethods[method].apply(moduleMethods,args);
441
-
}finally{
442
-
Systrace.endEvent();
443
-
}
427
+
);
428
+
}
429
+
// $FlowFixMe[invalid-computed-prop]
430
+
if(!moduleMethods[method]){
431
+
invariant(
432
+
false,
433
+
`Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined.`,
0 commit comments