Bug 1121327 patch 1 - Make the OSX variable in the reftest condition sandbox be an integer (1006, 1010) so that it scales for 10.10, and undefined for non-Mac rather than 0. r=ted.mielczarek

Using undefined has the advantage that we can use < and > tests with the
OSX variable.  (We currently have no such tests in the tree, perhaps
partly because they didn't work with non-OSX being 0.)
This commit is contained in:
L. David Baron 2015-01-15 15:07:50 -08:00
parent 0e90bcb6ed
commit 42aec8e460

View File

@ -668,9 +668,12 @@ function BuildConditionSandbox(aURL) {
sandbox.http = new sandbox.Object();
httpProps.forEach((x) => sandbox.http[x] = hh[x]);
// Set OSX to the Mac OS X version for Mac, and 0 otherwise.
var osxmatch = /Mac OS X (\d+.\d+)$/.exec(hh.oscpu);
sandbox.OSX = osxmatch ? parseFloat(osxmatch[1]) : 0;
// Set OSX to be the Mac OS X version, as an integer, or undefined
// for other platforms. The integer is formed by 100 times the
// major version plus the minor version, so 1006 for 10.6, 1010 for
// 10.10, etc.
var osxmatch = /Mac OS X (\d+).(\d+)$/.exec(hh.oscpu);
sandbox.OSX = osxmatch ? parseInt(osxmatch[1]) * 100 + parseInt(osxmatch[2]) : undefined;
// see if we have the test plugin available,
// and set a sandox prop accordingly