Index: runtime/include/dart_api.h |
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h |
index 4a034a24ca76235bc57b87c2ed89d69a3ef0df61..7e7e890d91a842433f7c1c28e8102dc1e2026a92 100644 |
--- a/runtime/include/dart_api.h |
+++ b/runtime/include/dart_api.h |
@@ -387,6 +387,18 @@ DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle); |
/* TODO(turnidge): Should this really return an error handle? */ |
/* Consider just terminating. */ |
+/** |
+ * Propagates error if 'handle' is an error handle. |
+ * |
+ * Provided for convenience. |
+ */ |
+#define DART_CHECK_VALID_AND_PROPAGATE(handle) \ |
+ { \ |
+ if (Dart_IsError((handle))) { \ |
+ Dart_PropagateError(handle); \ |
zra
2017/04/10 21:39:43
Dart_PropagateError is actually a little bit dange
bkonyi
2017/04/11 01:30:51
Ah okay, good to know. Removed.
|
+ } \ |
+ } |
+ |
/* Internal routine used for reporting error handles. */ |
DART_EXPORT void _Dart_ReportErrorHandle(const char* file, |
int line, |