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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java

Issue 8867001: Check for using 'this' and 'super'. Tests. Issue 662. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for using this/super in field. Tweaks for comments. Created 9 years 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 | « compiler/javatests/com/google/dart/compiler/resolver/StaticToInstanceInvocationNegativeTest2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
index 94f98c830da622f33b95417a9d5a1486e41d65ae..8b7c4c7e43c6527e93315b0c92f043a1d1055894 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java
@@ -15,6 +15,7 @@ import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartStatement;
import com.google.dart.compiler.ast.DartUnit;
+import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.parser.DartParser;
import com.google.dart.compiler.parser.DartScannerParserContext;
import com.google.dart.compiler.resolver.ClassElement;
@@ -23,6 +24,7 @@ import com.google.dart.compiler.resolver.Element;
import com.google.dart.compiler.resolver.Elements;
import com.google.dart.compiler.resolver.FunctionAliasElement;
import com.google.dart.compiler.resolver.MemberBuilder;
+import com.google.dart.compiler.resolver.MockLibraryUnit;
import com.google.dart.compiler.resolver.ResolutionContext;
import com.google.dart.compiler.resolver.Resolver;
import com.google.dart.compiler.resolver.Resolver.ResolveElementsVisitor;
@@ -259,7 +261,8 @@ public abstract class TypeAnalyzerTestCase extends TypeTestCase {
}
private Scope getMockScope(String name) {
- return new Scope(name, null, new MockScope());
+ LibraryUnit libraryUnit = MockLibraryUnit.create();
+ return new Scope(name, libraryUnit.getElement(), new MockScope());
}
private DartParser getParser(String string) {
@@ -316,6 +319,7 @@ public abstract class TypeAnalyzerTestCase extends TypeTestCase {
}
}
Scope scope = getMockScope("<test toplevel>");
+ unit.setLibrary(scope.getLibrary().getLibraryUnit());
SupertypeResolver supertypeResolver = new SupertypeResolver();
supertypeResolver.exec(unit, context, scope, typeProvider);
MemberBuilder memberBuilder = new MemberBuilder();
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/resolver/StaticToInstanceInvocationNegativeTest2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698