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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 14820028: Delay Class parsing until the class is actually used. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 22914)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -3051,6 +3051,10 @@
if (obj.IsClass()) {
const Class& cls = Class::Cast(obj);
+ const Error& error = Error::Handle(isolate, cls.EnsureIsParsed(isolate));
+ if (!error.IsNull()) {
+ return Api::NewHandle(isolate, error.raw());
+ }
const Array& func_array = Array::Handle(cls.functions());
// Some special types like 'dynamic' have a null functions list.
@@ -3391,6 +3395,10 @@
if (obj.IsClass()) {
const Class& cls = Class::Cast(obj);
+ const Error& error = Error::Handle(isolate, cls.EnsureIsParsed(isolate));
+ if (!error.IsNull()) {
+ return Api::NewHandle(isolate, error.raw());
+ }
const Array& field_array = Array::Handle(cls.fields());
// Some special types like 'dynamic' have a null fields list.

Powered by Google App Engine
This is Rietveld 408576698