[K/JS] Remove declarations with @JsExport.Ignore from klib explicit roots

This commit is contained in:
Artem Kobzar
2023-07-17 15:11:47 +00:00
committed by Space Team
parent 6edfda0204
commit df0e4e0b53
2 changed files with 8 additions and 1 deletions
@@ -39,9 +39,14 @@ class JsIrFileSerializer(
) {
companion object {
private val JS_EXPORT_FQN = FqName("kotlin.js.JsExport")
private val JS_EXPORT_IGNORE_FQN = FqName("kotlin.js.JsExport.Ignore")
}
override fun backendSpecificExplicitRoot(node: IrAnnotationContainer): Boolean {
return node.annotations.hasAnnotation(JS_EXPORT_FQN)
return node.annotations.hasAnnotation(JS_EXPORT_FQN) && !backendSpecificExplicitRootExclusion(node)
}
override fun backendSpecificExplicitRootExclusion(node: IrAnnotationContainer): Boolean {
return node.annotations.hasAnnotation(JS_EXPORT_IGNORE_FQN)
}
}