提交 7b8af01c 编写于 作者: L Lebedev Konstantin

* fixes setImmediate

上级 b0abb0c9
......@@ -1246,15 +1246,18 @@
setImmediate = setTimeout;
if (win.postMessage && !win.importScripts) {
var postMessageIsAsynchronous = true;
var oldOnMessage = win.onmessage;
var postMessageIsAsynchronous = true;
var oldOnMessage = win.onmessage;
win.onmessage = function () { postMessageIsAsynchronous = false; };
win.postMessage('', '*');
win.onmessage = oldOnMessage;
win.onmessage = function () {
postMessageIsAsynchronous = false;
};
if (postMessageIsAsynchronous) {
var postMessageQueue = [];
win.postMessage('', '*');
win.onmessage = oldOnMessage;
if (postMessageIsAsynchronous) {
var postMessageQueue = [];
var postMessageEventName = 'sortableSetImmediate:' + expando;
var onGlobalMessage = function (event) {
if (
......@@ -1273,10 +1276,9 @@
setImmediate = function (callback) {
postMessageQueue.push(callback);
win.postMessage(postMessageEventName, '*');
return handle;
};
}
}
}
}
}
// Export utils
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册