Jacek Caban (@jacek) commented about dlls/mshtml/script.c:
else if(!init_script_engine(ret)) release_script_engine(ret);
- list_add_tail(&window->script_hosts, &ret->entry);
It's better now, but it's still not great to break the assumption that all script hosts are on the list. For example, in theory, script host initialization may lead to recursive creation of the script host, potentially leading to creating multiple script hosts for the same language. While such case is not very interesting, you could avoid the whole thing by keeping this part unchanged and counting active script hosts in `init_script_engine`.