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

Unified Diff: runtime/lib/error.cc

Issue 8637018: Implement type checking of map literals (issue 221). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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/lib/error.dart » ('j') | runtime/lib/literal_map_factory.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/error.cc
===================================================================
--- runtime/lib/error.cc (revision 1763)
+++ runtime/lib/error.cc (working copy)
@@ -158,6 +158,23 @@
}
+// Allocate and throw a new TypeError.
+// Arg0: index of the token of the failed type check.
+// Arg1: src value.
+// Arg2: dst type name.
+// Arg3: dst name.
+// Return value: none, throws an exception.
+DEFINE_NATIVE_ENTRY(TypeError_throwNew, 4) {
+ intptr_t location = Smi::CheckedHandle(arguments->At(0)).Value();
+ const Instance& src_value = Instance::CheckedHandle(arguments->At(1));
+ const String& dst_type_name = String::CheckedHandle(arguments->At(2));
+ const String& dst_name = String::CheckedHandle(arguments->At(3));
+ const String& src_type_name =
+ String::Handle(Type::Handle(src_value.GetType()).Name());
+ ThrowTypeError(location, src_type_name, dst_type_name, dst_name);
+}
+
+
// Allocate and throw a new FallThroughError.
// Arg0: index of the case clause token into which we fall through.
// Return value: none, throws an exception.
« no previous file with comments | « no previous file | runtime/lib/error.dart » ('j') | runtime/lib/literal_map_factory.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698