Fix NPE on trying to compile script files
(There is still no design)
This commit is contained in:
@@ -119,15 +119,13 @@ open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
|
||||
configuration.put(JVMConfigurationKeys.MODULE_NAME, arguments.moduleName ?: JvmAbi.DEFAULT_MODULE_NAME)
|
||||
|
||||
configuration.add(CommonConfigurationKeys.SCRIPT_DEFINITIONS_KEY, StandardScriptDefinition)
|
||||
|
||||
if (arguments.module == null && arguments.freeArgs.isEmpty() && !arguments.version) {
|
||||
ReplFromTerminal.run(rootDisposable, configuration)
|
||||
return ExitCode.OK
|
||||
}
|
||||
|
||||
if (arguments.script) {
|
||||
configuration.add(CommonConfigurationKeys.SCRIPT_DEFINITIONS_KEY, StandardScriptDefinition)
|
||||
}
|
||||
|
||||
if (arguments.skipMetadataVersionCheck) {
|
||||
JvmMetadataVersion.skipCheck = true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,2 @@
|
||||
1 + 1
|
||||
|
||||
@@ -64,4 +64,10 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
|
||||
public void testScriptException() throws Exception {
|
||||
runCompiler("script", "-script", "script.kts");
|
||||
}
|
||||
|
||||
public void testCompileScript() throws Exception {
|
||||
String jar = tmpdir.getAbsolutePath() + File.separator + "script.jar";
|
||||
|
||||
runCompiler("script", "script.kts", "-d", jar);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user