[K/JS] Remove declarations with @JsExport.Ignore from klib explicit roots
This commit is contained in:
+2
@@ -1359,6 +1359,7 @@ open class IrFileSerializer(
|
|||||||
.build()
|
.build()
|
||||||
|
|
||||||
open fun backendSpecificExplicitRoot(node: IrAnnotationContainer): Boolean = false
|
open fun backendSpecificExplicitRoot(node: IrAnnotationContainer): Boolean = false
|
||||||
|
open fun backendSpecificExplicitRootExclusion(node: IrAnnotationContainer): Boolean = false
|
||||||
open fun keepOrderOfProperties(property: IrProperty): Boolean = !property.isConst
|
open fun keepOrderOfProperties(property: IrProperty): Boolean = !property.isConst
|
||||||
open fun backendSpecificSerializeAllMembers(irClass: IrClass) = false
|
open fun backendSpecificSerializeAllMembers(irClass: IrClass) = false
|
||||||
|
|
||||||
@@ -1376,6 +1377,7 @@ open class IrFileSerializer(
|
|||||||
|
|
||||||
if (backendSpecificExplicitRoot(file)) {
|
if (backendSpecificExplicitRoot(file)) {
|
||||||
for (declaration in file.declarations) {
|
for (declaration in file.declarations) {
|
||||||
|
if (backendSpecificExplicitRootExclusion(declaration)) continue
|
||||||
proto.addExplicitlyExportedToCompiler(serializeIrSymbol(declaration.symbol))
|
proto.addExplicitlyExportedToCompiler(serializeIrSymbol(declaration.symbol))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+6
-1
@@ -39,9 +39,14 @@ class JsIrFileSerializer(
|
|||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
private val JS_EXPORT_FQN = FqName("kotlin.js.JsExport")
|
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 {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user