From 58379d58352aca55709ad1819a1366c84c9cd05a Mon Sep 17 00:00:00 2001 From: Rintim Date: Sun, 17 Sep 2023 02:38:05 +0800 Subject: [PATCH] remove `gnc.escape`. The original intention of `gnc.escape` was to tell `gnc.await` not to handle generator functions that have gone through this function. In fact, no one uses this function at all, because there would never be a situation where a normal function returns a generator function when `genCoroutine` is needed. Now that `gnc.await` has been removed from the project, there is even less need for `gnc.escape` to exist. --- game/game.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 169ed57b9..3fc8da67a 100644 --- a/game/game.js +++ b/game/game.js @@ -93,10 +93,12 @@ Promise.resolve(result).then(nexts,throws); }), */ + /* escape:gen=>{ gen.nocoroutine=true; return gen; }, + */ is:{ coroutine:item=>(typeof item=="function"||gnc.is.generator(item))&&item.name=="genCoroutine", generatorFunc:item=>item instanceof GeneratorFunction, @@ -7309,7 +7311,7 @@ gnc:{ async:fn=>gnc.async(fn), //await:gen=>gnc.await(gen), - escape:gen=>gnc.escape(gen), + //escape:gen=>gnc.escape(gen), is:{ coroutine:item=>gnc.is.coroutine(item), generatorFunc:item=>gnc.is.generatorFunc(item),