From 0daee20545e4a83682e5a62a48bcf3de56c932cd Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Mon, 7 Oct 2019 10:57:53 +0200 Subject: [PATCH] allow customization of top level async end point --- hscript/Async.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hscript/Async.hx b/hscript/Async.hx index b41c0d8..669b50d 100644 --- a/hscript/Async.hx +++ b/hscript/Async.hx @@ -75,12 +75,16 @@ class Async { return a.build(e, topLevelSync); } + public dynamic function getTopLevelEnd() { + return ignore(); + } + public function build( e : Expr, topLevelSync = false ) { if( topLevelSync ) { return buildSync(e,null); } else { - var nothing = ignore(); - return toCps(e, nothing, nothing); + var end = getTopLevelEnd(); + return toCps(e, end, end); } }