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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 285903006: Fix main handling in dart2js and add tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r38186. Created 6 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
Index: dart/sdk/lib/_internal/compiler/implementation/warnings.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/warnings.dart b/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
index 9aec3299f88704a175468f35cfe95ae38b33745c..02c2ebfe57724b916b60b179bfd31d528b8015df 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -1854,6 +1854,28 @@ main() {
howToFix: DONT_KNOW_HOW_TO_FIX,
examples: const ["main(x) {x}"]);
+ static const MessageKind CONSIDER_ANALYZE_ALL = const MessageKind(
+ "Could not find '#{main}'. Nothing will be analyzed.",
+ howToFix: "Try using '--analyze-all' to analyze everything.",
+ examples: const ['']);
+
+ static const MessageKind MISSING_MAIN = const MessageKind(
+ "Could not find '#{main}'.",
+ howToFix: "Try adding a method named '#{main}' to your program."
+ /* No example, test uses '--analyze-only' which will produce the above
+ * message [CONSIDER_ANALYZE_ALL]. An example for a human operator would
+ * be an empty file. */);
+
+ static const MessageKind MAIN_NOT_A_FUNCTION = const MessageKind(
+ "'#{main}' is not a function.",
+ howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
+ examples: const ['var main;']);
+
+ static const MessageKind MAIN_WITH_EXTRA_PARAMETER = const MessageKind(
+ "'#{main}' cannot have more than two parameters.",
+ howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
+ examples: const ['main(a, b, c) {}']);
+
static const MessageKind COMPILER_CRASHED = const MessageKind(
"The compiler crashed when compiling this element.");
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/mirrors_used.dart ('k') | dart/sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698