| 23884 | } |
| 23885 | |
| 23886 | function detachFiber(current) { |
| 23887 | var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we |
| 23888 | // should clear the child pointer of the parent alternate to let this |
| 23889 | // get GC:ed but we don't know which for sure which parent is the current |
| 23890 | // one so we'll settle for GC:ing the subtree of this child. This child |
| 23891 | // itself will be GC:ed when the parent updates the next time. |
| 23892 | |
| 23893 | current.return = null; |
| 23894 | current.child = null; |
| 23895 | current.memoizedState = null; |
| 23896 | current.updateQueue = null; |
| 23897 | current.dependencies = null; |
| 23898 | current.alternate = null; |
| 23899 | current.firstEffect = null; |
| 23900 | current.lastEffect = null; |
| 23901 | current.pendingProps = null; |
| 23902 | current.memoizedProps = null; |
| 23903 | current.stateNode = null; |
| 23904 | |
| 23905 | if (alternate !== null) { |
| 23906 | detachFiber(alternate); |
| 23907 | } |
| 23908 | } |
| 23909 | |
| 23910 | function getHostParentFiber(fiber) { |
| 23911 | var parent = fiber.return; |