| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-317533.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 317533; |
| 9 |
var summary = 'improve function does not always return a value warnings'; |
| 10 |
var actual = ''; |
| 11 |
var expect = 'TypeError: anonymous function does not always return a value'; |
| 12 |
|
| 13 |
printBugNumber(BUGNUMBER); |
| 14 |
printStatus (summary); |
| 15 |
|
| 16 |
var code; |
| 17 |
|
| 18 |
if (!options().match(/strict/)) |
| 19 |
{ |
| 20 |
options('strict'); |
| 21 |
} |
| 22 |
if (!options().match(/werror/)) |
| 23 |
{ |
| 24 |
options('werror'); |
| 25 |
} |
| 26 |
|
| 27 |
try |
| 28 |
{ |
| 29 |
actual = ''; |
| 30 |
code = "(function(x){ if(x) return x; })"; |
| 31 |
print(code); |
| 32 |
eval(code); |
| 33 |
} |
| 34 |
catch(ex) |
| 35 |
{ |
| 36 |
actual = ex + ''; |
| 37 |
print(ex); |
| 38 |
} |
| 39 |
|
| 40 |
reportCompare(expect, actual, summary); |
| 41 |
|
| 42 |
try |
| 43 |
{ |
| 44 |
actual = ''; |
| 45 |
code = "(function(x){ if(x) return x; ;})"; |
| 46 |
print(code); |
| 47 |
eval(code); |
| 48 |
} |
| 49 |
catch(ex) |
| 50 |
{ |
| 51 |
actual = ex + ''; |
| 52 |
print(ex); |
| 53 |
} |
| 54 |
|
| 55 |
reportCompare(expect, actual, summary); |