${project.build.directory}/generated/js/teavm
- org.teavm.samples.kotlin.KotlinPackage
+ org.teavm.samples.kotlin.HelloKt
SEPARATE
false
true
diff --git a/samples/kotlin/src/main/webapp/index.html b/samples/kotlin/src/main/webapp/index.html
index 988fa4e9a..b1f851d52 100644
--- a/samples/kotlin/src/main/webapp/index.html
+++ b/samples/kotlin/src/main/webapp/index.html
@@ -13,18 +13,12 @@
package org.teavm.samples.kotlin
-import org.teavm.jso.*
-import org.teavm.dom.browser.*
-import org.teavm.dom.html.*
-import org.teavm.dom.events.*
+import org.teavm.jso.browser.*
-fun main(args : Array<String>) {
- var window = JS.getGlobal() as Window;
- var document = window.getDocument();
+fun main(args : Array<String>) {
+ val document = Window.current().document;
- document.getElementById("hello-kotlin").addEventListener("click", EventListener<MouseEvent>() {
- window.alert("Hello, developer!");
- })
+ document.getElementById("hello-kotlin").addEventListener("click") { Window.alert("Hello, developer!") }
}