| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library testing.abstract_context; | 5 library testing.abstract_context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 AnalysisEngine.instance.logger = PrintLogger.instance; | 161 AnalysisEngine.instance.logger = PrintLogger.instance; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void setupResourceProvider() { | 164 void setupResourceProvider() { |
| 165 provider = new MemoryResourceProvider(); | 165 provider = new MemoryResourceProvider(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void tearDown() { | 168 void tearDown() { |
| 169 _context = null; | 169 _context = null; |
| 170 provider = null; | 170 provider = null; |
| 171 AnalysisEngine.instance.clearCaches(); |
| 171 AnalysisEngine.instance.logger = null; | 172 AnalysisEngine.instance.logger = null; |
| 172 } | 173 } |
| 173 } | 174 } |
| 174 | 175 |
| 175 /** | 176 /** |
| 176 * Instances of the class [PrintLogger] print all of the errors. | 177 * Instances of the class [PrintLogger] print all of the errors. |
| 177 */ | 178 */ |
| 178 class PrintLogger implements Logger { | 179 class PrintLogger implements Logger { |
| 179 static final Logger instance = new PrintLogger(); | 180 static final Logger instance = new PrintLogger(); |
| 180 | 181 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 200 * [engine.GeneralizingElementVisitor]. | 201 * [engine.GeneralizingElementVisitor]. |
| 201 */ | 202 */ |
| 202 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { | 203 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { |
| 203 final _ElementVisitorFunction function; | 204 final _ElementVisitorFunction function; |
| 204 _ElementVisitorFunctionWrapper(this.function); | 205 _ElementVisitorFunctionWrapper(this.function); |
| 205 visitElement(Element element) { | 206 visitElement(Element element) { |
| 206 function(element); | 207 function(element); |
| 207 super.visitElement(element); | 208 super.visitElement(element); |
| 208 } | 209 } |
| 209 } | 210 } |
| OLD | NEW |