Trap possible exceptions to sure JavaScript Options are reset

This commit is contained in:
bob%bclary.com 2005-10-28 08:17:28 +00:00
Родитель 5cf264ab62
Коммит 106bc6a487
1 изменённых файлов: 15 добавлений и 3 удалений

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

@ -48,15 +48,27 @@ var jsOptions = new JavaScriptOptions();
// non strict
jsOptions.setOption('strict', false);
jsOptions.setOption('werror', false);
expect = null;
actual = /.\011/.exec ('a'+String.fromCharCode(0)+'11');
try
{
expect = null;
actual = /.\011/.exec ('a'+String.fromCharCode(0)+'11');
}
catch(e)
{
}
jsOptions.reset();
reportCompare(expect, actual, summary);
// strict
jsOptions.setOption('strict', true);
expect = null;
actual = /.\011/.exec ('a'+String.fromCharCode(0)+'11');
try
{
actual = /.\011/.exec ('a'+String.fromCharCode(0)+'11');
}
catch(e)
{
}
jsOptions.reset();
reportCompare(expect, actual, summary);