Skip to content

Commit

Permalink
StubViewTree: move assert to get better debug logging
Browse files Browse the repository at this point in the history
Summary:
Move this assert so the debug logging executes first; in the case where this assert fires, we'll get a little more information (for Android, where attaching a Cxx debugger is a bit harder vs iOS).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27585132

fbshipit-source-id: e3f4cc3d78587744b9e73db685eda1fd6c36ca9d
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Apr 15, 2021
1 parent 2d7560d commit c83562e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactCommon/react/renderer/mounting/StubViewTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ void StubViewTree::mutate(ShadowViewMutationList const &mutations) {
auto parentStubView = registry[parentTag];
react_native_assert(registry.find(childTag) != registry.end());
auto childStubView = registry[childTag];
react_native_assert(childStubView->parentTag == NO_VIEW_TAG);
childStubView->update(mutation.newChildShadowView);
STUB_VIEW_LOG({
LOG(ERROR) << "StubView: Insert [" << childTag << "] into ["
<< parentTag << "] @" << mutation.index << "("
<< parentStubView->children.size() << " children)";
});
react_native_assert(childStubView->parentTag == NO_VIEW_TAG);
react_native_assert(
parentStubView->children.size() >= mutation.index);
childStubView->parentTag = parentTag;
Expand Down

0 comments on commit c83562e

Please sign in to comment.