krtko
03/16/2018, 12:06 AMexpect class Json {
fun getInt(id: String): Int
But with JS, the native Json class is only an interface so implementing it like:
actual class Json: kotlin.js.Json {
actual fun getInt(id: String): Int {
return this[id] as? Int ?: 0
}
Does not work. Any suggestions?krtko
03/16/2018, 6:02 AMkrtko
03/17/2018, 2:51 AMclass Request(): XMLHttpRequest() {}
This throws an error because the compiled code doesn’t call the XMLHttpRequest constructorenleur
03/17/2018, 11:39 AMgbaldeck
03/17/2018, 3:03 PMgbaldeck
03/18/2018, 12:23 AM-
characterAndrew Gein
03/18/2018, 5:20 AMAndrew Gein
03/19/2018, 6:43 AMdata class Book(val bookId: Int)
val obj = js("{ bookId: 10 }")
val book = obj as Book
Last line fails with ClassCastException
(of course). What is the correct way to do it?jonathan
03/19/2018, 10:50 AMorg.jetbrains.kotlin.frontend
and have "mprogress" as a dependency
.
I've set up this external class:
external class Mprogress(params: Json) {
fun start()
fun end()
fun set(percent: Double)
fun inc()
}
However, when I try to create a new Mprogress object, it says it can't locate Mprogress' JS definition. How can I make sure it's included?gaetan
03/19/2018, 8:47 PMval body = document.querySelector("body").asDynamic()
body.foo = Foo(42)
println(body.foo)
Fré Dumazy
03/19/2018, 9:43 PM.env
in Kotlin (used create-react-kotlin-app with yarn)?chadmorrow
03/20/2018, 6:10 PMjonathan
03/21/2018, 5:19 AMwebpack.config.d
for webpack-dev-server-run.js
, or a way to otherwise manually configure the server for the kotlin frontend gradle plugin?Andrew Gein
03/21/2018, 3:46 PMduplicate target file will be created for 'build/node_modules/kotlin-compiler/lib/kotlin-stdlib-js.jar!kotlin.js' and 'build/node_modules/kotlin-compiler/lib/kotlin-jslib.jar!kotlin.js'
(step :runDceKotlinJs'
) when trying to build my project on Ubuntu. I can build it on Windows. Kotlin version is 1.2.30. Where can be a problem?YMobile
03/22/2018, 9:45 AMspierce7
03/23/2018, 2:47 PMgbaldeck
03/23/2018, 3:46 PMchadmorrow
03/23/2018, 9:22 PMrCorbellini
03/24/2018, 2:03 AMjacob
03/24/2018, 10:56 PMZomis
03/25/2018, 1:14 PMZomis
03/25/2018, 1:16 PMrequire("path/to/mykotlinlib-js")
then I get "These dependencies were not found: kotlin in path/to/mykotlinlib.js", and also such an error about klogging as I'm trying to use the KLogging library for Kotlin.mmaillot
03/26/2018, 3:20 PMObject.getPrototypeOf(input) === Object.prototype
) ?marcinmoskala
03/26/2018, 6:22 PMcubesky
03/27/2018, 2:40 PMef.create(str)
in Javascript. But I want to get a new (ef.create(str))()
, how I can do for this?mmaillot
03/27/2018, 3:41 PMgaetan
03/30/2018, 8:07 AMGerard Klijs
03/30/2018, 9:59 AMTalon
03/30/2018, 5:46 PMdeviant
03/30/2018, 9:10 PM@nativeGetter
in code which is deprecated and message is: "Use inline extension function with body using dynamic" which i don't fully understand.
the code looks like:
@nativeGetter
operator fun get(name: String): FirebaseServiceFactory?
@nativeSetter
operator fun set(name: String, value: FirebaseServiceFactory)