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

Unified Diff: runtime/vm/dart_api_impl.cc

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/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 5060)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -946,7 +946,10 @@
return Api::NewError(msg);
}
const Type& type = Type::Handle(Type::NewNonParameterizedType(cls));
- *value = instance.IsInstanceOf(type, TypeArguments::Handle());
+ Error& malformed_type_error = Error::Handle();
+ *value = instance.IsInstanceOf(
+ type, TypeArguments::Handle(), &malformed_type_error);
+ ASSERT(malformed_type_error.IsNull()); // Type was created here from a class.
return Api::Success();
}
@@ -1420,7 +1423,11 @@
Instance& instance = Instance::Handle();
instance ^= obj.raw();
const Type& type = Type::Handle(isolate->object_store()->list_interface());
- if (instance.IsInstanceOf(type, TypeArguments::Handle())) {
+ Error& malformed_type_error = Error::Handle();
+ if (instance.IsInstanceOf(type,
+ TypeArguments::Handle(),
+ &malformed_type_error)) {
+ ASSERT(malformed_type_error.IsNull()); // Type is a raw List.
return instance.raw();
}
}

Powered by Google App Engine
This is Rietveld 408576698