Targeting / retention for a set of standard annotations, some inapplicable annotation checks replaced with target check, some fixed tests
This commit is contained in:
@@ -16,21 +16,34 @@
|
||||
|
||||
package kotlin.js
|
||||
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
|
||||
native
|
||||
target(CLASSIFIER, FUNCTION, PROPERTY, CONSTRUCTOR, VALUE_PARAMETER)
|
||||
public annotation class native(public val name: String = "")
|
||||
|
||||
native
|
||||
target(FUNCTION)
|
||||
public annotation class nativeGetter
|
||||
|
||||
native
|
||||
target(FUNCTION)
|
||||
public annotation class nativeSetter
|
||||
|
||||
native
|
||||
target(FUNCTION)
|
||||
public annotation class nativeInvoke
|
||||
|
||||
native
|
||||
target(CLASSIFIER, FUNCTION, PROPERTY)
|
||||
public annotation class library(public val name: String = "")
|
||||
|
||||
native
|
||||
target(PROPERTY)
|
||||
public annotation class enumerable()
|
||||
|
||||
// TODO make it "internal" or "fake"
|
||||
native
|
||||
target(CLASSIFIER)
|
||||
deprecated("Do not use this annotation: it is for internal use only")
|
||||
public annotation class marker
|
||||
@@ -17,4 +17,5 @@
|
||||
package kotlin.jvm
|
||||
|
||||
// is used in common generated code in stdlib
|
||||
internal annotation class jvmOverloads
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
|
||||
internal annotation(retention = AnnotationRetention.SOURCE) class jvmOverloads
|
||||
|
||||
@@ -24,9 +24,11 @@ import kotlin.InlineOption.ONLY_LOCAL_RETURN
|
||||
// They was reserved word in ECMAScript 2, but is not since ECMAScript 5.
|
||||
|
||||
native
|
||||
public annotation class volatile
|
||||
target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
|
||||
public annotation(retention = AnnotationRetention.SOURCE) class volatile
|
||||
|
||||
native
|
||||
public annotation class synchronized
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.SOURCE) class synchronized
|
||||
|
||||
public inline fun <R> synchronized(lock: Any, @inlineOptions(ONLY_LOCAL_RETURN) block: () -> R): R = block()
|
||||
|
||||
Reference in New Issue
Block a user