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

Unified Diff: runtime/vm/exceptions.h

Issue 9615035: Generate dynamic type errors according to spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
Index: runtime/vm/exceptions.h
===================================================================
--- runtime/vm/exceptions.h (revision 5060)
+++ runtime/vm/exceptions.h (working copy)
@@ -11,10 +11,16 @@
namespace dart {
// Forward declarations.
+class Class;
+class DartFrameIterator;
class Error;
class Instance;
class Object;
+class RawInstance;
+class RawScript;
class RawObject;
+class Script;
+class String;
class Exceptions : AllStatic {
public:
@@ -22,6 +28,23 @@
static void ReThrow(const Instance& exception, const Instance& stacktrace);
static void PropagateError(const Object& obj);
+ // Helpers to create and throw errors.
+ static RawScript* GetCallerScript(DartFrameIterator* iterator);
+ static RawInstance* NewInstance(const char* class_name);
+ static void SetField(const Instance& instance,
+ const Class& cls,
+ const char* field_name,
+ const Object& value);
+ static void SetLocationFields(const Instance& instance,
+ const Class& cls,
+ const Script& script,
+ intptr_t location);
+ static void CreateAndThrowTypeError(intptr_t location,
+ const String& src_type_name,
+ const String& dst_type_name,
+ const String& dst_name,
+ const String& malformed_error);
+
enum ExceptionType {
kIndexOutOfRange,
kIllegalArgument,

Powered by Google App Engine
This is Rietveld 408576698