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

Unified Diff: runtime/vm/parser.cc

Issue 1092053003: Don’t search scope of top-level class twice (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | 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 45241)
+++ runtime/vm/parser.cc (working copy)
@@ -11626,6 +11626,16 @@
return true;
}
+ // If we are compiling top-level code, we don't need to look for
+ // the identifier in the current (top-level) class. The class scope
+ // of the top-level class is part of the library scope.
+ if (current_class().IsTopLevel()) {
+ if (node != NULL) {
+ *node = NULL;
+ }
+ return false;
+ }
+
// Try to find the identifier in the class scope of the current class.
// If the current class is the result of a mixin application, we must
// use the class scope of the class from which the function originates.
@@ -11714,7 +11724,7 @@
if (node != NULL) {
*node = NULL;
}
- return false; // Not an unqualified identifier.
+ return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698