JS: add more tests

This commit is contained in:
Anton Bannykh
2018-07-08 22:46:01 +03:00
committed by Anton Bannykh
parent 0579b52d6b
commit cf9ad635e1
14 changed files with 585 additions and 55 deletions
@@ -3,6 +3,7 @@
// WITH_RUNTIME
// WITH_COROUTINES
// NO_CHECK_LAMBDA_INLINING
// TARGET_BACKEND: JVM
suspend inline fun test1(c: () -> Unit) {
c()
@@ -2,13 +2,18 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS
import COROUTINES_PACKAGE.*
import helpers.*
// Block is allowed to be called inside the body of owner inline function
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
// Needed for JS compatibility
interface Runnable {
fun run(): Unit
}
suspend inline fun test1(crossinline c: () -> Unit) {
c()
}
@@ -2,13 +2,18 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS
import COROUTINES_PACKAGE.*
import helpers.*
// Block is allowed to be called inside the body of owner inline function
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
// Needed for JS compatibility
interface Runnable {
fun run(): Unit
}
suspend inline fun test1(noinline c: () -> Unit) {
c()
}
@@ -3,12 +3,16 @@
// WITH_RUNTIME
// WITH_COROUTINES
// NO_CHECK_LAMBDA_INLINING
object Result {
var a: String = ""
var b: Int = 0
}
// Needed for JS compatibility
interface Runnable {
fun run(): Unit
}
suspend inline fun inlineMe(c: suspend () -> Unit) {
var a = ""
var b = 0
@@ -2,7 +2,7 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// SKIP_SOURCEMAP_REMAPPING
import COROUTINES_PACKAGE.*
import helpers.*
@@ -2,7 +2,7 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// SKIP_SOURCEMAP_REMAPPING
import COROUTINES_PACKAGE.*
import helpers.*
@@ -2,13 +2,18 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS
import COROUTINES_PACKAGE.*
import helpers.*
// Block is allowed to be called inside the body of owner inline function
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
// Needed for JS compatibility
interface Runnable {
fun run(): Unit
}
class Controller {
var res = "FAIL 1"
@@ -2,7 +2,7 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// SKIP_SOURCEMAP_REMAPPING
import COROUTINES_PACKAGE.*
import helpers.*
@@ -2,13 +2,18 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS
import COROUTINES_PACKAGE.*
import helpers.*
// Block is allowed to be called inside the body of owner inline function
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
// Needed for JS compatibility
interface Runnable {
fun run(): Unit
}
class Controller {
var res = "FAIL 1"
@@ -2,7 +2,7 @@
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// SKIP_SOURCEMAP_REMAPPING
import COROUTINES_PACKAGE.*
import helpers.*