Index: sdk/lib/_internal/compiler/implementation/compiler.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart |
index 93474dc9e7ce61e4fe92380581dbafe22cf230ed..764b7294ed64fe6c7af9c298bde53db612a9aafb 100644 |
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart |
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart |
@@ -1028,13 +1028,22 @@ abstract class Compiler implements DiagnosticListener { |
} |
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) { |
+ int argumentCount = 0; |
+ parameters.forEachParameter((Element parameter) { |
+ argumentCount++; |
+ if (argumentCount > 2) { |
+ reportError( |
+ parameter, |
+ MessageKind.GENERIC, |
+ {'text': |
+ "Error: '$MAIN' cannot have more than 2 parameters."}); |
+ } |
+ }); |
+ } |
+ if (parameters.parameterCount == 2) { |
+ enqueuer.resolution.enableIsolateSupport(main.getLibrary()); |
+ } |
} |
mirrorUsageAnalyzerTask.analyzeUsage(mainApp); |