1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Big linting

This commit is contained in:
kkapsner 2019-11-28 01:26:35 +01:00
parent b5e6d049ce
commit aef6bd3d59
58 changed files with 2074 additions and 1856 deletions

View file

@ -34,6 +34,7 @@ function addConsistencyTest(title, callback){
consistent.textContent = "computing";
callback().then(function(value){
consistent.textContent = value? "OK": "not OK";
return;
}).catch(function(error){
consistent.classList.add("failed");
if (Array.isArray(error)){
@ -141,6 +142,7 @@ function addResolutionTest(title, callback){
number.textContent = "computing";
callback(type).then(function(value){
number.textContent = value;
return;
}).catch(function(error){
number.classList.add("failed");
number.textContent = error;
@ -214,15 +216,14 @@ function searchValue(tester){
return minValue;
}
else {
// eslint-disable-next-line promise/no-nesting
return tester(maxValue).then(function(testResult){
if (testResult.isEqual){
return maxValue;
}
else {
return Promise.reject(
"Search could not find exact value." +
" It's between " + minValue + " and " + maxValue + "."
);
throw "Search could not find exact value." +
" It's between " + minValue + " and " + maxValue + ".";
}
});
}