|
@@ -176,6 +176,7 @@ extern interface ArrayAccess<T> {}
|
|
|
**/
|
|
|
@:coreType
|
|
|
abstract Coroutine<T> {
|
|
|
+ #if js // TODO: implement this all properly for all the targets
|
|
|
/**
|
|
|
Suspend running coroutine and expose the continuation callback
|
|
|
for resuming coroutine execution.
|
|
@@ -183,8 +184,6 @@ abstract Coroutine<T> {
|
|
|
@:coroutine
|
|
|
public static extern function suspend<T>(f:(cont:T->Void)->Void):T;
|
|
|
|
|
|
- #if js
|
|
|
- // TODO: handle this somehow better
|
|
|
static function __init__():Void {
|
|
|
js.Syntax.code("{0} = {1}", Coroutine.suspend, cast function(f, cont) return _ -> f(cont));
|
|
|
}
|