Fabric: Fixed ConcreteShadowNode::getProps()

Summary:
Apparently, there is no point to return a reference from this method because the struct (std::shared_ptr) is allocated on stack.
The test is also updated.

allow-large-files

Reviewed By: fkgozali

Differential Revision: D7557749

fbshipit-source-id: aa74146322c6d340256752586f05fc672024038e
This commit is contained in:
Valentin Shergin 2018-04-10 16:37:24 -07:00 committed by Facebook Github Bot
parent b13d5beb11
commit 6924d44b20
2 changed files with 3 additions and 6 deletions

View File

@ -76,7 +76,7 @@ public:
return typeid(*this).hash_code();
}
const SharedConcreteProps &getProps() const {
const SharedConcreteProps getProps() const {
return std::static_pointer_cast<const PropsT>(props_);
}

View File

@ -41,14 +41,11 @@ TEST(ShadowNodeTest, handleShadowNodeCreation) {
ASSERT_EQ(node->getSourceNode(), nullptr);
ASSERT_EQ(node->getChildren()->size(), 0);
// TODO(#27369757): getProps() doesn't work
// ASSERT_STREQ(node->getProps()->getNativeId().c_str(), "testNativeID");
ASSERT_STREQ(node->getProps()->getNativeId().c_str(), "testNativeID");
node->sealRecursive();
ASSERT_TRUE(node->getSealed());
// TODO(#27369757): verify Props are also sealed.
// ASSERT_TRUE(node->getProps()->getSealed());
ASSERT_TRUE(node->getProps()->getSealed());
}
TEST(ShadowNodeTest, handleShadowNodeSimpleCloning) {