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

Unified Diff: runtime/vm/parser.cc

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/object_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 25321)
+++ runtime/vm/parser.cc (working copy)
@@ -1603,7 +1603,7 @@
name = String::Concat(name, String::Handle(core_lib.private_key()));
name = Symbols::New(name);
}
- return core_lib.LookupClass(name);
+ return core_lib.LookupClass(name, NULL); // No ambiguity error expected.
}
@@ -2850,8 +2850,7 @@
ErrorMsg(method->name_pos, "constructor cannot be abstract");
}
if (method->has_const && method->IsConstructor()) {
- Class& cls = Class::Handle(library_.LookupClass(members->class_name()));
- cls.set_is_const();
+ current_class().set_is_const();
}
// Parse the formal parameters.
@@ -8618,16 +8617,16 @@
static RawObject* LookupNameInImport(Isolate* isolate,
const Namespace& ns,
const String& name) {
+ // If the given name is filtered out by the import, don't look it up, nor its
+ // getter and setter names.
+ if (ns.HidesName(name)) {
+ return Object::null();
+ }
Object& obj = Object::Handle(isolate);
obj = ns.Lookup(name);
if (!obj.IsNull()) {
return obj.raw();
}
- // If the given name is filtered out by the import, don't look up the
- // getter and setter names.
- if (ns.HidesName(name)) {
- return Object::null();
- }
String& accessor_name = String::Handle(isolate, Field::GetterName(name));
obj = ns.Lookup(accessor_name);
if (!obj.IsNull()) {
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698