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 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 "Cannot patch non-function with function patch " | 3619 "Cannot patch non-function with function patch " |
3620 "'#{functionName}'."), | 3620 "'#{functionName}'."), |
3621 | 3621 |
3622 MessageKind.INJECTED_PUBLIC_MEMBER: const MessageTemplate( | 3622 MessageKind.INJECTED_PUBLIC_MEMBER: const MessageTemplate( |
3623 MessageKind.INJECTED_PUBLIC_MEMBER, | 3623 MessageKind.INJECTED_PUBLIC_MEMBER, |
3624 "Non-patch members in patch libraries must be private."), | 3624 "Non-patch members in patch libraries must be private."), |
3625 | 3625 |
3626 MessageKind.EXTERNAL_WITH_BODY: const MessageTemplate( | 3626 MessageKind.EXTERNAL_WITH_BODY: const MessageTemplate( |
3627 MessageKind.EXTERNAL_WITH_BODY, | 3627 MessageKind.EXTERNAL_WITH_BODY, |
3628 "External function '#{functionName}' cannot have a function body.", | 3628 "External function '#{functionName}' cannot have a function body.", |
3629 options: const ["--output-type=dart"], | |
3630 howToFix: | 3629 howToFix: |
3631 "Try removing the 'external' modifier or the function body.", | 3630 "Try removing the 'external' modifier or the function body.", |
3632 examples: const [ | 3631 examples: const [ |
3633 """ | 3632 """ |
| 3633 import 'package:js/js.dart'; |
| 3634 @JS() |
3634 external foo() => 0; | 3635 external foo() => 0; |
3635 main() => foo(); | 3636 main() => foo(); |
3636 """, | 3637 """, |
3637 """ | 3638 """ |
| 3639 import 'package:js/js.dart'; |
| 3640 @JS() |
3638 external foo() {} | 3641 external foo() {} |
3639 main() => foo(); | 3642 main() => foo(); |
3640 """ | 3643 """ |
3641 ]), | 3644 ]), |
3642 | 3645 |
3643 //////////////////////////////////////////////////////////////////////////
//// | 3646 //////////////////////////////////////////////////////////////////////////
//// |
3644 // Patch errors end. | 3647 // Patch errors end. |
3645 //////////////////////////////////////////////////////////////////////////
//// | 3648 //////////////////////////////////////////////////////////////////////////
//// |
3646 | 3649 |
3647 MessageKind.EXPERIMENTAL_ASSERT_MESSAGE: const MessageTemplate( | 3650 MessageKind.EXPERIMENTAL_ASSERT_MESSAGE: const MessageTemplate( |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3807 static String convertToString(value) { | 3810 static String convertToString(value) { |
3808 if (value is ErrorToken) { | 3811 if (value is ErrorToken) { |
3809 // Shouldn't happen. | 3812 // Shouldn't happen. |
3810 return value.assertionMessage; | 3813 return value.assertionMessage; |
3811 } else if (value is Token) { | 3814 } else if (value is Token) { |
3812 value = value.value; | 3815 value = value.value; |
3813 } | 3816 } |
3814 return '$value'; | 3817 return '$value'; |
3815 } | 3818 } |
3816 } | 3819 } |
OLD | NEW |