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

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

Issue 10001008: Many type fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 8 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 | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698