JavaScript Test - add additional tests for Function constructor, bug 408271, not part of the build

This commit is contained in:
bclary@bclary.com 2007-12-21 17:58:43 -08:00
Родитель 4696908c5b
Коммит e28a14d232
1 изменённых файлов: 27 добавлений и 2 удалений

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

@ -57,7 +57,7 @@ catch(ex)
actual = ex + '';
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ': 1');
try
{
@ -68,4 +68,29 @@ catch(ex)
actual = ex + '';
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ': 2');
var f;
expect = 'TypeError: function anonymous does not always return a value';
try
{
f = Function('if (x) return y;');
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 3');
try
{
f = Function('if (x) { return y; }');
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 4');