On Tue Sep 13 12:59:53 2022 +0000, Jacek Caban wrote:
This really makes the code harder to follow than needed. Can you just use the existing mechanisms instead? The only thing it's lacking is testing for call order (and that's intentional). Is testing the order really worth all the complication and all those magic 0, 1, 2 and -1s? If you really need to check the order, you may just check in doc.onstorage than window.onstorage was already called.
Main reason I wrote it that way was to be able to *loop* over it, to wait until all required were called. Order isn't terribly important. I'll try to think of something without duplicating the message loop. Maybe set all as called initially, and then clear the ones to wait for, should do the trick.