Index: pkg/dart_messages/lib/shared_messages.dart |
diff --git a/pkg/dart_messages/lib/shared_messages.dart b/pkg/dart_messages/lib/shared_messages.dart |
index 006862b2f77a11a9a6f96ae53046f61d3f48c2db..44ba95e0771f041fc2ab41dd7f54452b25b86287 100644 |
--- a/pkg/dart_messages/lib/shared_messages.dart |
+++ b/pkg/dart_messages/lib/shared_messages.dart |
@@ -404,6 +404,34 @@ final Map<String, Message> MESSAGES = { |
usedBy: [analyzer, dart2js], |
examples: const ["class A { int A() {} } main() { new A(); }",]), |
+ 'MISSING_EXPRESSION_IN_THROW': new Message( |
+ id: 'FTGGMJ', |
+ subId: 0, |
+ category: Category.parserError, |
+ template: "Missing expression after 'throw'.", |
+ howToFix: "Did you mean 'rethrow'?", |
+ usedBy: [ |
+ analyzer, |
+ dart2js |
+ ], |
+ examples: const [ |
+ 'main() { throw; }', |
+ 'main() { try { throw 0; } catch(e) { throw; } }' |
+ ]), |
+ |
+ /** |
+ * 12.8.1 Rethrow: It is a compile-time error if an expression of the form |
+ * <i>rethrow;</i> is not enclosed within a on-catch clause. |
+ */ |
+ 'RETHROW_OUTSIDE_CATCH': new Message( |
+ id: 'MWETLC', |
+ category: Category.compileTimeError, |
+ template: 'Rethrow must be inside of catch clause', |
+ howToFix: "Try moving the expression into a catch clause, or " |
+ "using a 'throw' expression.", |
+ usedBy: [analyzer, dart2js], |
+ examples: const ["main() { rethrow; }"]), |
+ |
/** |
* 13.12 Return: It is a compile-time error if a return statement of the form |
* <i>return e;</i> appears in a generative constructor. |