JavaScript Test - update test for bug 345855, bug 351514

This commit is contained in:
bclary%bclary.com 2006-09-15 09:14:00 +00:00
Родитель 21b711016d
Коммит 8a424cb476
1 изменённых файлов: 56 добавлений и 6 удалений

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

@ -51,17 +51,19 @@ function test()
printBugNumber (bug);
printStatus (summary);
expect = 'SyntaxError: syntax error';
try
{
eval('function() {x = 12 + (yield);}');
eval('function() {x = 12 + yield;}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 1');
reportCompare(expect, actual, summary + ': function() {x = 12 + yield;}');
expect = 'SyntaxError: yield expression must be parenthesized';
try
{
eval('function () {foo(yield)}');
@ -71,7 +73,55 @@ function test()
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 2');
reportCompare(expect, actual, summary + ': function () {foo(yield)}');
expect = 'SyntaxError: syntax error';
try
{
eval('function() {x = 12 + yield 42}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': function() {x = 12 + yield 42}');
expect = 'SyntaxError: yield expression must be parenthesized';
try
{
eval('function (){foo(yield 42)}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': function (){foo(yield 42)}');
expect = 'No Error';
try
{
eval('function() {x = 12 + (yield);}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': function() {x = 12 + (yield);}');
try
{
eval('function () {foo((yield))}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': function () {foo((yield))}');
try
{
@ -82,18 +132,18 @@ function test()
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 3');
reportCompare(expect, actual, summary + ': function() {x = 12 + (yield 42)}');
try
{
eval('function (){foo(yield 42)}');
eval('function (){foo((yield 42))}');
actual = 'No Error';
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary + ': 4');
reportCompare(expect, actual, summary + ': function (){foo((yield 42))}');
exitFunc ('test');
}