Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: runtime/vm/dart_api_impl.h

Issue 1663613002: Dart_SetReturnValue now accepts and propagates error handles. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code review Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.h
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index ee36410d6512685881ef23da9a470753b8d1cdac..9820417debabd26a98a6591b0aab8450d486dd3d 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -162,6 +162,11 @@ class Api : AllStatic {
return (ClassId(handle) >= kInstanceCid);
}
+ // Returns true if the handle holds an Error.
+ static bool IsError(Dart_Handle handle) {
+ return RawObject::IsErrorClassId(ClassId(handle));
+ }
+
// Returns the value of a Smi.
static intptr_t SmiValue(Dart_Handle handle) {
// TODO(turnidge): Assumes RawObject* is at offset zero. Fix.
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698