damian
12/04/2017, 3:59 PMjs(...)
seems a bit too much for thatjv
12/04/2017, 9:48 PMjv
12/05/2017, 8:09 AMgaetan
12/05/2017, 11:15 PMnapperley
12/06/2017, 8:01 PMedattore
12/06/2017, 9:19 PMjv
12/08/2017, 2:29 AMDmitry Kandalov
12/08/2017, 11:34 AMpush()/pop()
items?
This seems like a basic thing for JS interop but I did't find any obvious solutions (kotlin.Array
doesn't have push()/pop()
methods).
The most reasonable solution I found was to define external JsArray class:
@JsName("Array")
external class JsArray<T> {
val length: Int
fun push(item: T)
fun pop(): T
operator fun get(index: Int): T
operator fun set(index: Int, value: T)
}
(If this is the right thing to do, shouldn't it be in kotlinjs stdlib and mentioned somewhere in docs? 🤔)patrickdelconte
12/08/2017, 12:39 PMCody Sehl
12/08/2017, 5:47 PMcompileKotlin2Js
does? It doesn't seem to be well documented and ideally, I'd like to find the source to see how it works, but searching for the kotlin2js
plugin yields nothingCody Sehl
12/08/2017, 11:08 PMfriend modules
are?dierre
12/09/2017, 8:43 PMgaetan
12/12/2017, 12:07 PMfun main(args: Array<String>) {
println(val1) //<- prints undefined in Js, "i am not null" inside JVM
}
val val1 = fun1()
fun fun1()= fun2()
val val2 = "i am not null"
fun fun2(): String = val2
https://try.kotlinlang.org/#/UserProjects/boih6su9togjanq26leoqbdm6r/k5vdcs8ss8l19pruqhvcbv7akjsnrostov
12/12/2017, 9:27 PMnapperley
12/12/2017, 9:38 PMnatpryce
12/12/2017, 10:22 PMandreasmattsson
12/14/2017, 5:59 PM*-common-js
gradle subproject that gets imported in a version of the app that I would like to be able to run both headlessly (e.g. with node) or in a browser.
I thought perhaps I could check if kotlin.browser.window
and compare it with either null
or kotlin.js.undefined
, however both these give me ReferenceError: window is not defined
eldc
12/14/2017, 7:45 PMspierce7
12/16/2017, 7:39 AMNikita Kulikov
12/17/2017, 5:59 PMbenleggiero
12/18/2017, 12:52 AMNikita Kulikov
12/19/2017, 8:26 AMAnimusNull
12/19/2017, 10:17 AMchi
12/19/2017, 4:57 PMkartikpatodi
12/19/2017, 5:17 PMfiliplamparski
12/19/2017, 5:49 PMSemigradsky
12/21/2017, 8:39 AMnatpryce
12/21/2017, 10:22 AMenum class
to control how Kotlin will represent it to native JS code?spand
12/21/2017, 10:41 AMbashor
12/21/2017, 11:00 AMbashor
12/21/2017, 11:00 AMimports
and triple-slash directives like /// <reference path="..." />
AnimusNull
12/21/2017, 12:01 PM