Make sure translator test errors appear both in log and in console
This commit is contained in:
parent
cc7360dc0c
commit
d08ad1143d
|
@ -51,6 +51,7 @@ Zotero_TranslatorTesters = new function() {
|
|||
Zotero.Translators.getAllForType(TEST_TYPES[i], new function() {
|
||||
var type = TEST_TYPES[i];
|
||||
return function(translators) {
|
||||
try {
|
||||
for(var i=0; i<translators.length; i++) {
|
||||
if(skipTranslators && !skipTranslators[translators[i].translatorID]) {
|
||||
testers.push(new Zotero_TranslatorTester(translators[i], type));
|
||||
|
@ -60,6 +61,10 @@ Zotero_TranslatorTesters = new function() {
|
|||
if(!(--waitingForTranslators)) {
|
||||
runTesters(testers, numConcurrentTests, doneCallback);
|
||||
}
|
||||
} catch(e) {
|
||||
Zotero.debug(e);
|
||||
Zotero.logError(e);
|
||||
}
|
||||
};
|
||||
}, true);
|
||||
};
|
||||
|
@ -70,20 +75,21 @@ Zotero_TranslatorTesters = new function() {
|
|||
*/
|
||||
function runTesters(testers, numConcurrentTests, doneCallback) {
|
||||
var testersRunning = 0;
|
||||
var results = [];
|
||||
var results = []
|
||||
|
||||
if("getLocaleCollation" in Zotero) {
|
||||
var collation = Zotero.getLocaleCollation();
|
||||
strcmp = function(a, b) {
|
||||
var strcmp = function(a, b) {
|
||||
return collation.compareString(1, a, b);
|
||||
};
|
||||
} else {
|
||||
strcmp = function (a, b) {
|
||||
var strcmp = function (a, b) {
|
||||
return a.toLowerCase().localeCompare(b.toLowerCase());
|
||||
};
|
||||
}
|
||||
|
||||
var testerDoneCallback = function(tester) {
|
||||
try {
|
||||
if(tester.pending.length) return;
|
||||
|
||||
Zotero.debug("Done testing "+tester.translator.label);
|
||||
|
@ -111,6 +117,10 @@ Zotero_TranslatorTesters = new function() {
|
|||
"results":results
|
||||
});
|
||||
}
|
||||
} catch(e) {
|
||||
Zotero.debug(e);
|
||||
Zotero.logError(e);
|
||||
}
|
||||
};
|
||||
|
||||
var runNextTester = function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user