| 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
|
|
|