| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
var gTestfile = 'regress-146596.js'; |
| 15 |
var UBound = 0; |
| 16 |
var BUGNUMBER = 146596; |
| 17 |
var summary = "Shouldn't crash when catch parameter is 'hidden' by varX"; |
| 18 |
var status = ''; |
| 19 |
var statusitems = []; |
| 20 |
var actual = ''; |
| 21 |
var actualvalues = []; |
| 22 |
var expect= ''; |
| 23 |
var expectedvalues = []; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
function F() |
| 37 |
{ |
| 38 |
try |
| 39 |
{ |
| 40 |
return "A simple exception"; |
| 41 |
} |
| 42 |
catch(e) |
| 43 |
{ |
| 44 |
var e = "Another exception"; |
| 45 |
} |
| 46 |
|
| 47 |
return 'XYZ'; |
| 48 |
} |
| 49 |
|
| 50 |
status = inSection(1); |
| 51 |
actual = F(); |
| 52 |
expect = "A simple exception"; |
| 53 |
addThis(); |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
function f(obj) |
| 68 |
{ |
| 69 |
var res = []; |
| 70 |
|
| 71 |
try |
| 72 |
{ |
| 73 |
throw 42; |
| 74 |
} |
| 75 |
catch(e) |
| 76 |
{ |
| 77 |
with(obj) |
| 78 |
{ |
| 79 |
var e; |
| 80 |
res[0] = e; |
| 81 |
} |
| 82 |
|
| 83 |
res[1] = e; |
| 84 |
} |
| 85 |
|
| 86 |
res[2] = e; |
| 87 |
return res; |
| 88 |
} |
| 89 |
|
| 90 |
status = inSection(2); |
| 91 |
actual = f({e:24}); |
| 92 |
expect = [24, 42, undefined]; |
| 93 |
addThis(); |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
test(); |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
function addThis() |
| 105 |
{ |
| 106 |
statusitems[UBound] = status; |
| 107 |
actualvalues[UBound] = actual.toString(); |
| 108 |
expectedvalues[UBound] = expect.toString(); |
| 109 |
UBound++; |
| 110 |
} |
| 111 |
|
| 112 |
|
| 113 |
function test() |
| 114 |
{ |
| 115 |
enterFunc('test'); |
| 116 |
printBugNumber(BUGNUMBER); |
| 117 |
printStatus(summary); |
| 118 |
|
| 119 |
for (var i=0; i<UBound; i++) |
| 120 |
{ |
| 121 |
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
| 122 |
} |
| 123 |
|
| 124 |
exitFunc ('test'); |
| 125 |
} |