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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2551023005: Prepare for decoupling analyzer ASTs from element model. (Closed)
Patch Set: Address review comments Created 4 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: 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(

Powered by Google App Engine
This is Rietveld 408576698