| 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 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 "#{hints} hint(s) suppressed in #{uri}."); | 2071 "#{hints} hint(s) suppressed in #{uri}."); |
| 2072 | 2072 |
| 2073 static const MessageKind PREAMBLE = const MessageKind( | 2073 static const MessageKind PREAMBLE = const MessageKind( |
| 2074 "When run on the command-line, the compiled output might" | 2074 "When run on the command-line, the compiled output might" |
| 2075 " require a preamble file located in:\n" | 2075 " require a preamble file located in:\n" |
| 2076 " <sdk>/lib/_internal/compiler/js_lib/preambles."); | 2076 " <sdk>/lib/_internal/compiler/js_lib/preambles."); |
| 2077 | 2077 |
| 2078 static const MessageKind EXPERIMENTAL_ASYNC_AWAIT = const MessageKind( | 2078 static const MessageKind EXPERIMENTAL_ASYNC_AWAIT = const MessageKind( |
| 2079 "Experimental language feature 'async/await' is not supported."); | 2079 "Experimental language feature 'async/await' is not supported."); |
| 2080 | 2080 |
| 2081 static const MessageKind INVALID_STARRED_KEYWORD = const MessageKind( | |
| 2082 "Invalid '#{keyword}' keyword.", | |
| 2083 options: const ['--enable-async'], | |
| 2084 howToFix: "Try removing whitespace between '#{keyword}' and '*'.", | |
| 2085 examples: const [ | |
| 2086 "main() async * {}", | |
| 2087 "main() sync * {}", | |
| 2088 "main() async* { yield * null; }" | |
| 2089 ]); | |
| 2090 | |
| 2091 static const MessageKind INVALID_SYNC_MODIFIER = const MessageKind( | 2081 static const MessageKind INVALID_SYNC_MODIFIER = const MessageKind( |
| 2092 "Invalid modifier 'sync'.", | 2082 "Invalid modifier 'sync'.", |
| 2093 options: const ['--enable-async'], | 2083 options: const ['--enable-async'], |
| 2094 howToFix: "Try replacing 'sync' with 'sync*'.", | 2084 howToFix: "Try replacing 'sync' with 'sync*'.", |
| 2095 examples: const [ | 2085 examples: const [ |
| 2096 "main() sync {}" | 2086 "main() sync {}" |
| 2097 ]); | 2087 ]); |
| 2098 | 2088 |
| 2099 static const MessageKind INVALID_AWAIT_FOR = const MessageKind( | 2089 static const MessageKind INVALID_AWAIT_FOR = const MessageKind( |
| 2100 "'await' is only supported on for-in loops.", | 2090 "'await' is only supported on for-in loops.", |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 static String convertToString(value) { | 2440 static String convertToString(value) { |
| 2451 if (value is ErrorToken) { | 2441 if (value is ErrorToken) { |
| 2452 // Shouldn't happen. | 2442 // Shouldn't happen. |
| 2453 return value.assertionMessage; | 2443 return value.assertionMessage; |
| 2454 } else if (value is Token) { | 2444 } else if (value is Token) { |
| 2455 value = value.value; | 2445 value = value.value; |
| 2456 } | 2446 } |
| 2457 return '$value'; | 2447 return '$value'; |
| 2458 } | 2448 } |
| 2459 } | 2449 } |
| OLD | NEW |