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
This commit is contained in:
Valentin Shergin 2020-03-09 16:32:33 -07:00 коммит произвёл Facebook Github Bot
Родитель b5aaa25b9e
Коммит 2508c46a75
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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<YogaLayoutableShadowNode *>(childYogaNode->getContext());