Be more lenient about spacing

This commit is contained in:
Simon Kornblith 2012-01-22 14:35:55 -05:00
parent c3ad5fd6f9
commit 448d68295b

View File

@ -55,7 +55,7 @@ Zotero_TranslatorTester = function(translator, type, debug) {
var testEnd = code.indexOf("/** END TEST CASES **/"); var testEnd = code.indexOf("/** END TEST CASES **/");
if (testStart !== -1 && testEnd !== -1) { if (testStart !== -1 && testEnd !== -1) {
var test = code.substring(testStart + 24, testEnd); var test = code.substring(testStart + 24, testEnd);
test = test.replace(/var testCases = /,''); test = test.replace(/var testCases = /,'').trim();
// The JSON parser doesn't like final semicolons // The JSON parser doesn't like final semicolons
if (test.lastIndexOf(';') == (test.length-1)) { if (test.lastIndexOf(';') == (test.length-1)) {
test = test.slice(0,-1); test = test.slice(0,-1);