Skip to content

Commit c24fc75

Browse files
JoshuaGrossfacebook-github-bot
authored andcommitted
ReactCommon/renderer/components/view: Migrate uses of NDEBUG to REACT_NATIVE_DEBUG + react_native_assert
Summary: For better cross-platform consistency, migrate usages of NDEBUG to REACT_NATIVE_DEBUG. See flags.h for explanation. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D26695203 fbshipit-source-id: df09af5a62044c711368954b5e9b3a114491e2ed
1 parent 7682968 commit c24fc75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "YogaLayoutableShadowNode.h"
9+
#include <react/debug/flags.h>
910
#include <react/debug/react_native_assert.h>
1011
#include <react/renderer/components/view/ViewProps.h>
1112
#include <react/renderer/components/view/conversions.h>
@@ -715,7 +716,7 @@ void YogaLayoutableShadowNode::ensureConsistency() const {
715716
}
716717

717718
void YogaLayoutableShadowNode::ensureYogaChildrenOwnersConsistency() const {
718-
#ifndef NDEBUG
719+
#ifdef REACT_NATIVE_DEBUG
719720
// Checking that all Yoga node children have the same `owner`.
720721
// The owner might be not equal to the `yogaNode_` though.
721722
auto &yogaChildren = yogaNode_.getChildren();
@@ -730,7 +731,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenOwnersConsistency() const {
730731
}
731732

732733
void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
733-
#ifndef NDEBUG
734+
#ifdef REACT_NATIVE_DEBUG
734735
// Checking that the shapes of Yoga node children object look fine.
735736
// This is the only heuristic that might produce false-positive results
736737
// (really broken dangled nodes might look fine). This is useful as an early
@@ -748,7 +749,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
748749
}
749750

750751
void YogaLayoutableShadowNode::ensureYogaChildrenAlighment() const {
751-
#ifndef NDEBUG
752+
#ifdef REACT_NATIVE_DEBUG
752753
// If the node is not a leaf node, checking that:
753754
// - All children are `YogaLayoutableShadowNode` subclasses.
754755
// - All Yoga children are owned/connected to corresponding children of

0 commit comments

Comments
 (0)