| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
var gTestfile = 'regress-101488.js'; |
| 25 |
var UBound = 0; |
| 26 |
var BUGNUMBER = 101488; |
| 27 |
var summary = 'Try assigning arr.length = new Number(n)'; |
| 28 |
var status = ''; |
| 29 |
var statusitems = []; |
| 30 |
var actual = ''; |
| 31 |
var actualvalues = []; |
| 32 |
var expect= ''; |
| 33 |
var expectedvalues = []; |
| 34 |
var arr = []; |
| 35 |
|
| 36 |
|
| 37 |
status = inSection(1); |
| 38 |
arr = Array(); |
| 39 |
tryThis('arr.length = new Number(1);'); |
| 40 |
actual = arr.length; |
| 41 |
expect = 1; |
| 42 |
addThis(); |
| 43 |
|
| 44 |
status = inSection(2); |
| 45 |
arr = Array(5); |
| 46 |
tryThis('arr.length = new Number(1);'); |
| 47 |
actual = arr.length; |
| 48 |
expect = 1; |
| 49 |
addThis(); |
| 50 |
|
| 51 |
status = inSection(3); |
| 52 |
arr = Array(); |
| 53 |
tryThis('arr.length = new Number(17);'); |
| 54 |
actual = arr.length; |
| 55 |
expect = 17; |
| 56 |
addThis(); |
| 57 |
|
| 58 |
status = inSection(4); |
| 59 |
arr = Array(5); |
| 60 |
tryThis('arr.length = new Number(17);'); |
| 61 |
actual = arr.length; |
| 62 |
expect = 17; |
| 63 |
addThis(); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
status = inSection(5); |
| 71 |
arr = new Array(); |
| 72 |
tryThis('arr.length = new Number(1);'); |
| 73 |
actual = arr.length; |
| 74 |
expect = 1; |
| 75 |
addThis(); |
| 76 |
|
| 77 |
status = inSection(6); |
| 78 |
arr = new Array(5); |
| 79 |
tryThis('arr.length = new Number(1);'); |
| 80 |
actual = arr.length; |
| 81 |
expect = 1; |
| 82 |
addThis(); |
| 83 |
|
| 84 |
arr = new Array(); |
| 85 |
tryThis('arr.length = new Number(17);'); |
| 86 |
actual = arr.length; |
| 87 |
expect = 17; |
| 88 |
addThis(); |
| 89 |
|
| 90 |
status = inSection(7); |
| 91 |
arr = new Array(5); |
| 92 |
tryThis('arr.length = new Number(17);'); |
| 93 |
actual = arr.length; |
| 94 |
expect = 17; |
| 95 |
addThis(); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
test(); |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
function tryThis(s) |
| 106 |
{ |
| 107 |
try |
| 108 |
{ |
| 109 |
eval(s); |
| 110 |
} |
| 111 |
catch(e) |
| 112 |
{ |
| 113 |
|
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
function addThis() |
| 119 |
{ |
| 120 |
statusitems[UBound] = status; |
| 121 |
actualvalues[UBound] = actual; |
| 122 |
expectedvalues[UBound] = expect; |
| 123 |
UBound++; |
| 124 |
} |
| 125 |
|
| 126 |
|
| 127 |
function test() |
| 128 |
{ |
| 129 |
enterFunc ('test'); |
| 130 |
printBugNumber(BUGNUMBER); |
| 131 |
printStatus (summary); |
| 132 |
|
| 133 |
for (var i=0; i<UBound; i++) |
| 134 |
{ |
| 135 |
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
| 136 |
} |
| 137 |
|
| 138 |
exitFunc ('test'); |
| 139 |
} |