( debugInfo: null | ReactDebugInfo, )
| 83 | let currentDebugInfo: null | ReactDebugInfo = null; |
| 84 | |
| 85 | function pushDebugInfo( |
| 86 | debugInfo: null | ReactDebugInfo, |
| 87 | ): null | ReactDebugInfo { |
| 88 | if (!__DEV__) { |
| 89 | return null; |
| 90 | } |
| 91 | const previousDebugInfo = currentDebugInfo; |
| 92 | if (debugInfo == null) { |
| 93 | // Leave inplace |
| 94 | } else if (previousDebugInfo === null) { |
| 95 | currentDebugInfo = debugInfo; |
| 96 | } else { |
| 97 | // If we have two debugInfo, we need to create a new one. This makes the array no longer |
| 98 | // live so we'll miss any future updates if we received more so ideally we should always |
| 99 | // do this after both have fully resolved/unsuspended. |
| 100 | currentDebugInfo = previousDebugInfo.concat(debugInfo); |
| 101 | } |
| 102 | return previousDebugInfo; |
| 103 | } |
| 104 | |
| 105 | function getCurrentDebugTask(): null | ConsoleTask { |
| 106 | // Get the debug task of the parent Server Component if there is one. |
no outgoing calls
no test coverage detected