Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/compiler.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/compiler.dart (revision 29238) |
| +++ sdk/lib/_internal/compiler/implementation/compiler.dart (working copy) |
| @@ -1028,13 +1028,15 @@ |
| } |
| FunctionElement mainMethod = main; |
| FunctionSignature parameters = mainMethod.computeSignature(this); |
| - parameters.forEachParameter((Element parameter) { |
| - reportError( |
| - parameter, |
| - MessageKind.GENERIC, |
| - {'text': |
| - "Error: '$MAIN' cannot have parameters."}); |
| - }); |
| + if (parameters.parameterCount > 2) { |
| + parameters.forEachParameter((Element parameter) { |
| + reportError( |
| + parameter, |
| + MessageKind.GENERIC, |
| + {'text': |
| + "Error: '$MAIN' cannot have parameters."}); |
|
floitsch
2013/10/25 10:56:09
cannot have more than 2 parameters.
ngeoffray
2013/10/25 11:09:52
Done.
|
| + }); |
| + } |
| } |
| mirrorUsageAnalyzerTask.analyzeUsage(mainApp); |
| @@ -1141,6 +1143,14 @@ |
| void processQueue(Enqueuer world, Element main) { |
| world.nativeEnqueuer.processNativeClasses(libraries.values); |
| if (main != null) { |
| + if (main.computeSignature(this).parameterCount != 0) { |
| + // TODO(ngeoffray, floitsch): we should also ensure that the |
| + // class IsolateMessage is instantiated. Currently, just enabling |
| + // isolate support works. |
| + world.enableIsolateSupport(main.getLibrary()); |
| + world.registerInstantiatedClass(listClass, globalDependencies); |
| + world.registerInstantiatedClass(stringClass, globalDependencies); |
| + } |
| world.addToWorkList(main); |
| } |
| progress.reset(); |