Index: pkg/analyzer/test/src/context/context_test.dart |
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart |
index b9d77b17075cc9e10ed1b9f9d713737fdcc09051..1847dec00215438f58eba39de4d3f553f5cd16ea 100644 |
--- a/pkg/analyzer/test/src/context/context_test.dart |
+++ b/pkg/analyzer/test/src/context/context_test.dart |
@@ -8,6 +8,7 @@ import 'dart:async'; |
import 'dart:collection'; |
import 'package:analyzer/dart/ast/ast.dart'; |
+import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/dart/element/type.dart'; |
import 'package:analyzer/dart/element/visitor.dart'; |
@@ -2620,7 +2621,8 @@ void functionWithClosureAsDefaultParam([x = () => null]) {} |
CompilationUnit compilationUnit = |
context.resolveCompilationUnit2(sourceA, sourceA); |
expect(compilationUnit, isNotNull); |
- LibraryElement library = compilationUnit.element.library; |
+ LibraryElement library = |
+ resolutionMap.elementForCompilationUnit(compilationUnit).library; |
List<LibraryElement> importedLibraries = library.importedLibraries; |
assertNamedElements(importedLibraries, ["dart.core", "libB"]); |
} |
@@ -2632,7 +2634,8 @@ void functionWithClosureAsDefaultParam([x = () => null]) {} |
CompilationUnit compilationUnit = |
context.resolveCompilationUnit2(sourceA, sourceA); |
expect(compilationUnit, isNotNull); |
- LibraryElement library = compilationUnit.element.library; |
+ LibraryElement library = |
+ resolutionMap.elementForCompilationUnit(compilationUnit).library; |
List<LibraryElement> importedLibraries = library.importedLibraries; |
assertNamedElements(importedLibraries, ["dart.core", "libB"]); |
} |
@@ -4499,7 +4502,7 @@ main() { |
expect(context.getErrors(a).errors, hasLength(0)); |
expect(context.getErrors(b).errors, hasLength(0)); |
var unitA = context.getResolvedCompilationUnit2(a, a); |
- var unitElementA = unitA.element; |
+ var unitElementA = resolutionMap.elementForCompilationUnit(unitA); |
var libraryElementA = unitElementA.library; |
// Update a.dart, no declaration changes. |
context.setContents( |