| Index: pkg/compiler/lib/src/js_backend/backend.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
|
| index 3aca346a44573348d6c7619816716c32462852b8..4ef276bec241482cbca97de86b44cf150afbbe35 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart
|
| @@ -59,6 +59,7 @@ import '../universe/world_impact.dart'
|
| TransformedWorldImpact,
|
| WorldImpact,
|
| WorldImpactBuilder,
|
| + WorldImpactBuilderImpl,
|
| WorldImpactVisitor,
|
| StagedWorldImpactBuilder;
|
| import '../util/util.dart';
|
| @@ -2577,12 +2578,26 @@ class JavaScriptBackend extends Backend {
|
| aliasedSuperMembers.remove(element);
|
| }
|
|
|
| - void registerMainHasArguments(Enqueuer enqueuer) {
|
| - // If the main method takes arguments, this compilation could be the target
|
| - // of Isolate.spawnUri. Strictly speaking, that can happen also if main
|
| - // takes no arguments, but in this case the spawned isolate can't
|
| - // communicate with the spawning isolate.
|
| - enqueuer.enableIsolateSupport();
|
| + @override
|
| + WorldImpact computeMainImpact(Enqueuer enqueuer, MethodElement mainMethod) {
|
| + WorldImpactBuilderImpl mainImpact = new WorldImpactBuilderImpl();
|
| + if (mainMethod.parameters.isNotEmpty) {
|
| + mainImpact.registerTypeUse(
|
| + new TypeUse.instantiation(backendClasses.listImplementation.rawType));
|
| + mainImpact.registerTypeUse(new TypeUse.instantiation(
|
| + backendClasses.stringImplementation.rawType));
|
| + mainImpact.registerStaticUse(
|
| + new StaticUse.staticInvoke(mainMethod, CallStructure.TWO_ARGS));
|
| +
|
| + // If the main method takes arguments, this compilation could be the
|
| + // target of Isolate.spawnUri. Strictly speaking, that can happen also if
|
| + // main takes no arguments, but in this case the spawned isolate can't
|
| + // communicate with the spawning isolate.
|
| + enqueuer.enableIsolateSupport();
|
| + }
|
| + mainImpact.registerStaticUse(
|
| + new StaticUse.staticInvoke(mainMethod, CallStructure.NO_ARGS));
|
| + return mainImpact;
|
| }
|
|
|
| /// Returns the filename for the output-unit named [name].
|
|
|