diff --git a/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp b/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp index 1fd2a48271aa89..d8e9ce211cf4f2 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp @@ -29,7 +29,7 @@ Props::Shared UnimplementedViewComponentDescriptor::cloneProps( // We have to clone `Props` object one more time to make sure that we have // an unshared (and non-`const`) copy of it which we can mutate. RawProps emptyRawProps{}; - emptyRawProps.parse(rawPropsParser_, context); + emptyRawProps.parse(rawPropsParser_); auto unimplementedViewProps = std::make_shared( context, static_cast(*clonedProps), diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index f161e9b12c1346..e56ac9cad92165 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -105,7 +105,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { return ShadowNodeT::defaultSharedProps(); } - rawProps.parse(rawPropsParser_, context); + rawProps.parse(rawPropsParser_); // Call old-style constructor auto shadowNodeProps = ShadowNodeT::Props(context, rawProps, props); diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp b/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp index 0739b8ec6b12e9..945566c785e1fc 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp @@ -47,9 +47,7 @@ RawProps::RawProps(folly::dynamic dynamic) noexcept { dynamic_ = std::move(dynamic); } -void RawProps::parse( - const RawPropsParser& parser, - const PropsParserContext& /*unused*/) const noexcept { +void RawProps::parse(const RawPropsParser& parser) const noexcept { react_native_assert(parser_ == nullptr && "A parser was already assigned."); parser_ = &parser; parser.preparse(*this); diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawProps.h b/packages/react-native/ReactCommon/react/renderer/core/RawProps.h index e01af9f84db306..cfb2bd48cec24a 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawProps.h +++ b/packages/react-native/ReactCommon/react/renderer/core/RawProps.h @@ -70,8 +70,7 @@ class RawProps final { RawProps(const RawProps& other) noexcept = delete; RawProps& operator=(const RawProps& other) noexcept = delete; - void parse(const RawPropsParser& parser, const PropsParserContext&) - const noexcept; + void parse(const RawPropsParser& parser) const noexcept; /* * Deprecated. Do not use. diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h b/packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h index 5150189817134d..de0b1c7fcfabcc 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h +++ b/packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h @@ -46,7 +46,7 @@ class RawPropsParser final { ContextContainer contextContainer{}; PropsParserContext parserContext{-1, contextContainer}; - emptyRawProps.parse(*this, parserContext); + emptyRawProps.parse(*this); PropsT(parserContext, {}, emptyRawProps); postPrepare(); } diff --git a/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp b/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp index bca6d019ffbbd0..7bec6cfcc45309 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp @@ -154,7 +154,7 @@ TEST(RawPropsTest, handleProps) { const auto& raw = RawProps(folly::dynamic::object("nativeID", "abc")); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); auto props = std::make_shared(parserContext, Props(), raw); @@ -171,7 +171,7 @@ TEST(RawPropsTest, handleRawPropsSingleString) { const auto& raw = RawProps(folly::dynamic::object("nativeID", "abc")); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); std::string value = (std::string)*raw.at("nativeID", nullptr, nullptr); @@ -186,7 +186,7 @@ TEST(RawPropsTest, handleRawPropsSingleFloat) { RawProps(folly::dynamic::object("floatValue", (float)42.42)); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); auto value = (float)*raw.at("floatValue", nullptr, nullptr); @@ -201,7 +201,7 @@ TEST(RawPropsTest, handleRawPropsSingleDouble) { RawProps(folly::dynamic::object("doubleValue", (double)42.42)); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); auto value = (double)*raw.at("doubleValue", nullptr, nullptr); @@ -215,7 +215,7 @@ TEST(RawPropsTest, handleRawPropsSingleInt) { const auto& raw = RawProps(folly::dynamic::object("intValue", (int)42.42)); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); int value = (int)*raw.at("intValue", nullptr, nullptr); @@ -229,7 +229,7 @@ TEST(RawPropsTest, handleRawPropsSingleIntGetManyTimes) { const auto& raw = RawProps(folly::dynamic::object("intValue", (int)42.42)); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); @@ -247,7 +247,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypes) { auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001); @@ -269,7 +269,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetTwice) { auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001); @@ -299,7 +299,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetOutOfOrder) { auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001); @@ -326,7 +326,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesIncomplete) { auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42); EXPECT_EQ(raw.at("doubleValue", nullptr, nullptr), nullptr); @@ -346,7 +346,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesIncorrectLookup) { auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); // Before D18662135, looking up an invalid key would trigger // an infinite loop. This is out of contract, so we should only @@ -363,7 +363,7 @@ TEST(RawPropsTest, handlePropsMultiLookup) { const auto& raw = RawProps(folly::dynamic::object("floatValue", (float)10.0)); auto parser = RawPropsParser(); parser.prepare(); - raw.parse(parser, parserContext); + raw.parse(parser); auto props = std::make_shared( parserContext, PropsMultiLookup(), raw);