mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Issue #2259 - Add mozilla::Result<V, E> and JS::Result<> for fallible return values
Based-on: m-c 1283562, 1277368/1, 1324828
This commit is contained in:
parent
9914c06168
commit
4c2e378613
20 changed files with 905 additions and 73 deletions
|
|
@ -597,6 +597,8 @@ struct AssertionConditionType
|
|||
/* Do nothing. */ \
|
||||
} \
|
||||
} while (0)
|
||||
# define MOZ_ALWAYS_OK(expr) MOZ_ASSERT((expr).isOk())
|
||||
# define MOZ_ALWAYS_ERR(expr) MOZ_ASSERT((expr).isErr())
|
||||
#else
|
||||
# define MOZ_ALWAYS_TRUE(expr) \
|
||||
do { \
|
||||
|
|
@ -610,6 +612,18 @@ struct AssertionConditionType
|
|||
/* Silence MOZ_MUST_USE. */ \
|
||||
} \
|
||||
} while (0)
|
||||
# define MOZ_ALWAYS_OK(expr) \
|
||||
do { \
|
||||
if ((expr).isOk()) { \
|
||||
/* Silence MOZ_MUST_USE. */ \
|
||||
} \
|
||||
} while (0)
|
||||
# define MOZ_ALWAYS_ERR(expr) \
|
||||
do { \
|
||||
if ((expr).isErr()) { \
|
||||
/* Silence MOZ_MUST_USE. */ \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#undef MOZ_DUMP_ASSERTION_STACK
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue