| 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 engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 /** | 375 /** |
| 376 * Instances of the class `AnalysisContextForTests` implement an analysis contex
t that has a | 376 * Instances of the class `AnalysisContextForTests` implement an analysis contex
t that has a |
| 377 * fake SDK that is much smaller and faster for testing purposes. | 377 * fake SDK that is much smaller and faster for testing purposes. |
| 378 */ | 378 */ |
| 379 class AnalysisContextForTests extends AnalysisContextImpl { | 379 class AnalysisContextForTests extends AnalysisContextImpl { |
| 380 @override | 380 @override |
| 381 void set analysisOptions(AnalysisOptions options) { | 381 void set analysisOptions(AnalysisOptions options) { |
| 382 AnalysisOptions currentOptions = analysisOptions; | 382 AnalysisOptions currentOptions = analysisOptions; |
| 383 bool needsRecompute = | 383 bool needsRecompute = |
| 384 currentOptions.analyzeFunctionBodies != options.analyzeFunctionBodies || | 384 currentOptions.analyzeFunctionBodiesPredicate != |
| 385 options.analyzeFunctionBodiesPredicate || |
| 385 currentOptions.generateSdkErrors != options.generateSdkErrors || | 386 currentOptions.generateSdkErrors != options.generateSdkErrors || |
| 386 currentOptions.dart2jsHint != options.dart2jsHint || | 387 currentOptions.dart2jsHint != options.dart2jsHint || |
| 387 (currentOptions.hint && !options.hint) || | 388 (currentOptions.hint && !options.hint) || |
| 388 currentOptions.preserveComments != options.preserveComments; | 389 currentOptions.preserveComments != options.preserveComments; |
| 389 if (needsRecompute) { | 390 if (needsRecompute) { |
| 390 fail( | 391 fail( |
| 391 "Cannot set options that cause the sources to be reanalyzed in a test
context"); | 392 "Cannot set options that cause the sources to be reanalyzed in a test
context"); |
| 392 } | 393 } |
| 393 super.analysisOptions = options; | 394 super.analysisOptions = options; |
| 394 } | 395 } |
| (...skipping 13392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13787 // check propagated type | 13788 // check propagated type |
| 13788 FunctionType propagatedType = node.propagatedType as FunctionType; | 13789 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13789 expect(propagatedType.returnType, test.typeProvider.stringType); | 13790 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13790 } on AnalysisException catch (e, stackTrace) { | 13791 } on AnalysisException catch (e, stackTrace) { |
| 13791 thrownException[0] = new CaughtException(e, stackTrace); | 13792 thrownException[0] = new CaughtException(e, stackTrace); |
| 13792 } | 13793 } |
| 13793 } | 13794 } |
| 13794 return null; | 13795 return null; |
| 13795 } | 13796 } |
| 13796 } | 13797 } |
| OLD | NEW |