@@ -182,6 +182,10 @@ inline std::string toString(const ImportantForAccessibility &importantForAccessi
182182 return " no" ;
183183 case ImportantForAccessibility::NoHideDescendants:
184184 return " no-hide-descendants" ;
185+ default :
186+ LOG (ERROR ) << " Unsupported ImportantForAccessibility value: " << static_cast <int >(importantForAccessibility);
187+ react_native_expect (false );
188+ return " auto" ;
185189 }
186190}
187191
@@ -372,12 +376,12 @@ inline std::string toString(const AccessibilityRole &accessibilityRole)
372376 return " slidingdrawer" ;
373377 case AccessibilityRole::Iconmenu:
374378 return " iconmenu" ;
379+ default :
380+ LOG (ERROR ) << " Unsupported AccessibilityRole value: " << static_cast <int >(accessibilityRole);
381+ react_native_expect (false );
382+ // sane default for prod
383+ return " none" ;
375384 }
376-
377- LOG (ERROR ) << " Unsupported AccessibilityRole value" ;
378- react_native_expect (false );
379- // sane default for prod
380- return " none" ;
381385}
382386
383387inline void fromRawValue (const PropsParserContext &context, const RawValue &value, AccessibilityRole &result)
@@ -613,12 +617,12 @@ inline std::string toString(const Role &role)
613617 return " treegrid" ;
614618 case Role::Treeitem:
615619 return " treeitem" ;
620+ default :
621+ LOG (ERROR ) << " Unsupported Role value: " << static_cast <int >(role);
622+ react_native_expect (false );
623+ // sane default for prod
624+ return " none" ;
616625 }
617-
618- LOG (ERROR ) << " Unsupported Role value" ;
619- react_native_expect (false );
620- // sane default for prod
621- return " none" ;
622626}
623627
624628inline void fromRawValue (const PropsParserContext &context, const RawValue &value, Role &result)
@@ -780,6 +784,10 @@ inline std::string toString(AccessibilityLiveRegion accessibilityLiveRegion)
780784 return " polite" ;
781785 case AccessibilityLiveRegion::Assertive:
782786 return " assertive" ;
787+ default :
788+ LOG (ERROR ) << " Unsupported AccessibilityLiveRegion value: " << static_cast <int >(accessibilityLiveRegion);
789+ react_native_expect (false );
790+ return " none" ;
783791 }
784792}
785793
@@ -795,6 +803,10 @@ inline std::string toString(AccessibilityState::CheckedState state)
795803 return " Mixed" ;
796804 case AccessibilityState::None:
797805 return " None" ;
806+ default :
807+ LOG (ERROR ) << " Unsupported AccessibilityState::CheckedState value: " << static_cast <int >(state);
808+ react_native_expect (false );
809+ return " None" ;
798810 }
799811}
800812
0 commit comments