Move code between packages (JS)

This commit is contained in:
Ilya Gorbunov
2015-12-13 18:03:20 +03:00
parent dd2ae15531
commit 871c5c66b4
8 changed files with 43 additions and 27 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package kotlin
package kotlin.text
// actually \s is enough to match all whitespace, but \xA0 added because of different regexp behavior of Rhino used in Selenium tests
public fun Char.isWhitespace(): Boolean = toString().matches("[\\s\\xA0]")
+37
View File
@@ -0,0 +1,37 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kotlin.collections
@library("copyToArray")
public fun <reified T> Collection<T>.toTypedArray(): Array<T> = noImpl
/**
* Returns an immutable list containing only the specified object [element].
*/
public fun <T> listOf(element: T): List<T> = arrayListOf(element)
/**
* Returns an immutable set containing only the specified object [element].
*/
public fun <T> setOf(element: T): Set<T> = hashSetOf(element)
/**
* Returns an immutable map, mapping only the specified key to the
* specified value.
*/
public fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V> = hashMapOf(pair)
-20
View File
@@ -31,26 +31,6 @@ public fun byteArrayOf(vararg elements: Byte): ByteArray = noImpl
@library
public fun booleanArrayOf(vararg elements: Boolean): BooleanArray = noImpl
@library("copyToArray")
public fun <reified T> Collection<T>.toTypedArray(): Array<T> = noImpl
/**
* Returns an immutable list containing only the specified object [element].
*/
public fun <T> listOf(element: T): List<T> = arrayListOf(element)
/**
* Returns an immutable set containing only the specified object [element].
*/
public fun <T> setOf(element: T): Set<T> = hashSetOf(element)
/**
* Returns an immutable map, mapping only the specified key to the
* specified value.
*/
public fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V> = hashMapOf(pair)
/**
* Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].
*/
+1 -1
View File
@@ -1,4 +1,4 @@
package kotlin
package kotlin.collections
//
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package kotlin
package kotlin.sequences
internal class ConstrainedOnceSequence<T>(sequence: Sequence<T>) : Sequence<T> {
@Volatile private var sequenceRef: Sequence<T>? = sequence
+1 -1
View File
@@ -1,4 +1,4 @@
package kotlin
package kotlin.text
import kotlin.text.js.RegExp
+1 -2
View File
@@ -1,6 +1,5 @@
package kotlin
package kotlin.text
import kotlin.text.Regex
import kotlin.text.js.RegExp
internal inline fun String.nativeIndexOf(ch : Char, fromIndex : Int) : Int = nativeIndexOf(ch.toString(), fromIndex)
@@ -35,7 +35,7 @@ fun List<GenericFunction>.writeTo(file: File, builder: GenericFunction.() -> Str
val its = FileWriter(file)
its.use {
its.append("package kotlin\n\n")
its.append("package kotlin.collections\n\n")
its.append("$COMMON_AUTOGENERATED_WARNING\n\n")
its.append("import java.util.*\n\n")
its.append("import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js\n\n")