Chromium Code Reviews| 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 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2171 static const MessageKind DART_EXT_NOT_SUPPORTED = const MessageKind( | 2171 static const MessageKind DART_EXT_NOT_SUPPORTED = const MessageKind( |
| 2172 "The 'dart-ext' scheme is not supported.", | 2172 "The 'dart-ext' scheme is not supported.", |
| 2173 howToFix: "Try analyzing the code with the --allow-native-extensions " | 2173 howToFix: "Try analyzing the code with the --allow-native-extensions " |
| 2174 "option.", | 2174 "option.", |
| 2175 examples: const [""" | 2175 examples: const [""" |
| 2176 import 'dart-ext:main'; | 2176 import 'dart-ext:main'; |
| 2177 | 2177 |
| 2178 main() {} | 2178 main() {} |
| 2179 """]); | 2179 """]); |
| 2180 | 2180 |
| 2181 static const MessageKind LIBRARY_TAG_MUST_BE_FIRST = const MessageKind( | |
| 2182 "The library declaration should come before other declartions.", | |
|
Johnni Winther
2014/12/18 10:05:11
'declartions' -> 'declarations'.
ahe
2014/12/18 11:05:13
Done.
| |
| 2183 howToFix: "Try moving the declaration to the top of the file.", | |
| 2184 examples: const [ | |
| 2185 """ | |
| 2186 import 'dart:core'; | |
| 2187 library foo; | |
| 2188 main() {} | |
| 2189 """, | |
| 2190 ]); | |
| 2191 | |
| 2192 static const MessageKind ONLY_ONE_LIBRARY_TAG = const MessageKind( | |
| 2193 "There can only be one library declaration.", | |
| 2194 howToFix: "Try removing all other library declarations.", | |
| 2195 examples: const [ | |
| 2196 """ | |
| 2197 library foo; | |
| 2198 library bar; | |
| 2199 main() {} | |
| 2200 """, | |
| 2201 """ | |
| 2202 library foo; | |
| 2203 import 'dart:core'; | |
| 2204 library bar; | |
| 2205 main() {} | |
| 2206 """, | |
| 2207 ]); | |
| 2208 | |
| 2209 static const MessageKind IMPORT_BEFORE_PARTS = const MessageKind( | |
| 2210 "Import declarations should come before parts.", | |
| 2211 howToFix: "Try moving this import further up in the file.", | |
| 2212 examples: const [ | |
| 2213 const <String, String>{ | |
| 2214 'main.dart': """ | |
| 2215 library test.main; | |
| 2216 part 'part.dart'; | |
| 2217 import 'dart:core'; | |
| 2218 main() {} | |
| 2219 """, | |
| 2220 'part.dart': """ | |
| 2221 part of test.main; | |
| 2222 """, | |
| 2223 }]); | |
| 2224 | |
| 2225 static const MessageKind EXPORT_BEFORE_PARTS = const MessageKind( | |
| 2226 "Export declarations should come before parts.", | |
| 2227 howToFix: "Try moving this export further up in the file.", | |
| 2228 examples: const [ | |
| 2229 const <String, String>{ | |
| 2230 'main.dart': """ | |
| 2231 library test.main; | |
| 2232 part 'part.dart'; | |
| 2233 export 'dart:core'; | |
| 2234 main() {} | |
| 2235 """, | |
| 2236 'part.dart': """ | |
| 2237 part of test.main; | |
| 2238 """, | |
| 2239 }]); | |
| 2240 | |
| 2181 ////////////////////////////////////////////////////////////////////////////// | 2241 ////////////////////////////////////////////////////////////////////////////// |
| 2182 // Patch errors start. | 2242 // Patch errors start. |
| 2183 ////////////////////////////////////////////////////////////////////////////// | 2243 ////////////////////////////////////////////////////////////////////////////// |
| 2184 | 2244 |
| 2185 static const MessageKind PATCH_RETURN_TYPE_MISMATCH = const MessageKind( | 2245 static const MessageKind PATCH_RETURN_TYPE_MISMATCH = const MessageKind( |
| 2186 "Patch return type '#{patchReturnType}' does not match " | 2246 "Patch return type '#{patchReturnType}' does not match " |
| 2187 "'#{originReturnType}' on origin method '#{methodName}'."); | 2247 "'#{originReturnType}' on origin method '#{methodName}'."); |
| 2188 | 2248 |
| 2189 static const MessageKind PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH = | 2249 static const MessageKind PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH = |
| 2190 const MessageKind( | 2250 const MessageKind( |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2367 static String convertToString(value) { | 2427 static String convertToString(value) { |
| 2368 if (value is ErrorToken) { | 2428 if (value is ErrorToken) { |
| 2369 // Shouldn't happen. | 2429 // Shouldn't happen. |
| 2370 return value.assertionMessage; | 2430 return value.assertionMessage; |
| 2371 } else if (value is Token) { | 2431 } else if (value is Token) { |
| 2372 value = value.value; | 2432 value = value.value; |
| 2373 } | 2433 } |
| 2374 return '$value'; | 2434 return '$value'; |
| 2375 } | 2435 } |
| 2376 } | 2436 } |
| OLD | NEW |