util: Handle .rc in version comparisons

We somehow missed that the new version scheme include '.rc' when
adding the comparison function, whoops.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3130>
This commit is contained in:
Florian Müllner 2024-01-19 22:56:59 +01:00 committed by Marge Bot
parent b02460fa63
commit 79b0c9c726
2 changed files with 4 additions and 2 deletions

View File

@ -294,8 +294,10 @@ function _GNOMEversionToNumber(version) {
if (!isNaN(ret))
return ret;
if (version === 'alpha')
return -2;
return -3;
if (version === 'beta')
return -2;
if (version === 'rc')
return -1;
return ret;
}

View File

@ -36,7 +36,7 @@ const tests = [
},
{
v1: '40',
v2: '3.38.0',
v2: '40.rc',
res: 1,
},
{