Loading java arrays as Array<out T> at method return type position, as well.
This commit is contained in:
@@ -10,7 +10,7 @@ class StringUtilTest() : TestCase() {
|
||||
|
||||
fun testToRegex() {
|
||||
val re = """foo""".toRegex()
|
||||
val list = re.split("hellofoobar").toList()
|
||||
val list = (re.split("hellofoobar") as Array<String>).toList()
|
||||
assertEquals(arrayList("hello", "bar"), list)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.ArrayList
|
||||
import java.util.TreeMap
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.events.*
|
||||
import java.lang.reflect.*
|
||||
|
||||
/**
|
||||
* This tool generates JavaScript stubs for classes available in the JDK which are already available in the browser environment
|
||||
@@ -139,7 +140,7 @@ import js.noImpl
|
||||
}
|
||||
}
|
||||
for (method in validMethods) {
|
||||
val parameterTypes = method.getParameterTypes()!!
|
||||
val parameterTypes = method.getParameterTypes()!! as jet.Array<Class<out Any?>?>
|
||||
|
||||
// TODO in java 7 its not easy with reflection to get the parameter argument name...
|
||||
var counter = 0
|
||||
@@ -148,7 +149,7 @@ import js.noImpl
|
||||
println(" public fun ${method.getName()}($parameters): $returnType = js.noImpl")
|
||||
}
|
||||
}
|
||||
val fields = klass.getDeclaredFields()
|
||||
val fields = klass.getDeclaredFields() as jet.Array<Field>
|
||||
if (fields != null) {
|
||||
if (fields.notEmpty()) {
|
||||
println("")
|
||||
|
||||
Reference in New Issue
Block a user