JS: use external modifier instead of @native annotation

This commit is contained in:
Alexey Andreev
2016-11-24 19:39:45 +03:00
parent 0c2da93e5f
commit e0cb56b3c3
3 changed files with 26 additions and 5 deletions
+4
View File
@@ -20,18 +20,22 @@ import kotlin.annotation.AnnotationTarget.*
@native
@Target(CLASS, FUNCTION, PROPERTY, CONSTRUCTOR, VALUE_PARAMETER, PROPERTY_GETTER, PROPERTY_SETTER)
@Deprecated("Use `external` modifier instead")
public annotation class native(@Deprecated public val name: String = "")
@native
@Target(FUNCTION)
@Deprecated
public annotation class nativeGetter
@native
@Target(FUNCTION)
@Deprecated
public annotation class nativeSetter
@native
@Target(FUNCTION)
@Deprecated
public annotation class nativeInvoke
@native
+5 -2
View File
@@ -22,12 +22,15 @@ package kotlin
// so they annotated as 'native' to avoid warnings/errors from some minifiers.
// They was reserved word in ECMAScript 2, but is not since ECMAScript 5.
@native
// Additional note:
// Although it's reasonable to mark these annotations as `@native` (`external` since 1.1),
// we prohibit marking annotations this way.
// TODO: Another workaround is required to remove these annotations from kotlin.js
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
@Retention(AnnotationRetention.SOURCE)
public annotation class Volatile
@native
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
@Retention(AnnotationRetention.SOURCE)
public annotation class Synchronized