| 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.incremental_resolver_test; | 5 library analyzer.test.generated.incremental_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/dart/ast/utilities.dart'; | 10 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| (...skipping 3898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3909 const C(this.x); | 3909 const C(this.x); |
| 3910 const C.foo() : x = 1; | 3910 const C.foo() : x = 1; |
| 3911 } | 3911 } |
| 3912 main() { | 3912 main() { |
| 3913 const {const C(0): 0, const C.foo(): 1}; | 3913 const {const C(0): 0, const C.foo(): 1}; |
| 3914 } | 3914 } |
| 3915 ''', | 3915 ''', |
| 3916 expectedSuccess: false); | 3916 expectedSuccess: false); |
| 3917 } | 3917 } |
| 3918 | 3918 |
| 3919 void test_false_constructor_initializer() { | 3919 void test_false_constructor_initializer_damage() { |
| 3920 _resolveUnit(r''' | 3920 _resolveUnit(r''' |
| 3921 class Problem { | 3921 class Problem { |
| 3922 final Map location; | 3922 final Map location; |
| 3923 final String message; | 3923 final String message; |
| 3924 | 3924 |
| 3925 Problem(Map json) | 3925 Problem(Map json) |
| 3926 : location = json["location"], | 3926 : location = json["location"], |
| 3927 message = json["message"]; | 3927 message = json["message"]; |
| 3928 }'''); | 3928 }'''); |
| 3929 _updateAndValidate( | 3929 _updateAndValidate( |
| 3930 r''' | 3930 r''' |
| 3931 class Problem { | 3931 class Problem { |
| 3932 final Map location; | 3932 final Map location; |
| 3933 final String message; | 3933 final String message; |
| 3934 | 3934 |
| 3935 Problem(Map json) | 3935 Problem(Map json) |
| 3936 : location = json["location], | 3936 : location = json["location], |
| 3937 message = json["message"]; | 3937 message = json["message"]; |
| 3938 }''', | 3938 }''', |
| 3939 expectedSuccess: false); | 3939 expectedSuccess: false); |
| 3940 } | 3940 } |
| 3941 | 3941 |
| 3942 void test_false_constructor_initializer_remove() { |
| 3943 _resolveUnit(r''' |
| 3944 class Problem { |
| 3945 final String severity; |
| 3946 final Map location; |
| 3947 final String message; |
| 3948 |
| 3949 Problem(Map json) |
| 3950 : severity = json["severity"], |
| 3951 location = json["location"], |
| 3952 message = json["message"]; |
| 3953 }'''); |
| 3954 _updateAndValidate( |
| 3955 r''' |
| 3956 class Problem { |
| 3957 final String severity; |
| 3958 final Map location; |
| 3959 final String message; |
| 3960 |
| 3961 Problem(Map json) |
| 3962 : severity = json["severity"], |
| 3963 message = json["message"]; |
| 3964 }''', |
| 3965 expectedSuccess: false); |
| 3966 } |
| 3967 |
| 3942 void test_false_endOfLineComment_localFunction_inTopLevelVariable() { | 3968 void test_false_endOfLineComment_localFunction_inTopLevelVariable() { |
| 3943 _resolveUnit(r''' | 3969 _resolveUnit(r''' |
| 3944 typedef int Binary(one, two, three); | 3970 typedef int Binary(one, two, three); |
| 3945 | 3971 |
| 3946 int Global = f((a, b, c) { | 3972 int Global = f((a, b, c) { |
| 3947 return 0; // Some comment | 3973 return 0; // Some comment |
| 3948 }); | 3974 }); |
| 3949 '''); | 3975 '''); |
| 3950 _updateAndValidate( | 3976 _updateAndValidate( |
| 3951 r''' | 3977 r''' |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5102 @override | 5128 @override |
| 5103 void logException(Object exception, [Object stackTrace]) { | 5129 void logException(Object exception, [Object stackTrace]) { |
| 5104 hasError = true; | 5130 hasError = true; |
| 5105 } | 5131 } |
| 5106 | 5132 |
| 5107 @override | 5133 @override |
| 5108 logging.LoggingTimer startTimer() { | 5134 logging.LoggingTimer startTimer() { |
| 5109 return new logging.LoggingTimer(this); | 5135 return new logging.LoggingTimer(this); |
| 5110 } | 5136 } |
| 5111 } | 5137 } |
| OLD | NEW |