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.
This commit is contained in:
parent
2da3a809d7
commit
cf0bc5bef0
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue