| Index: runtime/vm/parser.cc
|
| ===================================================================
|
| --- runtime/vm/parser.cc (revision 1336)
|
| +++ runtime/vm/parser.cc (working copy)
|
| @@ -174,6 +174,8 @@
|
| current_class_(Class::Handle()),
|
| library_(library),
|
| try_blocks_list_(NULL) {
|
| + ASSERT(!tokens_.IsNull());
|
| + ASSERT(!library.IsNull());
|
| SetPosition(0);
|
| }
|
|
|
| @@ -192,6 +194,8 @@
|
| current_class_(Class::Handle(current_function_.owner())),
|
| library_(Library::Handle(current_class_.library())),
|
| try_blocks_list_(NULL) {
|
| + ASSERT(!tokens_.IsNull());
|
| + ASSERT(!function.IsNull());
|
| SetPosition(token_index);
|
| }
|
|
|
| @@ -2612,7 +2616,8 @@
|
| // Allocate an interface to hold the type parameters and their 'extends'
|
| // constraints. Make it the owner of the function type descriptor.
|
| const Class& alias_owner = Class::Handle(
|
| - Class::New(String::Handle(String::NewSymbol("")), Script::Handle()));
|
| + Class::New(String::Handle(String::NewSymbol(":alias_owner")),
|
| + Script::Handle()));
|
| alias_owner.set_is_interface();
|
| set_current_class(alias_owner);
|
| ParseTypeParameters(alias_owner);
|
| @@ -3207,9 +3212,15 @@
|
| is_top_level_ = true;
|
| TopLevel top_level;
|
| Class& toplevel_class = Class::ZoneHandle(
|
| - Class::New(String::ZoneHandle(String::NewSymbol("")), script_));
|
| + Class::New(String::ZoneHandle(String::NewSymbol("::")), script_));
|
| toplevel_class.set_library(library_);
|
|
|
| + // TODO(regis): We need a better interface to the class finalizer.
|
| + // We notify the class finalizer to expect pending classes.
|
| + // This allows signature classes generated at runtime to be properly
|
| + // finalized, without finalizing them prematurely at compile time.
|
| + ClassFinalizer::ExpectPendingClasses();
|
| +
|
| if (is_library_source()) {
|
| ParseLibraryDefinition();
|
| }
|
| @@ -3679,8 +3690,8 @@
|
| if (!errmsg.IsNull()) {
|
| ErrorMsg(errmsg.ToCString());
|
| }
|
| - // The call to ClassFinalizer::FinalizeTypeWhileParsing may have extended
|
| - // the vector of type arguments.
|
| + // The call to ClassFinalizer::FinalizeAndCanonicalizeType may have
|
| + // extended the vector of type arguments.
|
| ASSERT(signature_type_arguments.IsNull() ||
|
| (signature_type_arguments.Length() ==
|
| signature_class.NumTypeArguments()));
|
|
|