[JS IR] Invalidate all klib dependencies after removing it

Without the invalidation, broken JS code
 (with broken cross-module references) may appear.

 ^KT-54911 Fixed
This commit is contained in:
Alexander Korepanov
2022-11-21 15:50:52 +01:00
committed by Space Team
parent ca19d71a00
commit 693258ae91
41 changed files with 402 additions and 150 deletions
@@ -0,0 +1 @@
fun fooA() = 1
@@ -0,0 +1,10 @@
STEP 0:
STEP 1:
modifications:
U : l1a.1.kt -> l1a.kt
added file: l1a.kt
STEP 2..3:
STEP 4:
modifications:
D : l1a.kt
STEP 5:
@@ -0,0 +1 @@
fun fooB() = 2
@@ -0,0 +1 @@
inline fun fooB() = 3
@@ -0,0 +1 @@
inline fun fooB() = 4
@@ -0,0 +1,17 @@
STEP 0:
STEP 1:
modifications:
U : l1b.1.kt -> l1b.kt
added file: l1b.kt
STEP 2:
modifications:
U : l1b.2.kt -> l1b.kt
modified ir: l1b.kt
STEP 2:
modifications:
U : l1b.3.kt -> l1b.kt
modified ir: l1b.kt
STEP 4:
modifications:
D : l1b.kt
STEP 5:
@@ -0,0 +1 @@
fun fooC() = 4
@@ -0,0 +1,10 @@
STEP 0:
STEP 1:
modifications:
U : l1c.1.kt -> l1c.kt
added file: l1c.kt
STEP 2..3:
STEP 4:
modifications:
D : l1c.kt
STEP 5:
@@ -0,0 +1,5 @@
fun fooA() = 3
fun fooB() = 3
fun fooC() = 4
@@ -0,0 +1,5 @@
fun fooA() = 3
fun fooB() = 4
fun fooC() = 4
@@ -0,0 +1 @@
fun fooA() = 1
@@ -0,0 +1 @@
fun fooB() = 2
@@ -0,0 +1 @@
fun fooC() = 3
@@ -0,0 +1,20 @@
STEP 0:
modifications:
U : l1a.0.kt -> l1a.kt
U : l1b.0.kt -> l1b.kt
U : l1c.0.kt -> l1c.kt
added file: l1a.kt, l1b.kt, l1c.kt
STEP 1:
modifications:
D : l1a.kt
D : l1b.kt
D : l1c.kt
STEP 2..3:
STEP 4:
modifications:
U : l1.4.kt -> l1.kt
added file: l1.kt
STEP 5:
modifications:
U : l1.5.kt -> l1.kt
modified ir: l1.kt
@@ -0,0 +1 @@
fun qux() = fooA() + fooB() + fooC() - 6
@@ -0,0 +1,16 @@
STEP 0:
dependencies: lib1
modifications:
U : l2.0.kt -> l2.kt
added file: l2.kt
STEP 1:
dependencies: lib1-a, lib1-b, lib1-c
removed direct depends: l2.kt
STEP 2..3:
dependencies: lib1-a, lib1-b, lib1-c
updated imports: l2.kt
STEP 4:
dependencies: lib1
removed direct depends: l2.kt
STEP 5:
dependencies: lib1
@@ -0,0 +1,7 @@
fun box(stepId: Int): String {
val x = qux()
if (x != stepId) {
return "Fail: $x != $stepId"
}
return "OK"
}
@@ -0,0 +1,7 @@
STEP 0:
dependencies: lib1, lib2
added file: m.kt
STEP 1..3:
dependencies: lib1-a, lib1-b, lib1-c, lib2
STEP 4..5:
dependencies: lib1, lib2
@@ -0,0 +1,17 @@
MODULES: lib1, lib1-a, lib1-b, lib1-c, lib2, main
STEP 0:
libs: lib1, lib2, main
dirty js: lib1, lib2, main
STEP 1:
libs: lib1-a, lib1-b, lib1-c, lib2, main
dirty js: lib1-a, lib1-b, lib1-c, lib2
STEP 2..3:
libs: lib1-a, lib1-b, lib1-c, lib2, main
dirty js: lib1-b, lib2
STEP 4:
libs: lib1, lib2, main
dirty js: lib1, lib2
STEP 5:
libs: lib1, lib2, main
dirty js: lib1