Bug 982680. Fix regress-406572.js to actually test something useful. r=peterv,waldo

This commit is contained in:
Boris Zbarsky 2014-03-29 01:45:09 -04:00
parent 6006f990ab
commit c8980413ca

View File

@ -14,19 +14,26 @@ printStatus (summary);
if (typeof window != 'undefined')
{
var s = self;
try {
actual = "FAIL: Unexpected exception thrown";
document.writeln(uneval(self));
self = 1;
document.writeln(uneval(self));
var win = window;
var windowString = String(window);
window = 1;
reportCompare(windowString, String(window), "window should be readonly");
if (1)
function self() { return 1; }
actual = ""; // We should reach this line, and throw an exception after it
document.writeln(uneval(self));
if (1)
function window() { return 1; }
// The test harness might rely on self having its original value: restore it.
self = s;
actual = "FAIL: this line should never be reached";
// The test harness might rely on window having its original value:
// restore it.
window = win;
} catch (e) {
}
}
else
{