Skip to content

Commit

Permalink
Remove Debug ifdefs around description
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Sep 24, 2023
1 parent 098af1c commit 8a7159f
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ - (void)dirtyLayout
[self.superview dirtyLayout];
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
NSString *superDescription = super.description;
return [[superDescription substringToIndex:superDescription.length - 1]
stringByAppendingFormat:@"; text: %@>", self.text];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTImageSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ - (BOOL)isEqual:(RCTImageSource *)object
(CGSizeEqualToSize(_size, object.size) || CGSizeEqualToSize(object.size, CGSizeZero));
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<RCTImageSource: %p URL=%@, size=%@, scale=%0.f>",
Expand All @@ -51,7 +50,6 @@ - (NSString *)description
NSStringFromCGSize(_size),
_scale];
}
#endif // macOS]

@end

Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTJSStackFrame.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ + (instancetype)stackFrameWithDictionary:(NSDictionary *)dict
return stack;
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p method name: %@; file name: %@; line: %ld; column: %ld>",
Expand All @@ -147,6 +146,5 @@ - (NSString *)description
(long)self.lineNumber,
(long)self.column];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTJavaScriptLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ @implementation RCTSource

@implementation RCTLoadingProgress

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
NSMutableString *desc = [NSMutableString new];
Expand All @@ -65,7 +64,6 @@ - (NSString *)description
[desc appendString:@"\u2026"];
return desc;
}
#endif // macOS]

@end

Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTKeyCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ - (BOOL)matchesInput:(NSString *)input flags:(UIKeyModifierFlags)flags
return [_key isEqual:input] && (_flags == flags || flags == 0);
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@:%p input=\"%@\" flags=%lld hasBlock=%@>",
Expand All @@ -85,7 +84,6 @@ - (NSString *)description
(long long)_flags,
_block ? @"YES" : @"NO"];
}
#endif // macOS]

@end

Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTModuleData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,9 @@ - (void)invalidate
_methodQueue = nil;
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p; name=\"%@\">", [self class], self, self.name];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTModuleMethod.mm
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ - (NSString *)methodName
return [NSString stringWithFormat:@"-[%@ %s]", _moduleClass, sel_getName(_selector)];
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p; exports %@ as %s(); type: %s>",
Expand All @@ -612,6 +611,5 @@ - (NSString *)description
self.JSMethodName,
RCTFunctionDescriptorFromType(self.functionType)];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Base/RCTTouchEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,10 @@ - (uint16_t)coalescingKey
return _coalescingKey;
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString
stringWithFormat:@"<%@: %p; name = %@; coalescing key = %hu>", [self class], self, _eventName, _coalescingKey];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/CxxModule/RCTCxxMethod.mm
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ - (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray
}
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p; name = %s>", [self class], self, self.JSMethodName];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Modules/RCTLayoutAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ - (BOOL)isEqual:(RCTLayoutAnimation *)animation
_animationType == animation.animationType;
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString
Expand All @@ -205,6 +204,5 @@ - (NSString *)description
_initialVelocity,
(long)_animationType];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Modules/RCTLayoutAnimationGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ - (BOOL)isEqual:(RCTLayoutAnimationGroup *)layoutAnimation
[_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return
Expand All @@ -76,6 +75,5 @@ - (NSString *)description
[_updatingLayoutAnimation description],
[_deletingLayoutAnimation description]];
}
#endif // macOS]

@end
2 changes: 0 additions & 2 deletions packages/react-native/React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ - (NSNumber *)reactTagAtPoint:(CGPoint)point
return self.reactTag;
}

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
NSString *description = super.description;
Expand All @@ -404,7 +403,6 @@ - (NSString *)description
NSStringFromCGRect(self.layoutMetrics.frame)];
return description;
}
#endif // macOS]

- (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
{
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -727,15 +727,13 @@ - (BOOL)accessibilityPerformShowMenu
}
#endif // macOS]

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [[super description] stringByAppendingFormat:@" reactTag: %@; frame = %@; layer = %@",
self.reactTag,
NSStringFromCGRect(self.frame),
self.layer];
}
#endif // macOS]

#if TARGET_OS_OSX // [macOS
- (void)setShadowColor:(NSColor *)shadowColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ - (instancetype)initWithTestName:(NSString *)testName

#pragma mark - Properties

#if DEBUG // [macOS description is a debug-only feature
- (NSString *)description
{
return [NSString stringWithFormat:@"%@ %@", [super description], _referenceImagesDirectory];
}
#endif // macOS]

#pragma mark - Public API

Expand Down

0 comments on commit 8a7159f

Please sign in to comment.