[JS IR] Generate debug info for secondary constructors

#KT-46276
This commit is contained in:
Sergej Jaskiewicz
2022-10-25 15:42:26 +02:00
committed by Space Team
parent ec18dce7cb
commit b2b7958b62
3 changed files with 9 additions and 5 deletions
@@ -179,6 +179,8 @@ private fun JsIrBackendContext.buildInitDeclaration(constructor: IrConstructor,
val functionName = "${constructorName}_\$Init\$"
return irFactory.buildFun {
startOffset = constructor.startOffset
endOffset = constructor.endOffset
name = Name.identifier(functionName)
returnType = type
visibility = DescriptorVisibilities.INTERNAL
@@ -201,6 +203,8 @@ private fun JsIrBackendContext.buildFactoryDeclaration(constructor: IrConstructo
val functionName = "${constructorName}_\$Create\$"
return irFactory.buildFun {
startOffset = constructor.startOffset
endOffset = constructor.endOffset
name = Name.identifier(functionName)
returnType = type
visibility = constructor.visibility
+3 -3
View File
@@ -219,12 +219,12 @@ class O<T>(i: T) {
// test.kt:49 L_init_$Init$
// test.kt:13 box
// test.kt:57 M_init_$Init$
// test.kt:61 M_init_$Init$_0
// test.kt:61 M_init_$Init$
// test.kt:56 M
// test.kt:58 M_init_$Init$
// test.kt:14 box
// test.kt:65 N_init_$Init$
// test.kt:69 N_init_$Init$_0
// test.kt:69 N_init_$Init$
// test.kt:64 N
// test.kt:66 N_init_$Init$
// test.kt:15 box
@@ -232,4 +232,4 @@ class O<T>(i: T) {
// test.kt:16 box
// test.kt:73 O_init_$Init$
// test.kt:72 <init>
// test.kt:17 box
// test.kt:17 box
@@ -25,5 +25,5 @@ class C : A {
)
}
// LINES(JS): 1 1 3 * 1 1 1 1 1 1 7 * 9 10 11 * 15 15 16 17 14 19 15 15 22 22 23 24 22 22
// LINES(JS_IR): 1 1 * 3 * 7 7 9 9 10 11 16 17 15 19 * 23 24 23 * 14
// LINES(JS): 1 1 3 * 1 1 1 1 1 1 7 * 9 10 11 * 15 15 16 17 14 19 15 15 22 22 23 24 22 22
// LINES(JS_IR): 1 1 * 3 * 7 7 9 9 10 11 15 16 17 15 19 * 15 * 22 23 24 23 * 22 * 14