Skip to content

Commit f4a9422

Browse files
hoxyqmeta-codesync[bot]
authored andcommitted
fix: add clearMarks and clearMeasures to performance global stub (#54214)
Summary: Pull Request resolved: #54214 # Changelog: [Internal] React started using `clearMeasures` in facebook/react#34803. It only does it if `performance.measure()` is defined. This should be enough for a feature check of User Timings API presence, but out stub doesn't follow the same spec. Adding `clearMarks()` and `clearMeasures()` stubs to the object. Reviewed By: rubennorte Differential Revision: D85082720 fbshipit-source-id: 3b117a6545e131cdbb2d5efb73d500a928469864
1 parent 4ddf2ce commit f4a9422

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/Libraries/Core/setUpPerformance.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if (NativePerformance) {
2020
// $FlowExpectedError[cannot-write]
2121
global.performance = {
2222
mark: () => {},
23+
clearMarks: () => {},
2324
measure: () => {},
25+
clearMeasures: () => {},
2426
now: () => {
2527
const performanceNow = global.nativePerformanceNow || Date.now;
2628
return performanceNow();

0 commit comments

Comments
 (0)