Only call callback once
This commit is contained in:
parent
e7d5f31d04
commit
ce1b3e099a
1 changed files with 4 additions and 3 deletions
|
@ -425,11 +425,12 @@ function haveTranslators(translators, type) {
|
||||||
/**
|
/**
|
||||||
* Runs translator tests recursively, after translatorTestViews has been populated
|
* Runs translator tests recursively, after translatorTestViews has been populated
|
||||||
*/
|
*/
|
||||||
function runTranslatorTests(type, callback) {
|
function runTranslatorTests(type, callback, runCallbackIfComplete) {
|
||||||
if(translatorTestViewsToRun[type].length) {
|
if(translatorTestViewsToRun[type].length) {
|
||||||
|
if(translatorTestViewsToRun[type].length === 1) runCallbackIfComplete = true;
|
||||||
var translatorTestView = translatorTestViewsToRun[type].shift();
|
var translatorTestView = translatorTestViewsToRun[type].shift();
|
||||||
translatorTestView.runTests(function() { runTranslatorTests(type, callback) });
|
translatorTestView.runTests(function() { runTranslatorTests(type, callback, runCallbackIfComplete) });
|
||||||
} else if(callback) {
|
} else if(callback && runCallbackIfComplete) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue