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

Unified Diff: dart/sdk/lib/_internal/lib/js_helper.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
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | dart/tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/js_helper.dart
diff --git a/dart/sdk/lib/_internal/lib/js_helper.dart b/dart/sdk/lib/_internal/lib/js_helper.dart
index 37f016ecd5b06115c38d0f2252ce81087bdb0840..41fc90290ba6473228d240af3af2bd2fc1d6684b 100644
--- a/dart/sdk/lib/_internal/lib/js_helper.dart
+++ b/dart/sdk/lib/_internal/lib/js_helper.dart
@@ -3330,3 +3330,23 @@ Future<Null> _loadHunk(String hunkName, String uri) {
return completer.future;
});
}
+
+class MainError extends Error implements NoSuchMethodError {
+ final String _message;
+
+ MainError(this._message);
+
+ String toString() => 'NoSuchMethodError: $_message';
+}
+
+void missingMain() {
+ throw new MainError("No top-level function named 'main'.");
+}
+
+void badMain() {
+ throw new MainError("'main' is not a function.");
+}
+
+void mainHasTooManyParameters() {
+ throw new MainError("'main' expects too many parameters.");
+}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | dart/tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698