add default value.

This commit is contained in:
Rintim 2023-09-10 16:48:02 +08:00
parent 0f00fc8332
commit 3b0edf0d27
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@
let nexts=resolve;
let throws=reject;
if(gnc.is.coroutine(gen)||(gnc.is.generator(gen)&&!gnc.nocoroutine)) {
if(!gen.status)gen.status="next";
if(!gen.state)gen.state=undefined;
try{
result=gen[result.status](result.state);
}catch(error){