Fix js-stdlib compilation and tests.

This commit is contained in:
Ilya Gorbunov
2015-03-20 16:30:53 +03:00
parent 4c58f4ec20
commit 5b2a5c78ca
4 changed files with 26 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
/*
* 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.js
// 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]")
+1 -1
View File
@@ -37,7 +37,7 @@ public trait Appendable {
}
library
public class StringBuilder() : Appendable {
public class StringBuilder(capacity: Int? = null) : Appendable {
override fun append(c: Char): StringBuilder = noImpl
override fun append(csq: CharSequence?): StringBuilder = noImpl
override fun append(csq: CharSequence?, start: Int, end: Int): StringBuilder = noImpl
+2 -1
View File
@@ -31,7 +31,8 @@ native public fun String.concat(str : String) : String = noImpl
native public fun String.match(regex : String) : Array<String> = noImpl
native public fun String.trim() : String = noImpl
//native public fun String.trim() : String = noImpl
//TODO: String.replace to implement effective trimLeading and trimTrailing
native("length")
public val CharSequence.size: Int get() = noImpl