| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; | 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The messages in this file should meet the following guide lines: | 10 * The messages in this file should meet the following guide lines: |
| (...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 } | 2137 } |
| 2138 main() => new A();""", | 2138 main() => new A();""", |
| 2139 | 2139 |
| 2140 """ | 2140 """ |
| 2141 class A { | 2141 class A { |
| 2142 A(); | 2142 A(); |
| 2143 factory A.a() async* => new A(); | 2143 factory A.a() async* => new A(); |
| 2144 } | 2144 } |
| 2145 main() => new A.a();"""]); | 2145 main() => new A.a();"""]); |
| 2146 | 2146 |
| 2147 static const MessageKind ASYNC_MODIFIER_ON_SETTER = |
| 2148 const MessageKind( |
| 2149 "The modifier '#{modifier}' is not allowed on setters.", |
| 2150 options: const ['--enable-async'], |
| 2151 howToFix: "Try removing the '#{modifier}' modifier.", |
| 2152 examples: const [""" |
| 2153 class A { |
| 2154 set foo(v) async {} |
| 2155 } |
| 2156 main() => new A().foo = 0;"""]); |
| 2157 |
| 2147 static const MessageKind YIELDING_MODIFIER_ON_ARROW_BODY = | 2158 static const MessageKind YIELDING_MODIFIER_ON_ARROW_BODY = |
| 2148 const MessageKind( | 2159 const MessageKind( |
| 2149 "The modifier '#{modifier}' is not allowed on methods implemented " | 2160 "The modifier '#{modifier}' is not allowed on methods implemented " |
| 2150 "using '=>'.", | 2161 "using '=>'.", |
| 2151 options: const ['--enable-async'], | 2162 options: const ['--enable-async'], |
| 2152 howToFix: "Try removing the '#{modifier}' modifier or implementing " | 2163 howToFix: "Try removing the '#{modifier}' modifier or implementing " |
| 2153 "the method body using a block: '{ ... }'.", | 2164 "the method body using a block: '{ ... }'.", |
| 2154 examples: const ["main() sync* => null;", "main() async* => null;"]); | 2165 examples: const ["main() sync* => null;", "main() async* => null;"]); |
| 2155 | 2166 |
| 2156 // TODO(johnniwinther): Check for 'async' as identifier. | 2167 // TODO(johnniwinther): Check for 'async' as identifier. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 static String convertToString(value) { | 2450 static String convertToString(value) { |
| 2440 if (value is ErrorToken) { | 2451 if (value is ErrorToken) { |
| 2441 // Shouldn't happen. | 2452 // Shouldn't happen. |
| 2442 return value.assertionMessage; | 2453 return value.assertionMessage; |
| 2443 } else if (value is Token) { | 2454 } else if (value is Token) { |
| 2444 value = value.value; | 2455 value = value.value; |
| 2445 } | 2456 } |
| 2446 return '$value'; | 2457 return '$value'; |
| 2447 } | 2458 } |
| 2448 } | 2459 } |
| OLD | NEW |