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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 "main() => foo(x: 1 y: 2);", 1847 "main() => foo(x: 1 y: 2);",
1848 ]); 1848 ]);
1849 1849
1850 static const MessageKind MISSING_TOKEN_AFTER_THIS = const MessageKind( 1850 static const MessageKind MISSING_TOKEN_AFTER_THIS = const MessageKind(
1851 "Expected '#{token}' after this.", 1851 "Expected '#{token}' after this.",
1852 // See [MISSING_TOKEN_BEFORE_THIS], we don't have enough information to 1852 // See [MISSING_TOKEN_BEFORE_THIS], we don't have enough information to
1853 // give a good suggestion. 1853 // give a good suggestion.
1854 howToFix: DONT_KNOW_HOW_TO_FIX, 1854 howToFix: DONT_KNOW_HOW_TO_FIX,
1855 examples: const ["main(x) {x}"]); 1855 examples: const ["main(x) {x}"]);
1856 1856
1857 static const MessageKind CONSIDER_ANALYZE_ALL = const MessageKind(
1858 "Could not find '#{main}'. Nothing will be analyzed.",
1859 howToFix: "Try using '--analyze-all' to analyze everything.",
1860 examples: const ['']);
1861
1862 static const MessageKind MISSING_MAIN = const MessageKind(
1863 "Could not find '#{main}'.",
1864 howToFix: "Try adding a method named '#{main}' to your program."
1865 /* No example, test uses '--analyze-only' which will produce the above
1866 * message [CONSIDER_ANALYZE_ALL]. An example for a human operator would
1867 * be an empty file. */);
1868
1869 static const MessageKind MAIN_NOT_A_FUNCTION = const MessageKind(
1870 "'#{main}' is not a function.",
1871 howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
1872 examples: const ['var main;']);
1873
1874 static const MessageKind MAIN_WITH_EXTRA_PARAMETER = const MessageKind(
1875 "'#{main}' cannot have more than two parameters.",
1876 howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
1877 examples: const ['main(a, b, c) {}']);
1878
1857 static const MessageKind COMPILER_CRASHED = const MessageKind( 1879 static const MessageKind COMPILER_CRASHED = const MessageKind(
1858 "The compiler crashed when compiling this element."); 1880 "The compiler crashed when compiling this element.");
1859 1881
1860 static const MessageKind PLEASE_REPORT_THE_CRASH = const MessageKind(''' 1882 static const MessageKind PLEASE_REPORT_THE_CRASH = const MessageKind('''
1861 The compiler is broken. 1883 The compiler is broken.
1862 1884
1863 When compiling the above element, the compiler crashed. It is not 1885 When compiling the above element, the compiler crashed. It is not
1864 possible to tell if this is caused by a problem in your program or 1886 possible to tell if this is caused by a problem in your program or
1865 not. Regardless, the compiler should not crash. 1887 not. Regardless, the compiler should not crash.
1866 1888
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 static String convertToString(value) { 2107 static String convertToString(value) {
2086 if (value is ErrorToken) { 2108 if (value is ErrorToken) {
2087 // Shouldn't happen. 2109 // Shouldn't happen.
2088 return value.assertionMessage; 2110 return value.assertionMessage;
2089 } else if (value is Token) { 2111 } else if (value is Token) {
2090 value = value.value; 2112 value = value.value;
2091 } 2113 }
2092 return '$value'; 2114 return '$value';
2093 } 2115 }
2094 } 2116 }
OLDNEW
« 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