File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
androidMain/kotlin/dev/icerock/moko/javascript
iosMain/kotlin/dev/icerock/moko/javascript Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ android {
3333dependencies {
3434 androidMainImplementation(libs.ziplineAndroid)
3535 commonMainImplementation(libs.kotlinSerialization)
36+
3637 commonTestImplementation(libs.kotlinTest)
3738 commonTestImplementation(libs.kotlinTestAnnotations)
3839 commonTestImplementation(libs.mokoTest)
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import kotlinx.serialization.json.JsonElement
1515import kotlinx.serialization.json.JsonObject
1616
1717@OptIn(EngineApi ::class )
18- actual class JavaScriptEngine actual constructor() {
18+ actual class JavaScriptEngine {
1919
2020 private val json: Json = Json
2121 private val jsContext: ContextProviderDynamic = ContextProviderDynamic ()
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import platform.JavaScriptCore.JSContext
2626import platform.JavaScriptCore.JSValue
2727import platform.JavaScriptCore.setObject
2828
29- actual class JavaScriptEngine actual constructor() {
29+ actual class JavaScriptEngine {
3030
3131 private val jsContext = JSContext ().apply {
3232 exceptionHandler = { exceptionContext, exception ->
@@ -162,7 +162,7 @@ private fun Any?.toJsonElement(): JsonElement {
162162 is NSString -> JsonPrimitive (this as String )
163163 is NSNumber -> JsonPrimitive (this .doubleValue)
164164 is NSDictionary -> (this as Map <Any ?, * >).toJson()
165- is NSArray -> ( this as List <* >).map { it.toJsonElement() }. let { JsonArray (it) }
165+ is NSArray -> JsonArray (( this as List <* >).map { it.toJsonElement() })
166166 else -> throw IllegalArgumentException (" unknown JSValue type $this " )
167167 }
168168}
You can’t perform that action at this time.
0 commit comments