All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.seskar.compiler.event.backend.JsEvent.kt Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
package seskar.compiler.event.backend

import org.jetbrains.kotlin.ir.declarations.IrProperty
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.util.getAnnotation
import org.jetbrains.kotlin.ir.util.getValueArgument
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name

private val JS_EVENT = FqName("web.events.JsEvent")
private val TYPE = Name.identifier("type")

internal fun IrProperty.eventType(): String? {
    val event = getAnnotation(JS_EVENT)
        ?: return null

    val type = event.getValueArgument(TYPE) as IrConst
    return type.value as String
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy