JS introduce marker annotation

This commit is contained in:
Sergey Mashkov
2015-04-30 15:34:27 +03:00
committed by Sergey Mashkov
parent e2d663b288
commit e84aa78ac6
3 changed files with 10 additions and 4 deletions
@@ -205,11 +205,14 @@ private fun <O : Appendable> O.renderFunction(allTypes: Set<String>, f: Generate
appendln(") : ${f.returnType.mapUnknownType(allTypes)} = noImpl")
}
fun <O : Appendable> O.render(allTypes: Map<String, GenerateTraitOrClass>, classesToUnions : Map<String, List<UnionType>>, iface: GenerateTraitOrClass) {
fun <O : Appendable> O.render(allTypes: Map<String, GenerateTraitOrClass>, classesToUnions : Map<String, List<UnionType>>, iface: GenerateTraitOrClass, markerAnnotation : Boolean = false) {
val superTypes = iface.allSuperTypes(allTypes).filter { it.name != "" }
val superTypesNames = superTypes.map { it.name }.toSet()
append("native ")
if (markerAnnotation) {
append("marker ")
}
when (iface.type) {
GenerateDefinitionType.CLASS -> append("open class ")
GenerateDefinitionType.TRAIT -> append("trait ")
@@ -267,6 +270,6 @@ fun <O : Appendable> O.render(ifaces: List<GenerateTraitOrClass>) {
}
unionTypeTraits.forEach {
render(all, emptyMap(), it)
render(all, emptyMap(), it, markerAnnotation = true)
}
}