JavaScript Test - add additional tests for Function constructor, bug 408271, not part of the build
git-svn-id: svn://10.0.0.236/trunk@242002 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
02816bb7c8
commit
6268ec1313
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user