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

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

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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/compiler.dart
===================================================================
--- dart/sdk/lib/_internal/compiler/implementation/compiler.dart (revision 29808)
+++ dart/sdk/lib/_internal/compiler/implementation/compiler.dart (working copy)
@@ -416,7 +416,9 @@
LibraryElement jsHelperLibrary;
LibraryElement interceptorsLibrary;
LibraryElement foreignLibrary;
+
LibraryElement mainApp;
+ FunctionElement mainFunction;
/// Initialized when dart:mirrors is loaded.
LibraryElement mirrorsLibrary;
@@ -1025,7 +1027,7 @@
void compileLoadedLibraries() {
Element main = null;
if (mainApp != null) {
- main = mainApp.find(MAIN);
+ main = mainApp.findExported(MAIN);
if (main == null) {
if (!analyzeOnly) {
// Allow analyze only of libraries with no main.
@@ -1042,14 +1044,19 @@
"Use '--analyze-all' to analyze all code in the library."});
}
} else {
- if (!main.isFunction()) {
+ if (main.isErroneous()) {
reportFatalError(
main,
MessageKind.GENERIC,
+ {'text': "Error: Cannot determine which '$MAIN' to use."});
+ } else if (!main.isFunction()) {
+ reportFatalError(
+ main,
+ MessageKind.GENERIC,
{'text': "Error: '$MAIN' is not a function."});
}
- FunctionElement mainMethod = main;
- FunctionSignature parameters = mainMethod.computeSignature(this);
+ mainFunction = main;
+ FunctionSignature parameters = mainFunction.computeSignature(this);
if (parameters.parameterCount > 2) {
int index = 0;
parameters.forEachParameter((Element parameter) {
@@ -1110,7 +1117,7 @@
if (hasIsolateSupport()) {
enqueuer.codegen.addToWorkList(
isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE));
- enqueuer.codegen.registerGetOfStaticFunction(mainApp.find(MAIN));
+ enqueuer.codegen.registerGetOfStaticFunction(main);
}
if (enabledNoSuchMethod) {
backend.enableNoSuchMethod(enqueuer.codegen);

Powered by Google App Engine
This is Rietveld 408576698