diff --git a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h index 423b1911c..fb1228b75 100644 --- a/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h +++ b/ReactCommon/fabric/components/view/ConcreteViewShadowNode.h @@ -68,7 +68,7 @@ public: }; ConcreteViewShadowNode( - const SharedShadowNode &sourceShadowNode, + const ShadowNode &sourceShadowNode, const ShadowNodeFragment &fragment ): BaseShadowNode( @@ -76,11 +76,11 @@ public: fragment ), AccessibleShadowNode( - std::static_pointer_cast(sourceShadowNode), + static_cast(sourceShadowNode), std::static_pointer_cast(fragment.props) ), YogaLayoutableShadowNode( - *std::static_pointer_cast(sourceShadowNode) + static_cast(sourceShadowNode) ) { if (fragment.props) { diff --git a/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.cpp b/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.cpp index 4941cd49e..70c9be16f 100644 --- a/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.cpp +++ b/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.cpp @@ -19,10 +19,9 @@ AccessibleShadowNode::AccessibleShadowNode( } AccessibleShadowNode::AccessibleShadowNode( - const SharedAccessibleShadowNode &shadowNode, + const AccessibleShadowNode &shadowNode, const SharedAccessibilityProps &props ) { - assert(shadowNode); } } // namespace react diff --git a/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.h b/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.h index b5ffab5ca..9f00acbc3 100644 --- a/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.h +++ b/ReactCommon/fabric/components/view/accessibility/AccessibleShadowNode.h @@ -32,7 +32,7 @@ public: ); AccessibleShadowNode( - const SharedAccessibleShadowNode &shadowNode, + const AccessibleShadowNode &shadowNode, const SharedAccessibilityProps &props = nullptr ); }; diff --git a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h index 007dc6a14..077ad779e 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h @@ -78,7 +78,7 @@ public: assert(std::dynamic_pointer_cast(sourceShadowNode)); const auto &shadowNode = std::make_shared( - std::static_pointer_cast(sourceShadowNode), + *std::static_pointer_cast(sourceShadowNode), ShadowNodeFragment { .props = props, .eventEmitter = eventEmitter, diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp index 0be17553c..9fdb725af 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.cpp +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.cpp @@ -40,18 +40,18 @@ ShadowNode::ShadowNode( } ShadowNode::ShadowNode( - const SharedShadowNode &sourceShadowNode, + const ShadowNode &sourceShadowNode, const ShadowNodeFragment &fragment ): - tag_(fragment.tag ?: sourceShadowNode->tag_), - rootTag_(fragment.rootTag ?: sourceShadowNode->rootTag_), - props_(fragment.props ?: sourceShadowNode->props_), - eventEmitter_(fragment.eventEmitter ?: sourceShadowNode->eventEmitter_), - children_(fragment.children ?: sourceShadowNode->children_), - localData_(fragment.localData ?: sourceShadowNode->localData_), - cloneFunction_(sourceShadowNode->cloneFunction_), + tag_(fragment.tag ?: sourceShadowNode.tag_), + rootTag_(fragment.rootTag ?: sourceShadowNode.rootTag_), + props_(fragment.props ?: sourceShadowNode.props_), + eventEmitter_(fragment.eventEmitter ?: sourceShadowNode.eventEmitter_), + children_(fragment.children ?: sourceShadowNode.children_), + localData_(fragment.localData ?: sourceShadowNode.localData_), + cloneFunction_(sourceShadowNode.cloneFunction_), childrenAreShared_(true), - revision_(sourceShadowNode->revision_ + 1) { + revision_(sourceShadowNode.revision_ + 1) { assert(props_); assert(children_); diff --git a/ReactCommon/fabric/core/shadownode/ShadowNode.h b/ReactCommon/fabric/core/shadownode/ShadowNode.h index acdece269..762f1ef7e 100644 --- a/ReactCommon/fabric/core/shadownode/ShadowNode.h +++ b/ReactCommon/fabric/core/shadownode/ShadowNode.h @@ -66,7 +66,7 @@ public: * applying fields from given `fragment`. */ ShadowNode( - const SharedShadowNode &sourceShadowNode, + const ShadowNode &sourceShadowNode, const ShadowNodeFragment &fragment ); diff --git a/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp b/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp index b786270cb..4a7507f62 100644 --- a/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp +++ b/ReactCommon/fabric/core/tests/ShadowNodeTest.cpp @@ -62,7 +62,7 @@ TEST(ShadowNodeTest, handleShadowNodeSimpleCloning) { }, nullptr ); - auto node2 = std::make_shared(node, ShadowNodeFragment {}); + auto node2 = std::make_shared(*node, ShadowNodeFragment {}); ASSERT_STREQ(node->getComponentName().c_str(), "Test"); ASSERT_EQ(node->getTag(), 9); @@ -83,7 +83,7 @@ TEST(ShadowNodeTest, handleShadowNodeMutation) { ASSERT_EQ(node1Children.at(0), node2); ASSERT_EQ(node1Children.at(1), node3); - auto node4 = std::make_shared(node2, ShadowNodeFragment {}); + auto node4 = std::make_shared(*node2, ShadowNodeFragment {}); node1->replaceChild(node2, node4); node1Children = node1->getChildren(); ASSERT_EQ(node1Children.size(), 2); @@ -99,7 +99,7 @@ TEST(ShadowNodeTest, handleShadowNodeMutation) { // No more mutation after sealing. EXPECT_THROW(node4->setLocalData(nullptr), std::runtime_error); - auto node5 = std::make_shared(node4, ShadowNodeFragment {}); + auto node5 = std::make_shared(*node4, ShadowNodeFragment {}); node5->setLocalData(nullptr); ASSERT_EQ(node5->getLocalData(), nullptr); } @@ -119,7 +119,7 @@ TEST(ShadowNodeTest, handleCloneFunction) { }, [](const SharedShadowNode &shadowNode, const ShadowNodeFragment &fragment) { return std::make_shared( - std::static_pointer_cast(shadowNode), + *std::static_pointer_cast(shadowNode), fragment ); } diff --git a/ReactCommon/fabric/uimanager/ShadowTree.cpp b/ReactCommon/fabric/uimanager/ShadowTree.cpp index e52da656a..1a1df2c48 100644 --- a/ReactCommon/fabric/uimanager/ShadowTree.cpp +++ b/ReactCommon/fabric/uimanager/ShadowTree.cpp @@ -54,7 +54,7 @@ UnsharedRootShadowNode ShadowTree::cloneRootShadowNode(const LayoutConstraints & auto oldRootShadowNode = rootShadowNode_; const auto &props = std::make_shared(*oldRootShadowNode->getProps(), layoutConstraints, layoutContext); auto newRootShadowNode = - std::make_shared(oldRootShadowNode, ShadowNodeFragment {.props = props}); + std::make_shared(*oldRootShadowNode, ShadowNodeFragment {.props = props}); return newRootShadowNode; } @@ -62,7 +62,7 @@ void ShadowTree::complete(const SharedShadowNodeUnsharedList &rootChildNodes) { auto oldRootShadowNode = rootShadowNode_; auto newRootShadowNode = std::make_shared( - oldRootShadowNode, + *oldRootShadowNode, ShadowNodeFragment { .children = SharedShadowNodeSharedList(rootChildNodes) }