| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 /** | 355 /** |
| 356 * Instances of the class `AnalysisContextForTests` implement an analysis contex
t that has a | 356 * Instances of the class `AnalysisContextForTests` implement an analysis contex
t that has a |
| 357 * fake SDK that is much smaller and faster for testing purposes. | 357 * fake SDK that is much smaller and faster for testing purposes. |
| 358 */ | 358 */ |
| 359 class AnalysisContextForTests extends AnalysisContextImpl { | 359 class AnalysisContextForTests extends AnalysisContextImpl { |
| 360 @override | 360 @override |
| 361 void set analysisOptions(AnalysisOptions options) { | 361 void set analysisOptions(AnalysisOptions options) { |
| 362 AnalysisOptions currentOptions = analysisOptions; | 362 AnalysisOptions currentOptions = analysisOptions; |
| 363 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate != | 363 bool needsRecompute = currentOptions.analyzeFunctionBodiesPredicate != |
| 364 options.analyzeFunctionBodiesPredicate || | 364 options.analyzeFunctionBodiesPredicate || |
| 365 currentOptions.generateImplicitErrors != |
| 366 options.generateImplicitErrors || |
| 365 currentOptions.generateSdkErrors != options.generateSdkErrors || | 367 currentOptions.generateSdkErrors != options.generateSdkErrors || |
| 366 currentOptions.dart2jsHint != options.dart2jsHint || | 368 currentOptions.dart2jsHint != options.dart2jsHint || |
| 367 (currentOptions.hint && !options.hint) || | 369 (currentOptions.hint && !options.hint) || |
| 368 currentOptions.preserveComments != options.preserveComments; | 370 currentOptions.preserveComments != options.preserveComments; |
| 369 if (needsRecompute) { | 371 if (needsRecompute) { |
| 370 fail( | 372 fail( |
| 371 "Cannot set options that cause the sources to be reanalyzed in a test
context"); | 373 "Cannot set options that cause the sources to be reanalyzed in a test
context"); |
| 372 } | 374 } |
| 373 super.analysisOptions = options; | 375 super.analysisOptions = options; |
| 374 } | 376 } |
| (...skipping 13087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13462 // check propagated type | 13464 // check propagated type |
| 13463 FunctionType propagatedType = node.propagatedType as FunctionType; | 13465 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13464 expect(propagatedType.returnType, test.typeProvider.stringType); | 13466 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13465 } on AnalysisException catch (e, stackTrace) { | 13467 } on AnalysisException catch (e, stackTrace) { |
| 13466 thrownException[0] = new CaughtException(e, stackTrace); | 13468 thrownException[0] = new CaughtException(e, stackTrace); |
| 13467 } | 13469 } |
| 13468 } | 13470 } |
| 13469 return null; | 13471 return null; |
| 13470 } | 13472 } |
| 13471 } | 13473 } |
| OLD | NEW |