From cf0bc5bef0b8b149d058157d921e4023af5a1f67 Mon Sep 17 00:00:00 2001 From: Rintim Date: Sun, 17 Sep 2023 02:21:21 +0800 Subject: [PATCH] remove `gnc.await` we noticed that `gnc.await` has almost no logically sound use cases in practice. We shouldn't add error handling for generator functions that haven't been transformed into `genCoroutine`. Functions that need `genCoroutine` should judge the input parameters by themselves. By the way, this commit only remove the method without any change of the code which use `gnc.await`. In that case, there must be error in the code. --- game/game.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index 8b57bb4c2..82d877d5c 100644 --- a/game/game.js +++ b/game/game.js @@ -39,6 +39,7 @@ result.state=undefined; return gnc.await(result); }, + /* await:gen=>new Promise((resolve,reject)=>{ let result=gen; let nexts=resolve; @@ -68,6 +69,7 @@ } Promise.resolve(result).then(nexts,throws); }), + */ escape:gen=>{ gen.nocoroutine=true; return gen; @@ -7280,10 +7282,10 @@ } }, genAsync:fn=>gnc.async(fn), - genAwait:gen=>gnc.await(gen), + //genAwait:gen=>gnc.await(gen), gnc:{ async:fn=>gnc.async(fn), - await:gen=>gnc.await(gen), + //await:gen=>gnc.await(gen), escape:gen=>gnc.escape(gen), is:{ coroutine:item=>gnc.is.coroutine(item),