Breaking: Fix callback const-correctness (#1369)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1369

X-link: https://github.com/facebook/react-native/pull/39370

This fixes const-correctness of callbacks (e.g. not letting a logger function modify nodes during layout). This helps us to continue to fix const-correctness issues inside of Yoga.

This change is breaking to the public API, since it requires a change in signature passed to Yoga.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D49130714

fbshipit-source-id: 4305f8882d89f296e45b78497a51716a0dbb3b2d
This commit is contained in:
Nick Gerleman
2023-09-11 19:51:40 -07:00
committed by Facebook GitHub Bot
parent b12a6a340c
commit 26f2b28eca
22 changed files with 111 additions and 111 deletions

View File

@@ -249,7 +249,7 @@ TEST_F(EventTest, layout_events_has_max_measure_cache) {
TEST_F(EventTest, measure_functions_get_wrapped) {
auto root = YGNodeNew();
YGNodeSetMeasureFunc(
root, [](YGNodeRef, float, YGMeasureMode, float, YGMeasureMode) {
root, [](YGNodeConstRef, float, YGMeasureMode, float, YGMeasureMode) {
return YGSize{};
});
@@ -267,7 +267,8 @@ TEST_F(EventTest, baseline_functions_get_wrapped) {
auto child = YGNodeNew();
YGNodeInsertChild(root, child, 0);
YGNodeSetBaselineFunc(child, [](YGNodeRef, float, float) { return 0.0f; });
YGNodeSetBaselineFunc(
child, [](YGNodeConstRef, float, float) { return 0.0f; });
YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow);
YGNodeStyleSetAlignItems(root, YGAlignBaseline);