Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable expensive checks in OSS #42306

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ void YogaLayoutableShadowNode::ensureConsistency() const {
}

void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
#ifdef REACT_NATIVE_DEBUG
#if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
// Checking that the shapes of Yoga node children object look fine.
// This is the only heuristic that might produce false-positive results
// (really broken dangled nodes might look fine). This is useful as an early
Expand All @@ -997,7 +997,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
}

void YogaLayoutableShadowNode::ensureYogaChildrenAlignment() const {
#ifdef REACT_NATIVE_DEBUG
#if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
// If the node is not a leaf node, checking that:
// - All children are `YogaLayoutableShadowNode` subclasses.
// - All Yoga children are owned/connected to corresponding children of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@
// Enables some Shadow Tree introspection features (maintains a StubViewTree,
// and logs prev/next tree and mutations if there are any discrepancies). If you
// define this, also define `RN_DEBUG_STRING_CONVERTIBLE`.
#ifdef REACT_NATIVE_DEBUG
#if (defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE))
#define RN_SHADOW_TREE_INTROSPECTION 1
#endif

// This enables certain object-to-string debug conversions to be compiled.
// Enable if `RN_SHADOW_TREE_INTROSPECTION` is enabled.
#ifdef RN_SHADOW_TREE_INTROSPECTION
#define RN_DEBUG_STRING_CONVERTIBLE 1
#endif

#ifndef RN_DEBUG_STRING_CONVERTIBLE
#else
#define RN_DEBUG_STRING_CONVERTIBLE 0
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#if RN_DEBUG_STRING_CONVERTIBLE
#include <memory>

#include <gtest/gtest.h>
Expand Down Expand Up @@ -82,3 +83,4 @@ TEST(DebugStringConvertibleTest, handleNodeWithComplexProps) {
item->getDebugDescription().c_str(),
"<View=hello x=1(height=100 width=200)/>");
}
#endif
Loading