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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 static const MessageKind ADDITIONAL_ARGUMENT = const MessageKind( | 115 static const MessageKind ADDITIONAL_ARGUMENT = const MessageKind( |
116 "Additional argument."); | 116 "Additional argument."); |
117 | 117 |
118 static const MessageKind NAMED_ARGUMENT_NOT_FOUND = const MessageKind( | 118 static const MessageKind NAMED_ARGUMENT_NOT_FOUND = const MessageKind( |
119 "No named argument '#{argumentName}' found on method."); | 119 "No named argument '#{argumentName}' found on method."); |
120 | 120 |
121 static const MessageKind MEMBER_NOT_FOUND = const MessageKind( | 121 static const MessageKind MEMBER_NOT_FOUND = const MessageKind( |
122 "No member named '#{memberName}' in class '#{className}'."); | 122 "No member named '#{memberName}' in class '#{className}'."); |
123 | 123 |
| 124 static const MessageKind AWAIT_MEMBER_NOT_FOUND = const MessageKind( |
| 125 "No member named 'await' in class '#{className}'.", |
| 126 howToFix: "Did you mean to add the 'async' marker " |
| 127 "to #{enclosingFunctionText}?", |
| 128 examples: const [""" |
| 129 class A { |
| 130 m() => await -3; |
| 131 } |
| 132 main() => new A().m(); |
| 133 """, """ |
| 134 class A { |
| 135 m() => () => await -3; |
| 136 } |
| 137 main() => new A().m(); |
| 138 """]); |
| 139 |
124 static const MessageKind METHOD_NOT_FOUND = const MessageKind( | 140 static const MessageKind METHOD_NOT_FOUND = const MessageKind( |
125 "No method named '#{memberName}' in class '#{className}'."); | 141 "No method named '#{memberName}' in class '#{className}'."); |
126 | 142 |
127 static const MessageKind OPERATOR_NOT_FOUND = const MessageKind( | 143 static const MessageKind OPERATOR_NOT_FOUND = const MessageKind( |
128 "No operator '#{memberName}' in class '#{className}'."); | 144 "No operator '#{memberName}' in class '#{className}'."); |
129 | 145 |
130 static const MessageKind SETTER_NOT_FOUND = const MessageKind( | 146 static const MessageKind SETTER_NOT_FOUND = const MessageKind( |
131 "No setter named '#{memberName}' in class '#{className}'."); | 147 "No setter named '#{memberName}' in class '#{className}'."); |
132 | 148 |
133 static const MessageKind GETTER_NOT_FOUND = const MessageKind( | 149 static const MessageKind GETTER_NOT_FOUND = const MessageKind( |
(...skipping 14 matching lines...) Expand all Loading... |
148 | 164 |
149 static const MessageKind THIS_IS_THE_DECLARATION = const MessageKind( | 165 static const MessageKind THIS_IS_THE_DECLARATION = const MessageKind( |
150 "This is the declaration of '#{name}'."); | 166 "This is the declaration of '#{name}'."); |
151 | 167 |
152 static const MessageKind THIS_IS_THE_METHOD = const MessageKind( | 168 static const MessageKind THIS_IS_THE_METHOD = const MessageKind( |
153 "This is the method declaration."); | 169 "This is the method declaration."); |
154 | 170 |
155 static const MessageKind CANNOT_RESOLVE = const MessageKind( | 171 static const MessageKind CANNOT_RESOLVE = const MessageKind( |
156 "Cannot resolve '#{name}'."); | 172 "Cannot resolve '#{name}'."); |
157 | 173 |
| 174 static const MessageKind CANNOT_RESOLVE_AWAIT = const MessageKind( |
| 175 "Cannot resolve '#{name}'.", |
| 176 howToFix: "Did you mean to add the 'async' marker " |
| 177 "to #{enclosingFunctionText}?", |
| 178 examples: const [ |
| 179 "main() => await -3;", |
| 180 "main() { (() => await -3)(); }", |
| 181 "foo() => await -3; main() => foo();" |
| 182 ]); |
| 183 |
158 static const MessageKind CANNOT_RESOLVE_IN_INITIALIZER = const MessageKind( | 184 static const MessageKind CANNOT_RESOLVE_IN_INITIALIZER = const MessageKind( |
159 "Cannot resolve '#{name}'. It would be implicitly looked up on this " | 185 "Cannot resolve '#{name}'. It would be implicitly looked up on this " |
160 "instance, but instances are not available in initializers.", | 186 "instance, but instances are not available in initializers.", |
161 howToFix: "Try correcting the unresolved reference or move the " | 187 howToFix: "Try correcting the unresolved reference or move the " |
162 "initialization to a constructor body.", | 188 "initialization to a constructor body.", |
163 examples: const [""" | 189 examples: const [""" |
164 class A { | 190 class A { |
165 var test = unresolvedName; | 191 var test = unresolvedName; |
166 } | 192 } |
167 main() => new A(); | 193 main() => new A(); |
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2499 static String convertToString(value) { | 2525 static String convertToString(value) { |
2500 if (value is ErrorToken) { | 2526 if (value is ErrorToken) { |
2501 // Shouldn't happen. | 2527 // Shouldn't happen. |
2502 return value.assertionMessage; | 2528 return value.assertionMessage; |
2503 } else if (value is Token) { | 2529 } else if (value is Token) { |
2504 value = value.value; | 2530 value = value.value; |
2505 } | 2531 } |
2506 return '$value'; | 2532 return '$value'; |
2507 } | 2533 } |
2508 } | 2534 } |
OLD | NEW |