Skip to content

Commit 2ae3609

Browse files
authored
fix: re-order postMessage with MessageChannel
On my Chorome window.postMessage appears to execute before MessageChannel, use try to use it first.
1 parent b7001e7 commit 2ae3609

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var macrotaskWindowPostMessage = (typeof window === 'object' && window.postMessa
4646
var macrotaskSetTimeout = function (fn) { setTimeout(fn, 0); };
4747

4848
var microtask = microtaskProcessNextTick || microtaskPromise || microtaskMutationObserver;
49-
var macrotask = macrotaskSetImmediate || macrotaskMessageChannel || macrotaskWindowPostMessage || macrotaskSetTimeout;
49+
var macrotask = macrotaskSetImmediate || macrotaskWindowPostMessage || macrotaskMessageChannel || macrotaskSetTimeout;
5050

5151
exports.microtask = microtask;
5252
exports.macrotask = macrotask;

0 commit comments

Comments
 (0)