IR: Move annotation @JsExport to common source set in stdlib #KT-35966

This commit is contained in:
Abduqodiri Qurbonzoda
2020-03-31 05:12:47 +03:00
parent 4a7b1b210a
commit f2c05bf82c
3 changed files with 42 additions and 20 deletions
@@ -12,4 +12,36 @@ import kotlin.annotation.AnnotationTarget.*
*/
@Target(CLASS, FUNCTION, PROPERTY, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER)
@OptionalExpectation
public expect annotation class JsName(val name: String)
public expect annotation class JsName(val name: String)
/**
* Marks experimental JS export annotations.
*
* Note that behavior of these annotations will likely be changed in the future.
*
* Usages of such annotations will be reported as warnings unless an explicit opt-in with
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalJsExport::class)`,
* or with the `-Xopt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.WARNING)
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@MustBeDocumented
@Retention(AnnotationRetention.BINARY)
@SinceKotlin("1.4")
public annotation class ExperimentalJsExport
/**
* Exports top-level declaration.
*
* Compiler exports from the module those top-level declarations that are marked with this annotation.
* There is no effect if this annotation is applied to a non-top-level declaration.
*
* This annotation has effect only on top-level declarations and only in IR-based JS backend.
*/
@ExperimentalJsExport
@Retention(AnnotationRetention.BINARY)
@Target(CLASS, PROPERTY, FUNCTION, FILE)
@SinceKotlin("1.4")
@OptionalExpectation
public expect annotation class JsExport()
+6 -19
View File
@@ -161,29 +161,16 @@ public annotation class JsNonModule
@Target(AnnotationTarget.FILE)
public annotation class JsQualifier(val value: String)
/**
* Marks experimental JS export annotations.
*
* Note that behaviour of these annotations will likely be changed in the future.
*
* Usages of such annotations will be reported as warnings unless an explicit opt-in with
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalJsExport::class)`,
* or with the `-Xopt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.WARNING)
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@SinceKotlin("1.3")
public annotation class ExperimentalJsExport
/**
* Exports top-level declaration.
*
* Used in future IR-based backend.
* Has no effect in current JS backend.
* Compiler exports from the module those top-level declarations that are marked with this annotation.
* There is no effect if this annotation is applied to a non-top-level declaration.
*
* This annotation has effect only on top-level declarations and only in IR-based JS backend.
*/
@ExperimentalJsExport
@SinceKotlin("1.3")
@Retention(AnnotationRetention.BINARY)
@Target(CLASS, PROPERTY, FUNCTION, FILE)
public annotation class JsExport
@SinceKotlin("1.3")
public actual annotation class JsExport
@@ -3045,6 +3045,9 @@ public final class kotlin/io/TextStreamsKt {
public static final fun useLines (Ljava/io/Reader;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
}
public abstract interface annotation class kotlin/js/ExperimentalJsExport : java/lang/annotation/Annotation {
}
public final class kotlin/jvm/JvmClassMappingKt {
public static final fun getAnnotationClass (Ljava/lang/annotation/Annotation;)Lkotlin/reflect/KClass;
public static final fun getJavaClass (Ljava/lang/Object;)Ljava/lang/Class;