bug 466606 - JavaScript Tests - Do not force language version upon non-Gecko browsers.

This commit is contained in:
Bob Clary 2008-11-27 02:29:40 -08:00
parent 565ac2694d
commit 730cb1c233

View File

@ -654,11 +654,34 @@ function jsTestDriverBrowserInit()
jit(false);
}
var versionmatches = /version=([.0-9]*)/.exec(value);
var versionmatches;
if (!versionmatches)
if (attribute == 'type')
{
value = 'text/javascript;version=';
versionmatches = /version=([.0-9]+)/.exec(value);
}
else
{
versionmatches = /javascript([.0-9]+)/.exec(value);
}
if (versionmatches)
{
gVersion = 10*parseInt(versionmatches[1].replace(/\./g, ''));
}
else if (navigator.userAgent.indexOf('Gecko/') != -1)
{
// If the version is not specified, and the browser is Gecko,
// adjust the version to match the suite version.
if (attribute == 'type')
{
value = 'text/javascript;version=';
}
else
{
value = 'javascript';
}
if (testpath.match(/^js1_6/))
{
gVersion = 160;
@ -685,10 +708,6 @@ function jsTestDriverBrowserInit()
value += '1.5';
}
}
else
{
gVersion = 10*parseInt(versionmatches[1].replace(/\./g, ''));
}
var testpathparts = testpath.split(/\//);