From 75a735976d039c6d2db815d79e99731f086e306e Mon Sep 17 00:00:00 2001 From: Frederic Barthelemy Date: Mon, 19 Mar 2018 15:10:14 -0700 Subject: [PATCH] RCTObjcExecutor: fix initializer-list initialization order build warning. Summary: Fixes: #18384 Previously line 42 had a warning of: `Field 'm_jsThread' will be initialized after field 'm_delegate'` This appears to be because the private member fields are declared in a different order than the initializer-list was told to initialize things. I chose to re-order the initializer list because that fixes the warning by matching the code structure to what the compiler was telling us it was going to do. An alternate fix would be to change the order of the member variables declared in the `private:` section to match the coded order in the initializer list. This might be the right move if the initializer list had the correct intent, but this would be a breaking change from a behavior perspective, so I'd need somebody with more knowledge to suggest this is the right move. A. Examine line to see the warning is gone. B. Get a C++ guru to figure out the intent of this file and see if this actually exposed a bug that recommends we go with the alternate fix suggested above. [IOS][MINOR][React/CxxBridge/] - Build warning fix Closes https://github.com/facebook/react-native/pull/18385 Differential Revision: D7328272 Pulled By: mhorowitz fbshipit-source-id: 59d7ace6222c4609ac7d023f97e522e85e02a9db --- React/CxxBridge/RCTObjcExecutor.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/CxxBridge/RCTObjcExecutor.mm b/React/CxxBridge/RCTObjcExecutor.mm index 2f861ffc9..6039ef24a 100644 --- a/React/CxxBridge/RCTObjcExecutor.mm +++ b/React/CxxBridge/RCTObjcExecutor.mm @@ -39,8 +39,8 @@ public: std::shared_ptr delegate) : m_jse(jse) , m_errorBlock(errorBlock) - , m_jsThread(std::move(jsThread)) , m_delegate(std::move(delegate)) + , m_jsThread(std::move(jsThread)) { m_jsCallback = ^(id json, NSError *error) { if (error) {