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
@@ -50,7 +50,7 @@ private fun Appendable.renderAttributeDeclarationAsProperty(arg: GenerateAttribu
indent(commented, level)
if (arg.name in keywords) {
append("@native(\"${arg.name}\") ")
append("@JsName(\"${arg.name}\") ")
}
renderAttributeDeclaration(arg, modality, omitDefaults)
@@ -104,7 +104,7 @@ private fun Appendable.renderFunctionDeclaration(f: GenerateFunction, override:
}
if (f.name in keywords) {
append("@native(\"${f.name}\") ")
append("@JsName(\"${f.name}\") ")
}
append("fun ${f.name.replaceKeywords()}")
renderArgumentsDeclaration(f.arguments, override)
@@ -120,7 +120,7 @@ private fun GenerateAttribute.isRequiredFunctionArgument(owner: String, function
private fun GenerateFunction.fixRequiredArguments(parent: String) = copy(arguments = arguments.map { arg -> arg.copy(initializer = if (arg.isRequiredFunctionArgument(parent, name)) null else arg.initializer) })
fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUnions: Map<String, List<String>>, iface: GenerateTraitOrClass, markerAnnotation: Boolean = false) {
append("@native public ")
append("public external ")
if (markerAnnotation) {
append("@marker ")
}