mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
19 lines
347 B
JavaScript
19 lines
347 B
JavaScript
var log = [];
|
|
var resolvedPromise = Promise.resolve(null);
|
|
function schedulePromiseTask(f) {
|
|
resolvedPromise.then(f);
|
|
}
|
|
|
|
setTimeout(function() {
|
|
log.push('t1start');
|
|
schedulePromiseTask(function() {
|
|
log.push('promise');
|
|
});
|
|
log.push('t1end');
|
|
}, 10);
|
|
|
|
setTimeout(function() {
|
|
log.push('t2');
|
|
postMessage(log.join(', '));
|
|
}, 10);
|