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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.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
Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
index 2a0145c0ee168eb43bed1d5f0315b5ef1a840350..ad69914c801ec5dbf5a5df6836e744ac43c68996 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java
@@ -16,6 +16,7 @@ import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.DartTypeParameter;
import com.google.dart.compiler.ast.DartUnit;
+import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.ast.Modifiers;
import com.google.dart.compiler.parser.DartParser;
import com.google.dart.compiler.parser.DartScannerParserContext;
@@ -59,17 +60,23 @@ abstract class ResolverTestCase extends TestCase {
}
static Scope resolve(DartUnit unit, TestCompilerContext context) {
- Scope scope = new Scope("library", null);
+ LibraryUnit libraryUnit = MockLibraryUnit.create(unit);
+ // Prepare for running phases.
+ Scope scope = new Scope("library", libraryUnit.getElement());
CoreTypeProvider typeProvider = setupTypeProvider(unit, context, scope);
+ // Run phases as in compiler.
new SupertypeResolver().exec(unit, context, scope, typeProvider);
new MemberBuilder().exec(unit, context, scope, typeProvider);
new Resolver(context, scope, typeProvider).exec(unit);
return scope;
}
- static Scope resolveCompileTimeConst (DartUnit unit, TestCompilerContext context) {
- Scope scope = new Scope("library", null);
+ static Scope resolveCompileTimeConst(DartUnit unit, TestCompilerContext context) {
+ LibraryUnit libraryUnit = MockLibraryUnit.create(unit);
+ // Prepare for running phases.
+ Scope scope = new Scope("library", libraryUnit.getElement());
CoreTypeProvider typeProvider = setupTypeProvider(unit, context, scope);
+ // Run phases as in compiler.
new SupertypeResolver().exec(unit, context, scope, typeProvider);
new MemberBuilder().exec(unit, context, scope, typeProvider);
// Substitute the lightweight CTConst resolver

Powered by Google App Engine
This is Rietveld 408576698