cedric
08/02/2019, 12:23 AMfun gitComplete(line: String, cursorIndex: Int): List<String> {
val words = line.split(" ")
if (words[0] == "git") return listOf("commit", "status")
else return emptyList()
}
val result = if (args.size == 2) gitComplete(args[0], args[1].toInt())
else emptyList()
result
The script above returns a valid result (a list of strings), but if I remove the intermediate result
variable:
fun gitComplete(line: String, cursorIndex: Int): List<String> {
val words = line.split(" ")
if (words[0] == "git") return listOf("commit", "status")
else return emptyList()
}
if (args.size == 2) gitComplete(args[0], args[1].toInt())
else emptyList()
then the result of the evaluation by the engine is null
.ilya.chernikov
08/02/2019, 2:10 PMUnit
. In JSR-223 settings it is conveyed via null
.cedric
08/02/2019, 2:13 PMilya.chernikov
08/02/2019, 2:16 PMilya.chernikov
08/03/2019, 2:57 PMilya.chernikov
08/03/2019, 3:03 PMcedric
08/03/2019, 4:02 PM