Skip to content

Commit 8787a30

Browse files
committed
builds: Fix behavior with negative build numbers
1 parent 84ac72f commit 8787a30

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

builds.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ addEvent(window, 'load', function() {
4747
/* Perform initial load. */
4848
window.firstBuildLoad = true;
4949
window.inBisectMode = false;
50+
window.bisectFirstBuildNumber = 885;
5051
window.bisectLatestBuildNumber = window.bisectMinBuildNumber = window.bisectMaxBuildNumber = window.bisectTargetBuildNumber = 0;
5152
window.bisectSkipDirection = 1;
5253
if (document.location.hash && document.location.hash.match) {
@@ -118,13 +119,10 @@ function submitBuild() {
118119
script.setAttribute('src', '//ci.86box.net/job/86Box/' + (buildNumberVal || 'lastSuccessfulBuild') + '/api/json?jsonp=listBuild&noCache=' + new Date().getTime());
119120
script.setAttribute('data-bnval', buildNumberVal);
120121
addEvent(script, 'error', function() {
121-
/* If in bisect mode, then just increment the build number, unless we're past the latest build. */
122+
/* If in bisect mode, then just increment the build number, unless we're in an invalid build number. */
122123
var scriptBuildNumberVal = parseInt(script.getAttribute('data-bnval') || buildNumberVal);
123-
if (window.inBisectMode && scriptBuildNumberVal) {
124-
if (scriptBuildNumberVal > window.bisectLatestBuildNumber)
125-
return alert('Bisect process has gone past the latest build.');
124+
if (window.inBisectMode && scriptBuildNumberVal && !(scriptBuildNumberVal < window.bisectFirstBuildNumber) && !(scriptBuildNumberVal > window.bisectLatestBuildNumber)) /* these weird comparisons also cover NaN */
126125
return bisectNextBuild(scriptBuildNumberVal);
127-
}
128126

129127
/* Show error message. */
130128
buildBins.firstChild.innerHTML = 'Could not load build information.';
@@ -449,7 +447,7 @@ function updateBisect(btn) { /* delayed on keypress to let the input value updat
449447
var goodBuildNumber = parseInt(document.getElementById('goodbuild').value);
450448
var badBuildNumber = parseInt(document.getElementById('badbuild').value);
451449
var tryMsg = document.getElementById('bisecttry');
452-
if (!(goodBuildNumber >= 885) || !(badBuildNumber >= 885)) { /* these weird comparisons also cover NaN */
450+
if (!(goodBuildNumber >= window.bisectFirstBuildNumber) || !(badBuildNumber >= window.bisectFirstBuildNumber)) { /* these weird comparisons also cover NaN */
453451
tryMsg.style.display = 'none';
454452
return;
455453
}

0 commit comments

Comments
 (0)