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

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 2068003002: dart2js: allow trailing commas in parameter and argument lists (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: respond to comments Created 4 years, 5 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 | « no previous file | pkg/compiler/lib/src/parser/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index dbcab63845a57e207d591acf26d6ac936418d536..893b447dd5f780e8cfba739eb54233ee0db6c5bf 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -186,9 +186,11 @@ enum MessageKind {
DUPLICATED_RESOURCE,
EMPTY_CATCH_DECLARATION,
EMPTY_ENUM_DECLARATION,
+ EMPTY_NAMED_PARAMETER_LIST,
+ EMPTY_OPTIONAL_PARAMETER_LIST,
EMPTY_HIDE,
- EQUAL_MAP_ENTRY_KEY,
EMPTY_SHOW,
+ EQUAL_MAP_ENTRY_KEY,
EXISTING_DEFINITION,
EXISTING_LABEL,
EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
@@ -878,6 +880,36 @@ main() {}"""
},
]),
+ MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST: const MessageTemplate(
+ MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST,
+ "Optional parameter lists cannot be empty.",
+ howToFix: "Try adding an optional parameter to the list.",
+ examples: const [
+ const {
+ 'main.dart': """
+foo([]) {}
+
+main() {
+ foo();
+}"""
+ }
+ ]),
+
+ MessageKind.EMPTY_NAMED_PARAMETER_LIST: const MessageTemplate(
+ MessageKind.EMPTY_NAMED_PARAMETER_LIST,
+ "Named parameter lists cannot be empty.",
+ howToFix: "Try adding a named parameter to the list.",
+ examples: const [
+ const {
+ 'main.dart': """
+foo({}) {}
+
+main() {
+ foo();
+}"""
+ }
+ ]),
+
MessageKind.NOT_A_TYPE: const MessageTemplate(
MessageKind.NOT_A_TYPE, "'#{node}' is not a type."),
« no previous file with comments | « no previous file | pkg/compiler/lib/src/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698