Jacek Caban (@jacek) commented about dlls/mshtml/tests/documentmode.js:
+ storage = null, storage2 = null; + try { + storage = window.localStorage, storage2 = iframe.contentWindow.localStorage; + }catch(e) { + ok(e.number === 0x72ee4 - 0x80000000, "localStorage threw " + e.number + ": " + e); + } + if(!storage || !storage2) { + win_skip("localStorage is buggy and not available, skipping"); + next_test(); + } + + // get rid of any entries first by polling, since native doesn't update immediately + var w = [ window, iframe.contentWindow ]; + for(var j = 0; j < w.length; j++) + w[j].onstorage = w[j].document.onstorage = w[j].document.onstoragecommit = null; + do { storage.clear(); } while(storage.length !== 0); Please don't do busy wait, especially in JS.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/795#note_8329