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..854dfa59933656ef92e55c3de795a3b432297ffc 100644 |
--- a/pkg/dart_messages/lib/shared_messages.dart |
+++ b/pkg/dart_messages/lib/shared_messages.dart |
@@ -152,7 +152,7 @@ String get messagesAsJson { |
'examples': message.examples, |
}; |
}); |
- return JSON.encode(jsonified); |
+ return new JsonEncoder.withIndent(' ').convert(jsonified); |
} |
final Map<String, Message> MESSAGES = { |
@@ -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: "Throw expressions must compute the object to be thrown.", |
+ 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. |