added the dom events API to the kotlin standard library and get it compiling as JS too (not unit tested yet mind you ;)

This commit is contained in:
James Strachan
2012-07-24 14:32:27 +01:00
parent 0ccc0de2fe
commit 7d0b03de76
5 changed files with 66 additions and 32 deletions
@@ -43,7 +43,11 @@ fun generateDomEventsAPI(file: File): Unit {
val classes: List<Class<*>> = arrayList(javaClass<DocumentEvent>(), javaClass<Event>(),
javaClass<EventListener>(), javaClass<EventTarget>(),
// TODO see domEventsCode.kt we manually hand craft this for now
// to get the implementation in JS
//
// javaClass<EventListener>(),
javaClass<EventTarget>(),
javaClass<MouseEvent>(), javaClass<MutationEvent>(),
javaClass<UIEvent>())
@@ -77,7 +81,7 @@ import js.noImpl
fun parameterTypeName(klass: Class<out Any?>?): String {
val answer = simpleTypeName(klass)
return if (answer == "String" || answer.endsWith("DocumentType")) {
return if (answer == "String" || answer == "Event" || answer.endsWith("DocumentType")) {
answer + "?"
} else answer
}