From 2508c46a751afdb1a6122ac51c6ded75904f470c Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 9 Mar 2020 16:32:33 -0700 Subject: [PATCH] Fabric: More `assert`s in YogaLayoutableShadowNode Summary: These `assert`s must be satisfied. Having them allows us to fail early in case of bugs. I spent a log of time debugging an issue and finally found that after adding those `assert`s. Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D20268046 fbshipit-source-id: 1d8ddd6de00069bd2a79e74af5e4278aa6c9131b --- .../fabric/components/view/yoga/YogaLayoutableShadowNode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index b6b767905d..225ac2afa1 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -261,11 +261,15 @@ void YogaLayoutableShadowNode::layoutTree( } void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { + assert(!yogaNode_.isDirty()); + for (const auto &childYogaNode : yogaNode_.getChildren()) { if (!childYogaNode->getHasNewLayout()) { continue; } + assert(!childYogaNode->isDirty()); + auto childNode = static_cast(childYogaNode->getContext());