[JS IR BE] support CharSequence and String methods

This commit is contained in:
Anton Bannykh
2018-09-19 17:09:26 +03:00
parent 3e90d367f2
commit beaf6df8c5
40 changed files with 67 additions and 42 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val cs: CharSequence = "abcd"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = "abcd"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = "abcd"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = "abcd"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// DONT_RUN_GENERATED_CODE: JS
fun escapeChar(c : Char) : String? = when (c) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun StringBuilder.first() = this.get(0)
fun foo() = StringBuilder("foo").first()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
val list = ArrayList<String>()
list.add("0")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
val c: Char? = '0'
c!!.toInt()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
val s: String? = "abc"
val c = s?.get(0)!! - 'b'
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(i : Int?, a : Any?) {
i?.plus(1)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// Auto-generated by GenerateInRangeExpressionTestData. Do not edit!
// WITH_RUNTIME
@@ -1,9 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JVM_IR or not
// IGNORE_BACKEND: JVM_IR
// TODO: muted automatically, investigate should it be ran for JS_IR or not
// IGNORE_BACKEND: JS_IR
// Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun test(s: CharSequence): Int {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
import kotlin.test.*
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,9 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JVM_IR or not
// IGNORE_BACKEND: JVM_IR
// TODO: muted automatically, investigate should it be ran for JS_IR or not
// IGNORE_BACKEND: JS_IR
// Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!
// WITH_RUNTIME
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun foo(): Int {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Thing(delegate: CharSequence) : CharSequence by delegate
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
val sb = StringBuilder("OK")
return "${sb.get(0)}${sb[1]}"
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// KT-5956 java.lang.AbstractMethodError: test.Thing.subSequence(II)Ljava/lang/CharSequence
class Thing(val delegate: CharSequence) : CharSequence {