commit ce1b3e099aaf451f22ef2d0fab1c521f1005badc
parent e7d5f31d042c1751a35a5e4e693e79fbe8f84213
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 18 Jul 2011 21:37:38 +0000
Only call callback once
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/tools/testTranslators/testTranslators.js b/chrome/content/zotero/tools/testTranslators/testTranslators.js
@@ -425,11 +425,12 @@ function haveTranslators(translators, type) {
/**
* 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 === 1) runCallbackIfComplete = true;
var translatorTestView = translatorTestViewsToRun[type].shift();
- translatorTestView.runTests(function() { runTranslatorTests(type, callback) });
- } else if(callback) {
+ translatorTestView.runTests(function() { runTranslatorTests(type, callback, runCallbackIfComplete) });
+ } else if(callback && runCallbackIfComplete) {
callback();
}
}