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

Unified Diff: runtime/bin/dartutils.h

Issue 91293002: Propagate errors from DartUtils helper functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated comments Created 7 years, 1 month 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 | « no previous file | runtime/bin/dartutils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.h
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 476d81379de0e83d03c55a2c2743c6259970e5a1..a9c3410d5468b01c081c7dd326800ab748e134a7 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -78,23 +78,25 @@ class CommandLineOptions {
class DartUtils {
public:
- // TODO(turnidge): Clean up the implementations of these so that
- // they allow for proper error propagation.
-
- // Assumes that the value object is known to be an integer object
- // that fits in a signed 64-bit integer.
+ // Returns the integer value of a Dart object. If the object is not
+ // an integer value an API error is propagated.
static int64_t GetIntegerValue(Dart_Handle value_obj);
- // Assumes that the value object is known to be an intptr_t. This should
- // only be known when the value has been put into Dart as a pointer encoded
- // in a 64-bit integer. This is the case for file and directory operations.
+ // Returns the intptr_t value of a Dart object. If the object is not
+ // an integer value or the value is outside the intptr_t range an
+ // API error is propagated.
static intptr_t GetIntptrValue(Dart_Handle value_obj);
// Checks that the value object is an integer object that fits in a
// signed 64-bit integer. If it is, the value is returned in the
// value out parameter and true is returned. Otherwise, false is
// returned.
static bool GetInt64Value(Dart_Handle value_obj, int64_t* value);
+ // Returns the string value of a Dart object. If the object is not
+ // a string value an API error is propagated.
static const char* GetStringValue(Dart_Handle str_obj);
+ // Returns the boolean value of a Dart object. If the object is not
+ // a boolean value an API error is propagated.
static bool GetBooleanValue(Dart_Handle bool_obj);
+
static void SetIntegerField(Dart_Handle handle,
const char* name,
intptr_t val);
« no previous file with comments | « no previous file | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698