| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.base.Joiner; | 7 import com.google.common.base.Joiner; |
| 8 import com.google.common.base.Splitter; | 8 import com.google.common.base.Splitter; |
| 9 import com.google.common.collect.Lists; | 9 import com.google.common.collect.Lists; |
| 10 import com.google.dart.compiler.DartCompilationError; | 10 import com.google.dart.compiler.DartCompilationError; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 resetParseErrors(); | 49 resetParseErrors(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 @Override | 52 @Override |
| 53 public void tearDown() { | 53 public void tearDown() { |
| 54 resetParseErrors(); | 54 resetParseErrors(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 private static CoreTypeProvider setupTypeProvider(DartUnit unit, TestCompilerC
ontext context, Scope scope) { | 57 private static CoreTypeProvider setupTypeProvider(DartUnit unit, TestCompilerC
ontext context, Scope scope) { |
| 58 new TopLevelElementBuilder().exec(unit.getLibrary(), unit, context); | 58 new TopLevelElementBuilder().exec(unit.getLibrary(), unit, context); |
| 59 new TopLevelElementBuilder().fillInUnitScope(unit, context, scope); | 59 new TopLevelElementBuilder().fillInUnitScope(unit, context, scope, true); |
| 60 ClassElement object = (ClassElement) scope.findElement(null, "Object"); | 60 ClassElement object = (ClassElement) scope.findElement(null, "Object"); |
| 61 assertNotNull("Cannot resolve Object", object); | 61 assertNotNull("Cannot resolve Object", object); |
| 62 return new MockCoreTypeProvider(object); | 62 return new MockCoreTypeProvider(object); |
| 63 } | 63 } |
| 64 | 64 |
| 65 static Scope resolve(DartUnit unit, TestCompilerContext context) { | 65 static Scope resolve(DartUnit unit, TestCompilerContext context) { |
| 66 LibraryUnit libraryUnit = MockLibraryUnit.create(unit); | 66 LibraryUnit libraryUnit = MockLibraryUnit.create(unit); |
| 67 | 67 |
| 68 // Prepare for running phases. | 68 // Prepare for running phases. |
| 69 Scope scope = libraryUnit.getElement().getScope(); | 69 Scope scope = libraryUnit.getElement().getScope(); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 public void onError(DartCompilationError event) { | 545 public void onError(DartCompilationError event) { |
| 546 resolveErrors.add(event); | 546 resolveErrors.add(event); |
| 547 } | 547 } |
| 548 }; | 548 }; |
| 549 // resolve and check errors | 549 // resolve and check errors |
| 550 resolveCompileTimeConst(unit, ctx); | 550 resolveCompileTimeConst(unit, ctx); |
| 551 ErrorExpectation.assertErrors(resolveErrors, expectedErrors); | 551 ErrorExpectation.assertErrors(resolveErrors, expectedErrors); |
| 552 return resolveErrors; | 552 return resolveErrors; |
| 553 } | 553 } |
| 554 } | 554 } |
| OLD | NEW |