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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10918078: Revert r11881. metadata_test fails for yet to be discover reasons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 11888)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -971,7 +971,7 @@
null,
this.statementScope = new StatementScope(),
typeResolver = new TypeResolver(compiler),
- scope = element.buildScope(),
+ scope = element.buildEnclosingScope(),
super(compiler) {
}
@@ -1068,10 +1068,7 @@
}
void setupFunction(FunctionExpression node, FunctionElement function) {
- // If [function] is the [enclosingElement], the [scope] has
- // already been set in the constructor of [ResolverVisitor].
- if (function != enclosingElement) scope = new MethodScope(scope, function);
-
+ scope = new MethodScope(scope, function);
// Put the parameters in scope.
FunctionSignature functionParameters =
function.computeSignature(compiler);
@@ -2563,18 +2560,6 @@
abstract Element lookup(SourceString name);
}
-class VariableScope extends Scope {
- VariableScope(parent, element) : super(parent, element);
-
- Element add(Element newElement) {
- throw "Cannot add element to VariableScope";
- }
-
- Element lookup(SourceString name) => parent.lookup(name);
-
- String toString() => '$element > $parent';
-}
-
/**
* [TypeDeclarationScope] defines the outer scope of a type declaration in
* which the declared type variables and the entities in the enclosing scope are
@@ -2594,6 +2579,13 @@
throw "Cannot add element to TypeDeclarationScope";
}
+ /**
+ * Looks up [name] within the type variables declared in [element].
+ */
+ Element lookupTypeVariable(SourceString name) {
+ return null;
+ }
+
Element lookup(SourceString name) {
Link<DartType> typeVariableLink = element.typeVariables;
while (!typeVariableLink.isEmpty()) {
@@ -2649,8 +2641,6 @@
* scope and inherited members are available, in the given order.
*/
class ClassScope extends TypeDeclarationScope {
- bool inStaticContext = false;
-
ClassScope(Scope parentScope, ClassElement element)
: super(parentScope, element);
@@ -2658,14 +2648,7 @@
ClassElement cls = element;
Element result = cls.lookupLocalMember(name);
if (result !== null) return result;
- if (!inStaticContext) {
- // If not in a static context, we can lookup in the
- // TypeDeclaration scope, which contains the type variables of
- // the class.
- result = super.lookup(name);
- } else {
- result = parent.lookup(name);
- }
+ result = super.lookup(name);
if (result != null) return result;
return cls.lookupSuperMember(name);
}
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698