| Index: lib/compiler/implementation/compiler.dart
|
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
|
| index 0e68c7d10193a893b23b85f71cab83b2cfa2d320..880133dec5399858ccbf0d7a3a466a2375462901 100644
|
| --- a/lib/compiler/implementation/compiler.dart
|
| +++ b/lib/compiler/implementation/compiler.dart
|
| @@ -266,14 +266,15 @@ class Compiler implements DiagnosticListener {
|
| void runCompiler(Uri uri) {
|
| scanBuiltinLibraries();
|
| mainApp = scanner.loadLibrary(uri, null);
|
| - final Element mainMethod = mainApp.find(MAIN);
|
| - if (mainMethod === null) {
|
| + final Element main = mainApp.find(MAIN);
|
| + if (main === null) {
|
| withCurrentElement(mainApp, () => cancel('Could not find $MAIN'));
|
| } else {
|
| - withCurrentElement(mainMethod, () {
|
| - if (!mainMethod.isFunction()) {
|
| - cancel('main is not a function', element: mainMethod);
|
| + withCurrentElement(main, () {
|
| + if (!main.isFunction()) {
|
| + cancel('main is not a function', element: main);
|
| }
|
| + FunctionElement mainMethod = main;
|
| FunctionParameters parameters = mainMethod.computeParameters(this);
|
| if (parameters.parameterCount > 0) {
|
| cancel('main cannot have parameters', element: mainMethod);
|
| @@ -281,7 +282,7 @@ class Compiler implements DiagnosticListener {
|
| });
|
| }
|
| native.processNativeClasses(this, universe.libraries.getValues());
|
| - enqueue(new WorkItem.toCompile(mainMethod));
|
| + enqueue(new WorkItem.toCompile(main));
|
| codegenProgress.reset();
|
| while (!worklist.isEmpty()) {
|
| WorkItem work = worklist.removeLast();
|
|
|