Backout Bug 452451 Due to test failures.

This commit is contained in:
Justin Wood 2010-05-20 01:01:59 -04:00
Родитель ac24ebce4f
Коммит b2f6b99dbb
4 изменённых файлов: 2 добавлений и 101 удалений

Просмотреть файл

@ -70,7 +70,6 @@ _TEST_FILES = \
gZipOfflineChild.html^headers^ \
gZipOfflineChild.cacheManifest \
gZipOfflineChild.cacheManifest^headers^ \
test_bug452451.html \
$(NULL)
# The following tests are disabled because they are unreliable:

Просмотреть файл

@ -1,97 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=452451
-->
<head>
<title>Test for Bug 452451</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=452451">Mozilla Bug 452451</a>
<p id="display"></p>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 452451 **/
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
ok(prefs.getBoolPref("javascript.options.relimit"),
"relimit should be enabled by default");
/**
* Following tests are inspired from:
* js/src/tests/js1_5/extensions/regress-330569.js
*/
var s;
const expected = 'InternalError: regular expression too complex';
s = '<!DOCTYPE HTML PUBLIC>' +
'<html>\n' +
'<head>\n' +
'<meta http-equiv="content-type" content="text/html">\n' +
'<title></title>\n'+
'</head>\n' +
'<body>\n' +
'<!-- hello -->\n' +
'<script language="JavaScript">\n' +
'var s = document. body. innerHTML;\n' +
'var d = s. replace (/<!--(.*|\n)*-->/, "");\n' +
'<\/script>\n' +
'<\/body>\n' +
'<\/html>\n';
try {
/<!--(.*|\n)*-->/.exec(s);
}
catch(ex) {
actual = ex;
}
is(actual, expected, "reg exp too complex error should have been thrown");
function testre( re, n )
{
var txt = '';
for (var i= 0; i <= n; ++i) {
txt += ',';
re.test(txt);
}
}
try {
testre( /(?:,*)*x/, 22 );
}
catch(ex) {
actual = ex;
}
is(actual, expected, "reg exp too complex error should have been thrown");
try {
testre( /(?:,|,)*x/, 22 );
}
catch(ex) {
actual = ex;
}
is(actual, expected, "reg exp too complex error should have been thrown");
try {
testre( /(?:,|,|,|,|,)*x/, 10 );
}
catch(ex) {
actual = ex;
}
is(actual, expected, "reg exp too complex error should have been thrown");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -3045,8 +3045,7 @@ GetOptionsProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
if (JSVAL_IS_INT(id)) {
uint32 optbit = (uint32) JSVAL_TO_INT(id);
if (((optbit & (optbit - 1)) == 0 && optbit <= JSOPTION_WERROR) ||
optbit == JSOPTION_RELIMIT)
if ((optbit & (optbit - 1)) == 0 && optbit <= JSOPTION_WERROR)
*vp = (JS_GetOptions(cx) & optbit) ? JSVAL_TRUE : JSVAL_FALSE;
}
return JS_TRUE;

Просмотреть файл

@ -558,7 +558,7 @@ pref("javascript.options.strict", false);
#ifdef DEBUG
pref("javascript.options.strict.debug", true);
#endif
pref("javascript.options.relimit", true);
pref("javascript.options.relimit", false);
pref("javascript.options.jit.content", true);
pref("javascript.options.jit.chrome", true);
// This preference limits the memory usage of javascript.