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

Unified Diff: runtime/vm/object.cc

Issue 10823396: Implement import scope (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 10922)
+++ runtime/vm/object.cc (working copy)
@@ -5617,7 +5617,7 @@
obj.IsFunction() ||
obj.IsField() ||
obj.IsLibraryPrefix());
- ASSERT((LookupObject(name) == Object::null()) ||
+ ASSERT((LookupLocalObject(name) == Object::null()) ||
((obj.IsLibraryPrefix() ||
(obj.IsClass() &&
Class::CheckedHandle(obj.raw()).IsCanonicalSignatureClass())) &&
@@ -5661,29 +5661,18 @@
*index = name.Hash() % dict_size;
Object& entry = Object::Handle(isolate);
- Class& cls = Class::Handle(isolate);
- Function& func = Function::Handle(isolate);
- Field& field = Field::Handle(isolate);
- LibraryPrefix& library_prefix = LibraryPrefix::Handle(isolate);
String& entry_name = String::Handle(isolate);
entry = dict.At(*index);
// Search the entry in the hash set.
while (!entry.IsNull()) {
- // TODO(hausner): find a better way to handle this polymorphism.
- // Either introduce a common base class for Class, Function, Field
- // and LibraryPrefix or make the name() function virtual in Object.
if (entry.IsClass()) {
- cls ^= entry.raw();
- entry_name = cls.Name();
+ entry_name = Class::Cast(entry).Name();
} else if (entry.IsFunction()) {
- func ^= entry.raw();
- entry_name = func.name();
+ entry_name = Function::Cast(entry).name();
} else if (entry.IsField()) {
- field ^= entry.raw();
- entry_name = field.name();
+ entry_name = Field::Cast(entry).name();
} else if (entry.IsLibraryPrefix()) {
- library_prefix ^= entry.raw();
- entry_name = library_prefix.name();
+ entry_name = LibraryPrefix::Cast(entry).name();
} else {
UNREACHABLE();
}
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698