Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: pkg/dart_messages/lib/shared_messages.dart

Issue 1716463002: More shared messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dart_messages/lib/generated/shared_messages.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « pkg/dart_messages/lib/generated/shared_messages.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698