| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-338709.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 338709; |
| 9 |
var summary = 'ReadOnly properties should not be overwritten by using ' + |
| 10 |
'Object and try..throw..catch'; |
| 11 |
var actual = ''; |
| 12 |
var expect = ''; |
| 13 |
|
| 14 |
printBugNumber(BUGNUMBER); |
| 15 |
printStatus (summary); |
| 16 |
|
| 17 |
Object = function () { return Math }; |
| 18 |
expect = Math.LN2; |
| 19 |
try |
| 20 |
{ |
| 21 |
throw 1990; |
| 22 |
} |
| 23 |
catch (LN2) |
| 24 |
{ |
| 25 |
} |
| 26 |
actual = Math.LN2; |
| 27 |
print("Math.LN2 = " + Math.LN2) |
| 28 |
reportCompare(expect, actual, summary); |
| 29 |
|
| 30 |
var s = new String("abc"); |
| 31 |
Object = function () { return s }; |
| 32 |
expect = s.length; |
| 33 |
try |
| 34 |
{ |
| 35 |
throw -8 |
| 36 |
} |
| 37 |
catch (length) |
| 38 |
{ |
| 39 |
} |
| 40 |
actual = s.length; |
| 41 |
print("length of '" + s + "' = " + s.length) |
| 42 |
reportCompare(expect, actual, summary); |
| 43 |
|
| 44 |
var re = /xy/m; |
| 45 |
Object = function () { return re }; |
| 46 |
expect = re.multiline; |
| 47 |
try |
| 48 |
{ |
| 49 |
throw false |
| 50 |
} |
| 51 |
catch (multiline) |
| 52 |
{ |
| 53 |
} |
| 54 |
actual = re.multiline; |
| 55 |
print("re.multiline = " + re.multiline) |
| 56 |
reportCompare(expect, actual, summary); |
| 57 |
|
| 58 |
if ("document" in this) { |
| 59 |
|
| 60 |
Object = function () { return document } |
| 61 |
expect = document.documentElement + ''; |
| 62 |
try |
| 63 |
{ |
| 64 |
throw document; |
| 65 |
} |
| 66 |
catch (documentElement) |
| 67 |
{ |
| 68 |
} |
| 69 |
actual = document.documentElement + ''; |
| 70 |
print("document.documentElement = " + document.documentElement) |
| 71 |
} |
| 72 |
else |
| 73 |
Object = this.constructor |
| 74 |
|
| 75 |
reportCompare(expect, actual, summary); |