[K/JS] Add serialization/deserialization for JsImport/JsExport nodes
This commit is contained in:
+2
@@ -0,0 +1,2 @@
|
||||
data class Demo(val x: Int) {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
class Demo(val x: Int) {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
inline class Demo(val x: Int) {
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : l1.0_data_class.kt -> l1.kt
|
||||
added file: l1.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : l1.1_simple_class.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 2:
|
||||
modifications:
|
||||
U : l1.2_inline_class.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 3:
|
||||
modifications:
|
||||
U : l1.1_simple_class.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
@@ -0,0 +1,18 @@
|
||||
fun box(stepId: Int): String {
|
||||
val d = Demo(15)
|
||||
when (stepId) {
|
||||
0, 2 -> {
|
||||
if (!testEquals(d, Demo(15))) return "Fail equals"
|
||||
if (testHashCode(d) != Demo(15).hashCode()) return "Fail hashCode"
|
||||
if (testToString(d) != "Demo(x=15)") return "Fail toString"
|
||||
}
|
||||
1, 3-> {
|
||||
if (testEquals(d, Demo(15))) return "Fail equals"
|
||||
if (testHashCode(d) == Demo(15).hashCode()) return "Fail hashCode"
|
||||
if (testToString(d) != "[object Object]") return "Fail toString"
|
||||
}
|
||||
else -> return "Unknown"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
added file: m.kt, testEquals.kt, testHashCode.kt, testToString.kt
|
||||
STEP 1..3:
|
||||
dependencies: lib1
|
||||
updated imports: m.kt, testEquals.kt, testHashCode.kt, testToString.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun testEquals(lhs: Demo, rhs: Demo): Boolean {
|
||||
return lhs == rhs
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun testHashCode(d: Demo): Int {
|
||||
return d.hashCode()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun testToString(d: Demo): String {
|
||||
return d.toString()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
MODULES: lib1, main
|
||||
MODULE_KIND: es
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 1..3:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
Reference in New Issue
Block a user