OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // The messages in this file should meet the following guide lines: | 5 // The messages in this file should meet the following guide lines: |
6 // | 6 // |
7 // 1. The message should be a complete sentence starting with an uppercase | 7 // 1. The message should be a complete sentence starting with an uppercase |
8 // letter, and ending with a period. | 8 // letter, and ending with a period. |
9 // | 9 // |
10 // 2. Reserved words and embedded identifiers should be in single quotes, so | 10 // 2. Reserved words and embedded identifiers should be in single quotes, so |
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 'PREAMBLE': { | 3178 'PREAMBLE': { |
3179 'id': 'GXGWIF', | 3179 'id': 'GXGWIF', |
3180 'template': "When run on the command-line, the compiled output might" | 3180 'template': "When run on the command-line, the compiled output might" |
3181 " require a preamble file located in:\n" | 3181 " require a preamble file located in:\n" |
3182 " <sdk>/lib/_internal/js_runtime/lib/preambles.", | 3182 " <sdk>/lib/_internal/js_runtime/lib/preambles.", |
3183 }, | 3183 }, |
3184 | 3184 |
3185 'INVALID_SYNC_MODIFIER': { | 3185 'INVALID_SYNC_MODIFIER': { |
3186 'id': 'FNYUYU', | 3186 'id': 'FNYUYU', |
3187 'template': "Invalid modifier 'sync'.", | 3187 'template': "Invalid modifier 'sync'.", |
3188 'options': ['--enable-async'], | |
3189 'howToFix': "Try replacing 'sync' with 'sync*'.", | 3188 'howToFix': "Try replacing 'sync' with 'sync*'.", |
3190 'examples': ["main() sync {}"], | 3189 'examples': ["main() sync {}"], |
3191 }, | 3190 }, |
3192 | 3191 |
3193 'INVALID_AWAIT_FOR': { | 3192 'INVALID_AWAIT_FOR': { |
3194 'id': 'IEYGCY', | 3193 'id': 'IEYGCY', |
3195 'template': "'await' is only supported on for-in loops.", | 3194 'template': "'await' is only supported on for-in loops.", |
3196 'options': ['--enable-async'], | |
3197 'howToFix': "Try rewriting the loop as a for-in loop or removing the " | 3195 'howToFix': "Try rewriting the loop as a for-in loop or removing the " |
3198 "'await' keyword.", | 3196 "'await' keyword.", |
3199 'examples': [ | 3197 'examples': [ |
3200 """ | 3198 """ |
3201 main() async* { | 3199 main() async* { |
3202 await for (int i = 0; i < 10; i++) {} | 3200 await for (int i = 0; i < 10; i++) {} |
3203 } | 3201 } |
3204 """ | 3202 """ |
3205 ], | 3203 ], |
3206 }, | 3204 }, |
3207 | 3205 |
| 3206 'INVALID_AWAIT_FOR_IN': { |
| 3207 'id': 'FIEYGC', |
| 3208 'template': "'await' is only supported in methods with an 'async' or " |
| 3209 "'async*' body modifier.", |
| 3210 'howToFix': "Try adding 'async' or 'async*' to the method body or " |
| 3211 "removing the 'await' keyword.", |
| 3212 'examples': [ |
| 3213 """ |
| 3214 main(o) sync* { |
| 3215 await for (var e in o) {} |
| 3216 } |
| 3217 """ |
| 3218 ], |
| 3219 }, |
| 3220 |
| 3221 'INVALID_AWAIT': { |
| 3222 'id': 'IEYHYD', |
| 3223 'template': "'await' is only supported in methods with an 'async' or " |
| 3224 "'async*' body modifier.", |
| 3225 'howToFix': "Try adding 'async' or 'async*' to the method body.", |
| 3226 'examples': [ |
| 3227 """ |
| 3228 main() sync* { |
| 3229 await null; |
| 3230 } |
| 3231 """ |
| 3232 ], |
| 3233 }, |
| 3234 |
| 3235 'INVALID_YIELD': { |
| 3236 'id': 'IPGGCY', |
| 3237 'template': "'yield' is only supported in methods with a 'sync*' or " |
| 3238 "'async*' body modifier.", |
| 3239 'howToFix': "Try adding 'sync*' or 'async*' to the method body.", |
| 3240 'examples': [ |
| 3241 """ |
| 3242 main() async { |
| 3243 yield 0; |
| 3244 } |
| 3245 """ |
| 3246 ], |
| 3247 }, |
| 3248 |
3208 'ASYNC_MODIFIER_ON_ABSTRACT_METHOD': { | 3249 'ASYNC_MODIFIER_ON_ABSTRACT_METHOD': { |
3209 'id': 'VRISLY', | 3250 'id': 'VRISLY', |
3210 'template': | 3251 'template': |
3211 "The modifier '#{modifier}' is not allowed on an abstract method.", | 3252 "The modifier '#{modifier}' is not allowed on an abstract method.", |
3212 'options': ['--enable-async'], | 3253 'options': ['--enable-async'], |
3213 'howToFix': "Try removing the '#{modifier}' modifier or adding a " | 3254 'howToFix': "Try removing the '#{modifier}' modifier or adding a " |
3214 "body to the method.", | 3255 "body to the method.", |
3215 'examples': [ | 3256 'examples': [ |
3216 """ | 3257 """ |
3217 abstract class A { | 3258 abstract class A { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3665 "more code and prevents the compiler from doing some optimizations.", | 3706 "more code and prevents the compiler from doing some optimizations.", |
3666 'howToFix': "Consider removing this 'noSuchMethod' implementation." | 3707 'howToFix': "Consider removing this 'noSuchMethod' implementation." |
3667 }, | 3708 }, |
3668 | 3709 |
3669 'UNRECOGNIZED_VERSION_OF_LOOKUP_MAP': { | 3710 'UNRECOGNIZED_VERSION_OF_LOOKUP_MAP': { |
3670 'id': 'OVAFEW', | 3711 'id': 'OVAFEW', |
3671 'template': "Unsupported version of package:lookup_map.", | 3712 'template': "Unsupported version of package:lookup_map.", |
3672 'howToFix': DONT_KNOW_HOW_TO_FIX | 3713 'howToFix': DONT_KNOW_HOW_TO_FIX |
3673 }, | 3714 }, |
3674 }; | 3715 }; |
OLD | NEW |