| 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 /** | 5 /** |
| 6 * The messages in this file should meet the following guide lines: | 6 * The messages in this file should meet the following guide lines: |
| 7 * | 7 * |
| 8 * 1. The message should be a complete sentence starting with an uppercase | 8 * 1. The message should be a complete sentence starting with an uppercase |
| 9 * letter, and ending with a period. | 9 * letter, and ending with a period. |
| 10 * | 10 * |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 UNTERMINATED_STRING, | 456 UNTERMINATED_STRING, |
| 457 UNTERMINATED_TOKEN, | 457 UNTERMINATED_TOKEN, |
| 458 UNUSED_CLASS, | 458 UNUSED_CLASS, |
| 459 UNUSED_LABEL, | 459 UNUSED_LABEL, |
| 460 UNUSED_METHOD, | 460 UNUSED_METHOD, |
| 461 UNUSED_TYPEDEF, | 461 UNUSED_TYPEDEF, |
| 462 VAR_FUNCTION_TYPE_PARAMETER, | 462 VAR_FUNCTION_TYPE_PARAMETER, |
| 463 VOID_EXPRESSION, | 463 VOID_EXPRESSION, |
| 464 VOID_NOT_ALLOWED, | 464 VOID_NOT_ALLOWED, |
| 465 VOID_VARIABLE, | 465 VOID_VARIABLE, |
| 466 WRONG_ARGUMENT_FOR_JS, | |
| 467 WRONG_ARGUMENT_FOR_JS_FIRST, | |
| 468 WRONG_ARGUMENT_FOR_JS_SECOND, | |
| 469 WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, | 466 WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, |
| 470 WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, | 467 WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, |
| 471 YIELDING_MODIFIER_ON_ARROW_BODY, | 468 YIELDING_MODIFIER_ON_ARROW_BODY, |
| 472 } | 469 } |
| 473 | 470 |
| 474 /// A message template for an error, warning, hint or info message generated | 471 /// A message template for an error, warning, hint or info message generated |
| 475 /// by the compiler. Each template is associated with a [MessageKind] that | 472 /// by the compiler. Each template is associated with a [MessageKind] that |
| 476 /// uniquely identifies the message template. | 473 /// uniquely identifies the message template. |
| 477 // TODO(johnnniwinther): For Infos, consider adding a reference to the | 474 // TODO(johnnniwinther): For Infos, consider adding a reference to the |
| 478 // error/warning/hint that they belong to. | 475 // error/warning/hint that they belong to. |
| (...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2691 howToFix: "Try adding '@MirrorsUsed(...)' as described at " | 2688 howToFix: "Try adding '@MirrorsUsed(...)' as described at " |
| 2692 "https://goo.gl/Akrrog."), | 2689 "https://goo.gl/Akrrog."), |
| 2693 | 2690 |
| 2694 MessageKind.JS_PLACEHOLDER_CAPTURE: const MessageTemplate( | 2691 MessageKind.JS_PLACEHOLDER_CAPTURE: const MessageTemplate( |
| 2695 MessageKind.JS_PLACEHOLDER_CAPTURE, | 2692 MessageKind.JS_PLACEHOLDER_CAPTURE, |
| 2696 "JS code must not use '#' placeholders inside functions.", | 2693 "JS code must not use '#' placeholders inside functions.", |
| 2697 howToFix: | 2694 howToFix: |
| 2698 "Use an immediately called JavaScript function to capture the" | 2695 "Use an immediately called JavaScript function to capture the" |
| 2699 " the placeholder values as JavaScript function parameters."), | 2696 " the placeholder values as JavaScript function parameters."), |
| 2700 | 2697 |
| 2701 MessageKind.WRONG_ARGUMENT_FOR_JS: const MessageTemplate( | |
| 2702 MessageKind.WRONG_ARGUMENT_FOR_JS, | |
| 2703 "JS expression must take two or more arguments."), | |
| 2704 | |
| 2705 MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST: const MessageTemplate( | |
| 2706 MessageKind.WRONG_ARGUMENT_FOR_JS_FIRST, | |
| 2707 "JS expression must take two or more arguments."), | |
| 2708 | |
| 2709 MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND: const MessageTemplate( | |
| 2710 MessageKind.WRONG_ARGUMENT_FOR_JS_SECOND, | |
| 2711 "JS second argument must be a string literal."), | |
| 2712 | |
| 2713 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT: | 2698 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT: |
| 2714 const MessageTemplate( | 2699 const MessageTemplate( |
| 2715 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, | 2700 MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, |
| 2716 "Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant.")
, | 2701 "Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant.")
, |
| 2717 | 2702 |
| 2718 MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD: const MessageTemplate( | 2703 MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD: const MessageTemplate( |
| 2719 MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD, | 2704 MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD, |
| 2720 "'#{keyword}' is a reserved word and can't be used here.", | 2705 "'#{keyword}' is a reserved word and can't be used here.", |
| 2721 howToFix: "Try using a different name.", | 2706 howToFix: "Try using a different name.", |
| 2722 examples: const ["do() {} main() {}"]), | 2707 examples: const ["do() {} main() {}"]), |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3829 static String convertToString(value) { | 3814 static String convertToString(value) { |
| 3830 if (value is ErrorToken) { | 3815 if (value is ErrorToken) { |
| 3831 // Shouldn't happen. | 3816 // Shouldn't happen. |
| 3832 return value.assertionMessage; | 3817 return value.assertionMessage; |
| 3833 } else if (value is Token) { | 3818 } else if (value is Token) { |
| 3834 value = value.value; | 3819 value = value.value; |
| 3835 } | 3820 } |
| 3836 return '$value'; | 3821 return '$value'; |
| 3837 } | 3822 } |
| 3838 } | 3823 } |
| OLD | NEW |