diff --git a/js/js.libraries/src/core/dom.kt b/js/js.libraries/src/core/dom.kt index a6600897ad9..6516c9886c2 100644 --- a/js/js.libraries/src/core/dom.kt +++ b/js/js.libraries/src/core/dom.kt @@ -93,7 +93,7 @@ native public trait DOMError { public val relatedException: Any public val severity: Short - class object { + public class object { public val SEVERITY_WARNING: Short = 1 public val SEVERITY_ERROR: Short = 2 public val SEVERITY_FATAL_ERROR: Short = 3 @@ -221,7 +221,7 @@ native public trait Node { public fun lookupNamespaceURI(arg1: String?): String = js.noImpl public fun isEqualNode(arg1: Node): Boolean = js.noImpl - class object { + public class object { public val ELEMENT_NODE: Short = 1 public val ATTRIBUTE_NODE: Short = 2 public val TEXT_NODE: Short = 3 @@ -270,7 +270,7 @@ native public trait TypeInfo { public val typeNamespace: String public fun isDerivedFrom(arg1: String?, arg2: String?, arg3: Int): Boolean = js.noImpl - class object { + public class object { public val DERIVATION_RESTRICTION: Int = 1 public val DERIVATION_EXTENSION: Int = 2 public val DERIVATION_UNION: Int = 4 @@ -281,7 +281,7 @@ native public trait TypeInfo { native public trait UserDataHandler { public fun handle(arg1: Short, arg2: String?, arg3: Any, arg4: Node, arg5: Node): Unit = js.noImpl - class object { + public class object { public val NODE_CLONED: Short = 1 public val NODE_IMPORTED: Short = 2 public val NODE_DELETED: Short = 3 diff --git a/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollections.kt b/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollections.kt index 582943aa31e..cacc241db01 100644 --- a/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollections.kt +++ b/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollections.kt @@ -26,29 +26,3 @@ public inline fun > java.lang.Iterable.mapTo(result result.add(transform(item)) return result } - -// -// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt -// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib -// -// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt -// - - -import java.util.* - -// -// This file contains methods which are optimised for working on Collection / Array collections where the size -// could be used to implement a more optimal solution -// -// See [[GenerateStandardLib.kt]] for more details -// - -/** - * Returns a new List containing the results of applying the given *transform* function to each element in this collection - * - * @includeFunctionBody ../../test/CollectionTest.kt map - */ -public inline fun java.lang.Iterable.map(transform : (T) -> R) : java.util.List { - return mapTo(java.util.ArrayList(), transform) -} diff --git a/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollectionsJVM.kt b/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollectionsJVM.kt new file mode 100644 index 00000000000..3ad847c1bce --- /dev/null +++ b/libraries/stdlib/src/generated/JUtilIterablesFromJUtilCollectionsJVM.kt @@ -0,0 +1,27 @@ +package kotlin + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// +// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt +// + + +import java.util.* + +// +// This file contains methods which are optimised for working on Collection / Array collections where the size +// could be used to implement a more optimal solution +// +// See [[GenerateStandardLib.kt]] for more details +// + +/** + * Returns a new List containing the results of applying the given *transform* function to each element in this collection + * + * @includeFunctionBody ../../test/CollectionTest.kt map + */ +public inline fun java.lang.Iterable.map(transform : (T) -> R) : java.util.List { + return mapTo(java.util.ArrayList(), transform) +} diff --git a/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterables.kt b/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterables.kt index cade276358b..d6a477702ee 100644 --- a/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterables.kt +++ b/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterables.kt @@ -261,17 +261,3 @@ public inline fun java.util.Iterator.toSortedList(transform: fun(T) : return answer } */ - -// -// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt -// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib -// -// Generated from input file: src/kotlin/JLangIterablesJVM.kt -// - - -import java.util.* - -/** Copies all elements into a [[SortedSet]] */ -public inline fun java.util.Iterator.toSortedSet() : SortedSet = toCollection(TreeSet()) - diff --git a/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterablesJVM.kt b/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterablesJVM.kt new file mode 100644 index 00000000000..beaceccad45 --- /dev/null +++ b/libraries/stdlib/src/generated/JUtilIteratorsFromJLangIterablesJVM.kt @@ -0,0 +1,15 @@ +package kotlin + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// +// Generated from input file: src/kotlin/JLangIterablesJVM.kt +// + + +import java.util.* + +/** Copies all elements into a [[SortedSet]] */ +public inline fun java.util.Iterator.toSortedSet() : SortedSet = toCollection(TreeSet()) + diff --git a/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateJavaScriptStubs.kt b/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateJavaScriptStubs.kt index 6a990b16e98..e0681dace5d 100644 --- a/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateJavaScriptStubs.kt +++ b/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateJavaScriptStubs.kt @@ -124,7 +124,7 @@ import js.noImpl if (fields != null) { if (fields.notEmpty()) { println("") - println(" class object {") + println(" public class object {") for (field in fields) { if (field != null) { val modifiers = field.getModifiers() diff --git a/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateStandardLib.kt b/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateStandardLib.kt index eb24787714b..1b2f20bc72c 100644 --- a/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateStandardLib.kt +++ b/libraries/stdlib/test/org/jetbrains/kotlin/tools/GenerateStandardLib.kt @@ -106,7 +106,10 @@ fun main(args: Array) { it.replaceAll("java.lang.Iterable) { } } - generateFile(File(outDir, "JUtilIterablesFromJUtilCollections.kt"), "package kotlin", File(srcDir, "JUtilCollections.kt"), File(srcDir, "JUtilCollectionsJVM.kt")) { + generateFile(File(outDir, "JUtilIterablesFromJUtilCollections.kt"), "package kotlin", File(srcDir, "JUtilCollections.kt")) { + it.replaceAll("java.util.Collection