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 = ""; | 7 const DONT_KNOW_HOW_TO_FIX = ""; |
| 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 | 808 |
| 809 main() => foo(1); | 809 main() => foo(1); |
| 810 """]); | 810 """]); |
| 811 | 811 |
| 812 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind( | 812 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind( |
| 813 "Error: A constant variable must be initialized.", | 813 "Error: A constant variable must be initialized.", |
| 814 howToFix: "Try adding an initializer or " | 814 howToFix: "Try adding an initializer or " |
| 815 "removing the 'const' modifier.", | 815 "removing the 'const' modifier.", |
| 816 examples: const [""" | 816 examples: const [""" |
| 817 void main() { | 817 void main() { |
| 818 const c; // This constant variable must be initialized. | 818 const c; // This constant variable must be initialized. |
| 819 }"""]); | 819 }"""]); |
| 820 | 820 |
| 821 | 821 |
| 822 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT = | 822 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT = |
| 823 const MessageKind( | 823 const MessageKind( |
| 824 'Error: Wrong number of arguments to assert. Should be 1, but given ' | 824 'Error: Wrong number of arguments to assert. Should be 1, but given ' |
| 825 '#{argumentCount}.'); | 825 '#{argumentCount}.'); |
| 826 | 826 |
| 827 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind( | 827 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind( |
| 828 'Error: "assert" takes no named arguments, but given #{argumentCount}.'); | 828 'Error: "assert" takes no named arguments, but given #{argumentCount}.'); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 894 'Error: Library not found "#{resolvedUri}".'); | 894 'Error: Library not found "#{resolvedUri}".'); |
| 895 | 895 |
| 896 static const MessageKind UNSUPPORTED_EQ_EQ_EQ = const MessageKind( | 896 static const MessageKind UNSUPPORTED_EQ_EQ_EQ = const MessageKind( |
| 897 'Error: "===" is not an operator. ' | 897 'Error: "===" is not an operator. ' |
| 898 'Did you mean "#{lhs} == #{rhs}" or "identical(#{lhs}, #{rhs})"?'); | 898 'Did you mean "#{lhs} == #{rhs}" or "identical(#{lhs}, #{rhs})"?'); |
| 899 | 899 |
| 900 static const MessageKind UNSUPPORTED_BANG_EQ_EQ = const MessageKind( | 900 static const MessageKind UNSUPPORTED_BANG_EQ_EQ = const MessageKind( |
| 901 'Error: "!==" is not an operator. ' | 901 'Error: "!==" is not an operator. ' |
| 902 'Did you mean "#{lhs} != #{rhs}" or "!identical(#{lhs}, #{rhs})"?'); | 902 'Did you mean "#{lhs} != #{rhs}" or "!identical(#{lhs}, #{rhs})"?'); |
| 903 | 903 |
| 904 static const MessageKind UNSUPPORTED_PREFIX_PLUS = const MessageKind( | |
| 905 'Error: "+" is not a prefix operator.'); | |
|
ahe
2013/09/20 08:17:17
Could you add an example and "howToFix"?
Lasse Reichstein Nielsen
2013/09/20 08:26:15
What would a fix be?
For "+2" it would just be rem
ahe
2013/09/20 08:33:42
I think something like:
"Try removing '+'."
ahe
2013/09/20 08:33:42
Another thing, please use double quotes for the co
| |
| 906 | |
| 904 static const MessageKind UNSUPPORTED_THROW_WITHOUT_EXP = const MessageKind( | 907 static const MessageKind UNSUPPORTED_THROW_WITHOUT_EXP = const MessageKind( |
| 905 'Error: No expression after "throw". ' | 908 'Error: No expression after "throw". ' |
| 906 'Did you mean "rethrow"?'); | 909 'Did you mean "rethrow"?'); |
| 907 | 910 |
| 908 static const MessageKind MIRRORS_EXPECTED_STRING = const MessageKind( | 911 static const MessageKind MIRRORS_EXPECTED_STRING = const MessageKind( |
| 909 "Hint: Can't use '#{name}' here because it's an instance of '#{type}' " | 912 "Hint: Can't use '#{name}' here because it's an instance of '#{type}' " |
| 910 "and a 'String' value is expected.", | 913 "and a 'String' value is expected.", |
| 911 howToFix: "Did you forget to add quotes?", | 914 howToFix: "Did you forget to add quotes?", |
| 912 examples: const [ | 915 examples: const [ |
| 913 """ | 916 """ |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 | 1281 |
| 1279 class CompileTimeConstantError extends Diagnostic { | 1282 class CompileTimeConstantError extends Diagnostic { |
| 1280 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) | 1283 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) |
| 1281 : super(kind, arguments, terse); | 1284 : super(kind, arguments, terse); |
| 1282 } | 1285 } |
| 1283 | 1286 |
| 1284 class CompilationError extends Diagnostic { | 1287 class CompilationError extends Diagnostic { |
| 1285 CompilationError(MessageKind kind, Map arguments, bool terse) | 1288 CompilationError(MessageKind kind, Map arguments, bool terse) |
| 1286 : super(kind, arguments, terse); | 1289 : super(kind, arguments, terse); |
| 1287 } | 1290 } |
| OLD | NEW |