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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 11299020: Make creation of list literal more resilient to changes in the underlying (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 14985)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -1760,10 +1760,12 @@
static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) {
if (obj.IsInstance()) {
const Instance& instance = Instance::Cast(obj);
- const Type& type =
- Type::Handle(isolate, isolate->object_store()->list_interface());
+ const Class& obj_class = Class::Handle(isolate, obj.clazz());
+ const Class& list_class =
+ Class::Handle(isolate, isolate->object_store()->list_class());
Error& malformed_type_error = Error::Handle(isolate);
- if (instance.IsInstanceOf(type,
+ if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate),
+ list_class,
TypeArguments::Handle(isolate),
&malformed_type_error)) {
ASSERT(malformed_type_error.IsNull()); // Type is a raw List.

Powered by Google App Engine
This is Rietveld 408576698