Skip to content

Commit 5f9bb72

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Replace abort() with assert() when a prop-value is not found during parsing
Summary: This diff replaces usage of abort() with assert() when a prop-value is not found during parsing of prop values Reviewed By: shergin Differential Revision: D14563338 fbshipit-source-id: c799420e6b49df35e1d7ccdbd4bc4845067d33cc
1 parent e7085cd commit 5f9bb72

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ReactCommon/fabric/components/view/conversions.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ inline void fromRawValue(const RawValue &value, YGDirection &result) {
177177
return;
178178
}
179179
LOG(FATAL) << "Could not parse YGDirection:" << stringValue;
180+
assert(false);
180181
}
181182

182183
inline void fromRawValue(const RawValue &value, YGFlexDirection &result) {
@@ -199,6 +200,7 @@ inline void fromRawValue(const RawValue &value, YGFlexDirection &result) {
199200
return;
200201
}
201202
LOG(FATAL) << "Could not parse YGFlexDirection:" << stringValue;
203+
assert(false);
202204
}
203205

204206
inline void fromRawValue(const RawValue &value, YGJustify &result) {
@@ -229,6 +231,7 @@ inline void fromRawValue(const RawValue &value, YGJustify &result) {
229231
return;
230232
}
231233
LOG(FATAL) << "Could not parse YGJustify:" << stringValue;
234+
assert(false);
232235
}
233236

234237
inline void fromRawValue(const RawValue &value, YGAlign &result) {
@@ -267,6 +270,7 @@ inline void fromRawValue(const RawValue &value, YGAlign &result) {
267270
return;
268271
}
269272
LOG(FATAL) << "Could not parse YGAlign:" << stringValue;
273+
assert(false);
270274
}
271275

272276
inline void fromRawValue(const RawValue &value, YGPositionType &result) {
@@ -281,6 +285,7 @@ inline void fromRawValue(const RawValue &value, YGPositionType &result) {
281285
return;
282286
}
283287
LOG(FATAL) << "Could not parse YGPositionType:" << stringValue;
288+
assert(false);
284289
}
285290

286291
inline void fromRawValue(const RawValue &value, YGWrap &result) {
@@ -299,6 +304,7 @@ inline void fromRawValue(const RawValue &value, YGWrap &result) {
299304
return;
300305
}
301306
LOG(FATAL) << "Could not parse YGWrap:" << stringValue;
307+
assert(false);
302308
}
303309

304310
inline void fromRawValue(const RawValue &value, YGOverflow &result) {
@@ -317,6 +323,7 @@ inline void fromRawValue(const RawValue &value, YGOverflow &result) {
317323
return;
318324
}
319325
LOG(FATAL) << "Could not parse YGOverflow:" << stringValue;
326+
assert(false);
320327
}
321328

322329
inline void fromRawValue(const RawValue &value, YGDisplay &result) {
@@ -331,6 +338,7 @@ inline void fromRawValue(const RawValue &value, YGDisplay &result) {
331338
return;
332339
}
333340
LOG(FATAL) << "Could not parse YGDisplay:" << stringValue;
341+
assert(false);
334342
}
335343

336344
inline void fromRawValue(const RawValue &value, YGStyle::ValueRepr &result) {
@@ -369,6 +377,7 @@ inline void fromRawValue(const RawValue &value, YGFloatOptional &result) {
369377
}
370378
}
371379
LOG(FATAL) << "Could not parse YGFloatOptional";
380+
assert(false);
372381
}
373382

374383
inline Float toRadians(const RawValue &value) {
@@ -473,6 +482,7 @@ inline void fromRawValue(const RawValue &value, PointerEventsMode &result) {
473482
return;
474483
}
475484
LOG(FATAL) << "Could not parse PointerEventsMode:" << stringValue;
485+
assert(false);
476486
}
477487

478488
inline void fromRawValue(const RawValue &value, BackfaceVisibility &result) {
@@ -491,6 +501,7 @@ inline void fromRawValue(const RawValue &value, BackfaceVisibility &result) {
491501
return;
492502
}
493503
LOG(FATAL) << "Could not parse BackfaceVisibility:" << stringValue;
504+
assert(false);
494505
}
495506

496507
inline void fromRawValue(const RawValue &value, BorderStyle &result) {
@@ -509,6 +520,7 @@ inline void fromRawValue(const RawValue &value, BorderStyle &result) {
509520
return;
510521
}
511522
LOG(FATAL) << "Could not parse BorderStyle:" << stringValue;
523+
assert(false);
512524
}
513525

514526
inline std::string toString(

0 commit comments

Comments
 (0)