YuzuJS/setImmediate

setImmediate should "Wait until any invocations of this algorithm started before this one have completed."

Closed this issue · 2 comments

another test:
Chrome this test fails for current implementation:

asyncTest("setImmediate should wait other immediates even with alert,promt,showModalDialog", 1, function () {
    var completed = false;
    setImmediate(function () {
        if (window.showModalDialog) {
            window.showModalDialog('selfclose.html');
        }

        completed = true;
    });

    setImmediate(function () {
        strictEqual(completed, true, "Execution order is wrong");
        start();
    });
});

where selfclose.html contains:

<script> setTimeout(function () { window.close(); }, 1000); </script>

see my fork for workaround

Just wanted to let you know that I'm looking at your fork and definitely interested in what you've done, but probably won't get around to doing any work with this stuff until Monday---I'm taking the weekend off from JavaScript :).

All right, that should take care of it! Nice find.