修复生成器形式content的一个无限循环问题

This commit is contained in:
kuangthree 2024-02-17 18:19:00 +08:00
parent a261ce08d3
commit ef886f9cae
1 changed files with 4 additions and 1 deletions

View File

@ -712,7 +712,10 @@ export class LibInit extends Uninstantable {
result: result
});
var res = gen.next((lastEvent && (typeof lastEvent == 'object') && ("result" in lastEvent)) ? lastEvent.result : lastEvent);
if (res.done) return event.finish();
if (res.done){
gen = null;
return event.finish();
}
var currentResult = res.value;
// TODO: use `event.debugger` to replace source
if (typeof currentResult == "function") yield currentResult;