| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-350268.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 350268; |
| 9 |
var summary = 'new Function with unbalanced braces'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
test(); |
| 16 |
|
| 17 |
|
| 18 |
function test() |
| 19 |
{ |
| 20 |
enterFunc ('test'); |
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
printStatus (summary); |
| 23 |
|
| 24 |
var f; |
| 25 |
|
| 26 |
try |
| 27 |
{ |
| 28 |
expect = 'SyntaxError'; |
| 29 |
actual = 'No Error'; |
| 30 |
f = new Function("}"); |
| 31 |
} |
| 32 |
catch(ex) |
| 33 |
{ |
| 34 |
actual = ex.name; |
| 35 |
} |
| 36 |
reportCompare(expect, actual, summary + ": }"); |
| 37 |
|
| 38 |
try |
| 39 |
{ |
| 40 |
expect = 'SyntaxError'; |
| 41 |
actual = 'No Error'; |
| 42 |
f = new Function("}}}}}"); |
| 43 |
} |
| 44 |
catch(ex) |
| 45 |
{ |
| 46 |
actual = ex.name; |
| 47 |
} |
| 48 |
reportCompare(expect, actual, summary + ": }}}}}"); |
| 49 |
|
| 50 |
try |
| 51 |
{ |
| 52 |
expect = 'SyntaxError'; |
| 53 |
actual = 'No Error'; |
| 54 |
f = new Function("alert(6); } alert(5);"); |
| 55 |
} |
| 56 |
catch(ex) |
| 57 |
{ |
| 58 |
actual = ex.name; |
| 59 |
} |
| 60 |
reportCompare(expect, actual, summary + ": alert(6); } alert(5);"); |
| 61 |
|
| 62 |
try |
| 63 |
{ |
| 64 |
expect = 'SyntaxError'; |
| 65 |
actual = 'No Error'; |
| 66 |
f = new Function("} {"); |
| 67 |
} |
| 68 |
catch(ex) |
| 69 |
{ |
| 70 |
actual = ex.name; |
| 71 |
} |
| 72 |
reportCompare(expect, actual, summary + ": } {"); |
| 73 |
|
| 74 |
exitFunc ('test'); |
| 75 |
} |