gildor
01/16/2018, 5:02 AMfun Any.hasOwnProperty(property: String): Boolean {
return asDynamic().hasOwnProperty(property) == true
}
gildor
01/16/2018, 5:07 AMinfix fun String.`in`(obj: Any): Boolean {
return obj.asDynamic().hasOwnProperty(this) == true
}
// "ontouchstart" `in` window
but I like first option moreanton.bannykh
01/16/2018, 2:28 PMp in this
, not to p in $receiver
. Thus the temporary obj
variable.yaakov
01/16/2018, 6:00 PMgildor
01/17/2018, 12:56 AMJurriaan Mous
01/17/2018, 3:16 PMe: $PATH: Name contains illegal chars that can't appear in JavaScript identifier
:js:compileTestKotlin2Js FAILED
From the style guide:
https://kotlinlang.org/docs/reference/coding-conventions.html#names-for-test-methods
In tests (and only in tests), it's acceptable to use method names with spaces enclosed in backticks. (Note that such method names are currently not supported by the Android runtime.) Underscores in method names are also allowed in test code.
It only mentions that this is not working in Android so I assume it should work in JS.
Am I doing something wrong or are they not supported at the moment?
Using Kotlin 1.2.20actsasgeek
01/17/2018, 9:40 PM./gradle build
and it builds but in IntelliJ itself, when I’m in the Kotlin file, it says, in a greenish bar, “Kotlin not configured” and I can’t figure out what isn’t configured.actsasgeek
01/17/2018, 10:22 PMspierce7
01/18/2018, 3:42 PMDeactivated User
01/18/2018, 7:39 PMMemorySyncStreamBase.prototype.read_4m9kcn$ = function (position, buffer, offset, len) {
var tmp$;
this.checkPosition_s8cxhz$(position);
tmp$ = this.length;
if (!((0).lessThanOrEqual(position) && position.lessThan(tmp$)))
return 0;
var end = min(Math_0, this.length, position.add(Kotlin.Long.fromInt(len)));
var a = end.subtract(position).toInt();
var actualLen = Math_0.max(a, 0);
arraycopy(this.data.data, position.toInt(), buffer, offset, actualLen);
return actualLen;
};
0.lessThanOrEqual(position) <--
if (!((0).lessThanOrEqual(position) && position.lessThan(tmp$)))
return 0;
TypeError: 0.lessThanOrEqual is not a function
at MemorySyncStreamBase.read_4m9kcn$ (korio-js.js:23710:15)
at SliceSyncStreamBase.read_4m9kcn$ (korio-js.js:23581:30)
at SyncStream.read_mj6st8$ (korio-js.js:23499:26)
at readBytes_0 (korio-js.js:23847:36)
at readString_0 (korio-js.js:23805:23)
at ImageFormats.readImage_1ooaqm$$default (korim-js.js:6284:85)
at ImageFormats.ImageFormat.readImage_1ooaqm$ (korim-js.js:5666:65)
at ImageFormats.ImageFormat.read_zdd1ed$ (korim-js.js:5759:17)
at Coroutine$ImageFormat$decodeInWorker$lambda.doResume (korim-js.js:5933:48)
at korim-js.js:5911:25
at KorioNative.executeInWorker_lnyleu$ (korio-js.js:38407:12)
at executeInWorker (korio-js.js:6831:38)
at ImageFormats.ImageFormat.decodeInWorker_nwlife$ (korim-js.js:5953:12)
at Coroutine$readBitmapNoNative_0.doResume (korim-js.js:9536:48)
at Coroutine$readBitmapNoNative_0.CoroutineImpl.doResumeWrapper_0 (kotlin.js:3630:27)
jw
01/19/2018, 12:57 AMfitzoh
01/19/2018, 2:36 AMAlex Fridlyand
01/19/2018, 10:40 AMspierce7
01/19/2018, 4:50 PMPlatform.select({
ios: 'iOS',
android: 'android',
});
spierce7
01/21/2018, 7:49 PMbirgersp
01/22/2018, 1:01 PMbirgersp
01/22/2018, 2:24 PMmarcinmoskala
01/23/2018, 7:34 AMfun `This is my function name`() {}
are not allowed in JS. Are they going to be?mmaillot
01/23/2018, 9:37 PMbenleggiero
01/24/2018, 2:44 AMError (51, 5): Kotlin: Overriding `external` function with optional parameters
Hugh Bollen
01/24/2018, 4:07 AMsteamstreet
01/24/2018, 5:35 AMFilipp Riabchun
01/25/2018, 10:02 AMMichael Kotlikov
01/25/2018, 12:04 PM
into an element? it keeps appearing as normal text😞timm
01/30/2018, 4:55 PMrellenberger
01/31/2018, 5:21 PMmmaillot
01/31/2018, 8:44 PMval expressLib = require("express")
class Express(val app: dynamic = expressLib()) {
fun get(route: String, callback: (req: Request, res: Response) -> Unit) {
app.get(route, { req, res ->
val request = Request(req)
val response = Response(res)
callback(request, response)
});
}
}
class Response(private val responseJs: dynamic) {
fun send(data: String): Response {
return Response(responseJs.send(data))
}
fun json(data: Any): Response {
return Response(responseJs.send(data))
}
}
Is it a good approach ?spierce7
02/01/2018, 1:37 AMgaetan
02/01/2018, 12:28 PMfun main(args: Array<String>) {
sayHello().talk()
}
fun sayHello() = HelloGenerator().apply {
//talk = this::helloFunction // <- OK on jvz and js
talk = ::helloFunction // <- OK on jvm, KO on js
}
class HelloGenerator {
var talk: () -> Unit = ::helloFunction
fun helloFunction() { println("hello world") }
}
spierce7
02/01/2018, 6:27 PM