CLI: move K2JSCompilerArguments#createMainCallParameters to K2JSCompiler.

This commit is contained in:
Zalim Bashorov
2013-10-08 21:18:19 +04:00
parent fa25489a5b
commit 8cea226a87
2 changed files with 10 additions and 12 deletions
@@ -98,7 +98,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
return ExitCode.INTERNAL_ERROR; return ExitCode.INTERNAL_ERROR;
} }
MainCallParameters mainCallParameters = arguments.createMainCallParameters(); MainCallParameters mainCallParameters = createMainCallParameters(arguments.main);
return translateAndGenerateOutputFile(mainCallParameters, environmentForJS, config, outputFile); return translateAndGenerateOutputFile(mainCallParameters, environmentForJS, config, outputFile);
} }
@@ -163,4 +163,13 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion, arguments.sourcemap); return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion, arguments.sourcemap);
} }
} }
public static MainCallParameters createMainCallParameters(String main) {
if ("noCall".equals(main)) {
return MainCallParameters.noCall();
}
else {
return MainCallParameters.mainWithoutArguments();
}
}
} }
@@ -19,7 +19,6 @@ package org.jetbrains.jet.cli.js;
import com.sampullara.cli.Argument; import com.sampullara.cli.Argument;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.cli.CommonCompilerArguments; import org.jetbrains.jet.cli.CommonCompilerArguments;
import org.jetbrains.k2js.facade.MainCallParameters;
/** /**
@@ -49,14 +48,4 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
public String getSrc() { public String getSrc() {
throw new IllegalStateException(); throw new IllegalStateException();
} }
public MainCallParameters createMainCallParameters() {
if ("noCall".equals(main)) {
return MainCallParameters.noCall();
}
else {
// TODO should we pass the arguments to the compiler?
return MainCallParameters.mainWithoutArguments();
}
}
} }