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

Unified Diff: runtime/vm/parser.cc

Issue 10868043: Move print to corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make it pass all tests. 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index fd4456805c347d005e4f3deae981a7dfa92b5a14..ff809442f3d96253d1a2377e565349dd6e756651 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -7702,6 +7702,7 @@ RawObject* Parser::ResolveNameInCurrentLibraryScope(intptr_t ident_pos,
// Name is not found in current library. Check scope of all
// imported libraries.
String& first_lib_url = String::Handle();
+ String& current_lib_url = String::Handle();
Library& lib = Library::Handle();
intptr_t num_imports = library_.num_imports();
Object& resolved_obj = Object::Handle();
@@ -7709,7 +7710,11 @@ RawObject* Parser::ResolveNameInCurrentLibraryScope(intptr_t ident_pos,
lib ^= library_.ImportAt(i);
resolved_obj = LookupNameInLibrary(lib, name);
if (!resolved_obj.IsNull()) {
- if (!first_lib_url.IsNull()) {
+ current_lib_url = lib.url();
+ if (first_lib_url.IsNull()) {
+ first_lib_url = lib.url();
+ obj = resolved_obj.raw();
+ } else if (!first_lib_url.Equals(current_lib_url)) {
// Found duplicate definition.
ErrorMsg(ident_pos,
"ambiguous reference: "
@@ -7717,9 +7722,6 @@ RawObject* Parser::ResolveNameInCurrentLibraryScope(intptr_t ident_pos,
name.ToCString(),
first_lib_url.ToCString(),
String::Handle(lib.url()).ToCString());
- } else {
- first_lib_url = lib.url();
- obj = resolved_obj.raw();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698