Skip to content

Commit 42d14be

Browse files
dcaspiFacebook Github Bot
authored andcommitted
Enforcing semi-colon consistency between dev and release modes when calling RCTLog*
Summary: The various RCTLog macros (`RCTLogWarn`, `RCTLogError`, etc..) are based on the `_RCTLog` macro, which, in its expanded form, has a semi-colon in DEV mode (i.e., when `RCTLOG_ENABLED` is set to 1), and doesn't have one when `RCTLOG_ENABLED` is set to 0. This could lead to a situation where code will compile in DEV but will fail to compile for prod. Fixing this by removing the semicolon from the DEV version (as should). Reviewed By: javache Differential Revision: D4189133 fbshipit-source-id: 54cb4e2c96d1e48d9df88464aa58b13af432c2bd
1 parent 3b4ac79 commit 42d14be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

React/Base/RCTLog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ RCT_EXTERN void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *pref
124124
* Private logging function - ignore this.
125125
*/
126126
#if RCTLOG_ENABLED
127-
#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__);
127+
#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__)
128128
#else
129129
#define _RCTLog(lvl, ...) do { } while (0)
130130
#endif

React/Modules/RCTAsyncLocalStorage.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ - (NSDictionary *)_ensureSetup
219219
RCTAssertThread(RCTGetMethodQueue(), @"Must be executed on storage thread");
220220

221221
#if TARGET_OS_TV
222-
RCTLogWarn(@"Persistent storage is not supported on tvOS, your data may be removed at any point.")
222+
RCTLogWarn(@"Persistent storage is not supported on tvOS, your data may be removed at any point.");
223223
#endif
224224

225225
NSError *error = nil;

0 commit comments

Comments
 (0)