JS: prototyping coroutines

This commit is contained in:
Alexey Andreev
2016-10-28 20:15:13 +03:00
parent be8b1b7dfd
commit c5999e8375
81 changed files with 1037 additions and 606 deletions
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
var exception: Throwable? = null
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
suspend fun suspendHere(x: Continuation<Any>) {}
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var result = "fail"
operator fun handleResult(u: Unit, c: Continuation<Nothing>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var result = false
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(a: String = "abc", i: Int = 2, x: Continuation<String>) {
x.resume(a + "#" + (i + 1))
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
var result = 0
class Controller {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun <T> suspendHere(v: T, x: Continuation<T>) {
x.resume(v)
-3
View File
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
// FULL_JDK
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
var exception: Throwable? = null
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var ok = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var isCompleted = false
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
fun withValue(v: String, x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
var globalResult = ""
var wasCalled = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var i = 0
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<Unit>) {
x.resume(Unit)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
-3
View File
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var result = "fail"
suspend fun <V> suspendHere(v: V, x: Continuation<V>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(v: String, x: Continuation<String>) {
x.resume(v)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var result = ""
var ok = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var wasHandleResultCalled = false
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var wasHandleResultCalled = false
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var ok = false
var v = "fail"
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var lastSuspension: Continuation<String>? = null
var result = "fail"
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var lastSuspension: Continuation<String>? = null
var result = "fail"
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var lastSuspension: Continuation<String>? = null
var result = "fail"
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var lastSuspension: Continuation<String>? = null
var result = "fail"
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
var globalResult = ""
var wasCalled = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var res = 0
operator fun handleResult(x: Int, y: Continuation<Nothing>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var cResult = 0
suspend fun suspendHere(v: Int, x: Continuation<Int>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
class Controller {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var res = 0
suspend fun suspendHere(x: Continuation<String>) {
-3
View File
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resumeWithException(RuntimeException("OK"))
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var res = 0
suspend fun suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
var globalResult = ""
class Controller {
suspend fun suspendWithValue(v: String, x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
suspendThere(x)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@AllowSuspendExtensions
class Controller {
suspend fun String.suspendHere(x: Continuation<String>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(v: Int, x: Continuation<Int>) {
x.resume(v * 2)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
var i = 0
suspend fun suspendHere(x: Continuation<Int>) {
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("K")
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
var globalResult = ""
var wasCalled = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
var globalResult = ""
var wasCalled = false
@@ -1,7 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(v: String, x: Continuation<String>) {
x.resume(v)
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_RUNTIME
var globalResult = ""
var wasCalled = false
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")