| 5911 | } |
| 5912 | |
| 5913 | function inspectHooks(fiber: Fiber): HooksTree { |
| 5914 | const originalConsoleMethods: {[string]: $FlowFixMe} = {}; |
| 5915 | |
| 5916 | // Temporarily disable all console logging before re-running the hook. |
| 5917 | for (const method in console) { |
| 5918 | try { |
| 5919 | // $FlowFixMe[invalid-computed-prop] |
| 5920 | originalConsoleMethods[method] = console[method]; |
| 5921 | // $FlowFixMe[prop-missing] |
| 5922 | console[method] = () => {}; |
| 5923 | } catch (error) {} |
| 5924 | } |
| 5925 | |
| 5926 | try { |
| 5927 | return inspectHooksOfFiber(fiber, getDispatcherRef(renderer)); |
| 5928 | } finally { |
| 5929 | // Restore original console functionality. |
| 5930 | for (const method in originalConsoleMethods) { |
| 5931 | try { |
| 5932 | // $FlowFixMe[prop-missing] |
| 5933 | console[method] = originalConsoleMethods[method]; |
| 5934 | } catch (error) {} |
| 5935 | } |
| 5936 | } |
| 5937 | } |
| 5938 | |
| 5939 | function getSuspendedByOfSuspenseNode( |
| 5940 | suspenseNode: SuspenseNode, |