| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-333728.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 333728; |
| 9 |
var summary = 'Throw ReferenceErrors for typeof(...undef)'; |
| 10 |
var actual = ''; |
| 11 |
var expect = 'ReferenceError'; |
| 12 |
|
| 13 |
printBugNumber(BUGNUMBER); |
| 14 |
printStatus (summary); |
| 15 |
|
| 16 |
try |
| 17 |
{ |
| 18 |
actual = typeof (0, undef); |
| 19 |
} |
| 20 |
catch(ex) |
| 21 |
{ |
| 22 |
actual = ex.name; |
| 23 |
} |
| 24 |
|
| 25 |
reportCompare(expect, actual, summary + ': typeof (0, undef)'); |
| 26 |
|
| 27 |
try |
| 28 |
{ |
| 29 |
actual = typeof (0 || undef); |
| 30 |
} |
| 31 |
catch(ex) |
| 32 |
{ |
| 33 |
actual = ex.name; |
| 34 |
} |
| 35 |
|
| 36 |
reportCompare(expect, actual, summary + ': typeof (0 || undef)'); |
| 37 |
|
| 38 |
try |
| 39 |
{ |
| 40 |
actual = typeof (1 && undef); |
| 41 |
} |
| 42 |
catch(ex) |
| 43 |
{ |
| 44 |
actual = ex.name; |
| 45 |
} |
| 46 |
|
| 47 |
reportCompare(expect, actual, summary + ': typeof (1 && undef)'); |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
try |
| 76 |
{ |
| 77 |
actual = typeof (!this ? 0 : undef); |
| 78 |
} |
| 79 |
catch(ex) |
| 80 |
{ |
| 81 |
actual = ex.name; |
| 82 |
} |
| 83 |
|
| 84 |
reportCompare(expect, actual, summary + ': typeof (!this ? 0 : undef)'); |