JS: replace all usages of @native annotation with external modifier, in tests, stdlib, etc

This commit is contained in:
Alexey Andreev
2016-11-25 12:36:47 +03:00
parent e0cb56b3c3
commit 68412ae94f
173 changed files with 486 additions and 651 deletions
@@ -255,7 +255,7 @@ fun specialJS(): List<GenericFunction> {
templates add f("sort(comparison: (T, T) -> Int)") {
only(ArraysOfObjects, ArraysOfPrimitives)
exclude(PrimitiveType.Boolean)
annotations("@native")
external(true)
returns("Unit")
doc { "Sorts the array in-place according to the order specified by the given [comparison] function." }
body { "noImpl" }
@@ -147,6 +147,7 @@ class GenericFunction(val signature: String, val keyword: String = "fun") {
val returns = FamilyProperty<String>()
val operator = FamilyProperty<Boolean>()
val infix = FamilyProperty<Boolean>()
val external = FamilyProperty<Boolean>()
val body = object : FamilyProperty<String>() {
override fun onKeySet(key: Family) = include(key)
}
@@ -410,6 +411,8 @@ class GenericFunction(val signature: String, val keyword: String = "fun") {
}
builder.append("public ")
if (external[f] == true)
builder.append("external ")
if (inline[f]?.isInline() == true)
builder.append("inline ")
if (infix[f] == true)