feat: genContent may throw the step-like info.

This commit is contained in:
Rintim 2023-11-16 17:51:22 +08:00
parent a41ccbdc1a
commit 933a91f9d0
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
1 changed files with 10 additions and 6 deletions

View File

@ -11595,12 +11595,16 @@
result:result
});
var res=gen.next((lastEvent&&("result" in lastEvent))?lastEvent.result:null);
if(res.done) event.finish();
else {
var currentResult=res.value;
// TODO: use `event.debugger` to replace source
if(typeof currentResult=="function") yield currentResult;
else lastEvent=currentResult;
if(res.done) return event.finish();
var currentResult=res.value;
// TODO: use `event.debugger` to replace source
if(typeof currentResult=="function") yield currentResult;
else{
if(Array.isArray(currentResult)){
event.step=currentResult[1];
currentResult=currentResult[0];
}
lastEvent=currentResult;
}
}
}else if(item._parsed) return item;