[JS IR] Take into account file annotations for calculating symbol hashes

^KT-55367 Fixed
This commit is contained in:
Alexander Korepanov
2022-12-09 13:06:34 +01:00
committed by Space Team
parent 4136189114
commit 48daf0befe
39 changed files with 280 additions and 81 deletions
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 3; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 0; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 2; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 1; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 5; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,8 @@
(function (_) {
'use strict';
function externalDemoFunction() { return 4; }
_.externalDemoFunction = externalDemoFunction;
return _
}(module.exports));
@@ -0,0 +1,3 @@
@file:JsModule("js-module-a")
external fun externalDemoFunction(): Int
@@ -0,0 +1 @@
@file:JsModule("js-module-a")
@@ -0,0 +1,3 @@
@file:JsModule("js-module-a-new")
external fun externalDemoFunction(): Int
@@ -0,0 +1 @@
@file:JsModule("js-module-b")
@@ -0,0 +1,3 @@
@file:JsModule("js-module-b")
external fun externalDemoFunction(): Int
@@ -0,0 +1,3 @@
@file:JsModule("js-module-b-new")
external fun externalDemoFunction(): Int
@@ -0,0 +1 @@
fun demoFunction() = externalDemoFunction()
@@ -0,0 +1 @@
fun demoFunction() = -1
@@ -0,0 +1,32 @@
STEP 0:
modifications:
U : JsModuleA.0.kt -> JsModuleA.kt
U : JsModuleB.0.kt -> JsModuleB.kt
U : demo.0.kt -> demo.kt
added file: JsModuleA.kt, JsModuleB.kt, demo.kt
STEP 1:
modifications:
U : JsModuleA.1.kt -> JsModuleA.kt
U : JsModuleB.1.kt -> JsModuleB.kt
modified ir: JsModuleA.kt, JsModuleB.kt
updated imports: demo.kt
STEP 2:
modifications:
U : JsModuleB.2.kt -> JsModuleB.kt
modified ir: JsModuleB.kt
updated imports: demo.kt
STEP 3:
modifications:
U : demo.3.kt -> demo.kt
modified ir: demo.kt
STEP 4:
modifications:
U : JsModuleA.4.kt -> JsModuleA.kt
U : JsModuleB.0.kt -> JsModuleB.kt
modified ir: JsModuleA.kt, JsModuleB.kt
STEP 5:
modifications:
U : JsModuleA.1.kt -> JsModuleA.kt
modified ir: JsModuleA.kt
updated exports: JsModuleA.kt
STEP 6:
@@ -0,0 +1,3 @@
@file:JsModule("js-module-c")
external fun externalDemoFunction(): Int
@@ -0,0 +1,3 @@
@file:JsModule("js-module-c-new")
external fun externalDemoFunction(): Int
@@ -0,0 +1,28 @@
STEP 0:
dependencies: lib1
modifications:
U : test.0.kt -> test.kt
added file: test.kt
STEP 1..2:
dependencies: lib1
STEP 3:
dependencies: lib1
modifications:
U : test.3.kt -> test.kt
modified ir: test.kt
STEP 4:
dependencies: lib1
updated imports: test.kt
STEP 5:
dependencies: lib1
modifications:
U : JsModuleC.5.kt -> JsModuleC.kt
added file: JsModuleC.kt
updated exports: JsModuleC.kt
updated imports: test.kt
STEP 6:
dependencies: lib1
modifications:
U : JsModuleC.6.kt -> JsModuleC.kt
modified ir: JsModuleC.kt
updated imports: test.kt
@@ -0,0 +1 @@
fun testFunction() = demoFunction()
@@ -0,0 +1 @@
fun testFunction() = externalDemoFunction() + 1
@@ -0,0 +1,7 @@
fun box(stepId: Int): String {
val x = testFunction()
if (x != stepId) {
return "Fail: $x != $stepId"
}
return "OK"
}
@@ -0,0 +1,5 @@
STEP 0:
dependencies: lib1, lib2
added file: m.kt
STEP 1..6:
dependencies: lib1, lib2
@@ -0,0 +1,14 @@
MODULES: lib1, lib2, main
STEP 0:
libs: lib1, lib2, main
dirty js: lib1, lib2, main
STEP 1..2:
libs: lib1, lib2, main
dirty js: lib1
STEP 3..5:
libs: lib1, lib2, main
dirty js: lib1, lib2
STEP 6:
libs: lib1, lib2, main
dirty js: lib2