mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Clear timeout (prevents freezing of test suite when async tests fail) when start is called
This commit is contained in:
parent
b0c3711d3e
commit
b5a33456e3
@ -8,6 +8,7 @@ var stats = {
|
|||||||
};
|
};
|
||||||
var queue = [];
|
var queue = [];
|
||||||
var blocking = false;
|
var blocking = false;
|
||||||
|
var timeout;
|
||||||
|
|
||||||
function synchronize(callback) {
|
function synchronize(callback) {
|
||||||
queue[queue.length] = callback;
|
queue[queue.length] = callback;
|
||||||
@ -26,9 +27,11 @@ function process() {
|
|||||||
|
|
||||||
function stop() {
|
function stop() {
|
||||||
blocking = true;
|
blocking = true;
|
||||||
setTimeout(start, asyncTimeout * 1000);
|
timeout = setTimeout(start, asyncTimeout * 1000);
|
||||||
}
|
}
|
||||||
function start() {
|
function start() {
|
||||||
|
if(timeout)
|
||||||
|
clearTimeout(timeout);
|
||||||
blocking = false;
|
blocking = false;
|
||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user