Re: [w3c/screen-orientation] lock() should not fail if another lock() is called in the change event (#184)

I'm not saying that we should special case this but as the spec is written, we are told to reject a promise for which the action was succeeded because we run the event handler of the action succeeding before we resolve the promise. It's a fairly common situation in CS to make copies of objects to avoid re-entrency and it's a fairly similar problem IMO: running the event callbacks will change the state of the next operations.

FWIW, in Blink we run the callbacks and resolve the promise asynchronously. Because they are both async, we avoid the bug and still keep the order. Could this be a valid alternative?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/issues/184#issuecomment-520053416

Received on Friday, 9 August 2019 20:29:20 UTC