| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
var gTestfile = 'class-004.js'; |
| 23 |
var i = 0; |
| 24 |
var UBound = 0; |
| 25 |
var BUGNUMBER = 56868; |
| 26 |
var summary = 'Testing the internal [[Class]] property of native error constructors'; |
| 27 |
var statprefix = 'Current constructor is: '; |
| 28 |
var status = ''; var statusList = [ ]; |
| 29 |
var actual = ''; var actualvalue = [ ]; |
| 30 |
var expect= ''; var expectedvalue = [ ]; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
status = 'Error'; |
| 37 |
actual = getJSClass(Error); |
| 38 |
expect = 'Function'; |
| 39 |
addThis(); |
| 40 |
|
| 41 |
status = 'EvalError'; |
| 42 |
actual = getJSClass(EvalError); |
| 43 |
expect = 'Function'; |
| 44 |
addThis(); |
| 45 |
|
| 46 |
status = 'RangeError'; |
| 47 |
actual = getJSClass(RangeError); |
| 48 |
expect = 'Function'; |
| 49 |
addThis(); |
| 50 |
|
| 51 |
status = 'ReferenceError'; |
| 52 |
actual = getJSClass(ReferenceError); |
| 53 |
expect = 'Function'; |
| 54 |
addThis(); |
| 55 |
|
| 56 |
status = 'SyntaxError'; |
| 57 |
actual = getJSClass(SyntaxError); |
| 58 |
expect = 'Function'; |
| 59 |
addThis(); |
| 60 |
|
| 61 |
status = 'TypeError'; |
| 62 |
actual = getJSClass(TypeError); |
| 63 |
expect = 'Function'; |
| 64 |
addThis(); |
| 65 |
|
| 66 |
status = 'URIError'; |
| 67 |
actual = getJSClass(URIError); |
| 68 |
expect = 'Function'; |
| 69 |
addThis(); |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
test(); |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
function addThis() |
| 80 |
{ |
| 81 |
statusList[UBound] = status; |
| 82 |
actualvalue[UBound] = actual; |
| 83 |
expectedvalue[UBound] = expect; |
| 84 |
UBound++; |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
function test() |
| 89 |
{ |
| 90 |
enterFunc ('test'); |
| 91 |
printBugNumber(BUGNUMBER); |
| 92 |
printStatus (summary); |
| 93 |
|
| 94 |
for (i = 0; i < UBound; i++) |
| 95 |
{ |
| 96 |
reportCompare(expectedvalue[i], actualvalue[i], getStatus(i)); |
| 97 |
} |
| 98 |
|
| 99 |
exitFunc ('test'); |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
function getStatus(i) |
| 104 |
{ |
| 105 |
return statprefix + statusList[i]; |
| 106 |
} |