| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-449657.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 449657; |
| 9 |
var summary = 'JS_SealObject on Arrays'; |
| 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 |
if (typeof seal != 'function') |
| 25 |
{ |
| 26 |
expect = actual = 'JS_SealObject not supported, test skipped.'; |
| 27 |
reportCompare(expect, actual, summary); |
| 28 |
} |
| 29 |
else |
| 30 |
{ |
| 31 |
try |
| 32 |
{ |
| 33 |
var a= [1, 2, 3]; |
| 34 |
seal(a); |
| 35 |
} |
| 36 |
catch(ex) |
| 37 |
{ |
| 38 |
actual = ex + ''; |
| 39 |
} |
| 40 |
reportCompare(expect, actual, summary + ': 1'); |
| 41 |
|
| 42 |
expect = 'Error: a.length is read-only'; |
| 43 |
actual = ''; |
| 44 |
try |
| 45 |
{ |
| 46 |
a = [1,2,3]; |
| 47 |
a[4] = 2; |
| 48 |
seal(a); |
| 49 |
a.length = 5; |
| 50 |
} |
| 51 |
catch(ex) |
| 52 |
{ |
| 53 |
actual = ex + ''; |
| 54 |
} |
| 55 |
reportCompare(expect, actual, summary + ': 2'); |
| 56 |
} |
| 57 |
|
| 58 |
exitFunc ('test'); |
| 59 |
} |