mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
f392ba6725
Summary: Now that [exact_empty_objects has been enabled](https://fb.workplace.com/groups/flowlang/posts/1092665251339137), we can codemod `{...null}` to `{}` - they are now equivalent. 1) Run my one-off jscodeshift codemod 2) `scripts/flow/tool update-suppressions .` (as some suppressions move around due to the change) drop-conflicts Reviewed By: bradzacher Differential Revision: D37834078 fbshipit-source-id: 6bf4913910e5597e5dd9d5161cd35deece6a7581
27 lines
638 B
JavaScript
27 lines
638 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
if (!global.performance) {
|
|
global.performance = ({}: {now?: () => number});
|
|
}
|
|
|
|
/**
|
|
* Returns a double, measured in milliseconds.
|
|
* https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
|
|
*/
|
|
if (typeof global.performance.now !== 'function') {
|
|
global.performance.now = function () {
|
|
const performanceNow = global.nativePerformanceNow || Date.now;
|
|
return performanceNow();
|
|
};
|
|
}
|