| 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 analyzer.test.generated.compile_time_error_code_test; | 5 library analyzer.test.generated.compile_time_error_code_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/src/error/codes.dart'; | 10 import 'package:analyzer/src/error/codes.dart'; |
| (...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, | 2419 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, |
| 2420 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, | 2420 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, |
| 2421 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE | 2421 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE |
| 2422 ]); | 2422 ]); |
| 2423 verify([source]); | 2423 verify([source]); |
| 2424 } | 2424 } |
| 2425 | 2425 |
| 2426 test_fromEnvironment_bool_badDefault_whenDefined() async { | 2426 test_fromEnvironment_bool_badDefault_whenDefined() async { |
| 2427 // The type of the defaultValue needs to be correct even when the default | 2427 // The type of the defaultValue needs to be correct even when the default |
| 2428 // value isn't used (because the variable is defined in the environment). | 2428 // value isn't used (because the variable is defined in the environment). |
| 2429 analysisContext2.declaredVariables.define("x", "true"); | 2429 if (enableNewAnalysisDriver) { |
| 2430 driver.declaredVariables.define("x", "true"); |
| 2431 } else { |
| 2432 analysisContext2.declaredVariables.define("x", "true"); |
| 2433 } |
| 2430 Source source = | 2434 Source source = |
| 2431 addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);"); | 2435 addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);"); |
| 2432 await computeAnalysisResult(source); | 2436 await computeAnalysisResult(source); |
| 2433 assertErrors(source, [ | 2437 assertErrors(source, [ |
| 2434 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, | 2438 CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, |
| 2435 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE | 2439 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE |
| 2436 ]); | 2440 ]); |
| 2437 verify([source]); | 2441 verify([source]); |
| 2438 } | 2442 } |
| 2439 | 2443 |
| (...skipping 4009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6449 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6453 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6450 verify([source]); | 6454 verify([source]); |
| 6451 reset(); | 6455 reset(); |
| 6452 } | 6456 } |
| 6453 | 6457 |
| 6454 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { | 6458 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { |
| 6455 await _check_wrongNumberOfParametersForOperator(name, ""); | 6459 await _check_wrongNumberOfParametersForOperator(name, ""); |
| 6456 await _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6460 await _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6457 } | 6461 } |
| 6458 } | 6462 } |
| OLD | NEW |