JS backend: fix StringBuilder append #KT-4064 Fixed

This commit is contained in:
Erokhin Stanislav
2013-10-11 15:47:43 +04:00
parent 768289b913
commit e05e616158
3 changed files with 18 additions and 0 deletions
@@ -62,4 +62,8 @@ public final class StandardClassesTest extends SingleFileTranslationTest {
public void testArrayFactoryMethods() throws Exception {
checkFooBoxIsOk();
}
public void testStringBuilder() throws Exception {
checkFooBoxIsOk();
}
}
+1
View File
@@ -510,6 +510,7 @@ String.prototype.contains = function (s) {
}, {
append:function (obj) {
this.string = this.string + obj.toString();
return this;
},
toString:function () {
return this.string;
@@ -0,0 +1,13 @@
package foo
import java.util.StringBuilder
fun box(): String {
val s = StringBuilder()
s.append("a")
s.append("b")?.append("c")
s.append("d")!!.append("e")
if (s.toString() != "abcde") return s.toString()
return "OK"
}