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.
This commit is contained in:
Rintim 2023-09-17 02:38:05 +08:00
parent cfc2c8b69b
commit 58379d5835
1 changed files with 3 additions and 1 deletions

View File

@ -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),