mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
94029eee54
Summary: Part of #24875, adds a spec for HeapCapture ## Changelog [General] [Added] - TM Spec for HeapCapture Pull Request resolved: https://github.com/facebook/react-native/pull/24899 Reviewed By: fkgozali Differential Revision: D15393464 Pulled By: RSNara fbshipit-source-id: d8778285753ce8dbc87204ecfbddfa7339acd264
32 lines
741 B
JavaScript
32 lines
741 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import NativeHeapCapture from './NativeHeapCapture';
|
|
|
|
const HeapCapture = {
|
|
captureHeap: function(path: string) {
|
|
let error = null;
|
|
try {
|
|
global.nativeCaptureHeap(path);
|
|
console.log('HeapCapture.captureHeap succeeded: ' + path);
|
|
} catch (e) {
|
|
console.log('HeapCapture.captureHeap error: ' + e.toString());
|
|
error = e.toString();
|
|
}
|
|
if (NativeHeapCapture) {
|
|
NativeHeapCapture.captureComplete(path, error);
|
|
}
|
|
},
|
|
};
|
|
|
|
module.exports = HeapCapture;
|