JavaScript Test - catch indirect eval exception on trunk, bug 361571

This commit is contained in:
bclary@bclary.com 2007-06-17 22:17:54 -07:00
parent 045ac58126
commit 66d51ee069

View File

@ -51,12 +51,20 @@ function test()
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
o = {};
o.__defineSetter__('y', eval);
o.watch('y', function () { return "";});
o.y = 1;
try
{
o = {};
o.__defineSetter__('y', eval);
o.watch('y', function () { return "";});
o.y = 1;
}
catch(ex)
{
printStatus('Note eval can no longer be called directly');
expect = 'EvalError: function eval must be called directly, and not by way of a function of another name';
actual = ex + '';
}
reportCompare(expect, actual, summary);
exitFunc ('test');