| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = 'regress-370372.js'; |
| 8 |
|
| 9 |
var BUGNUMBER = 370372; |
| 10 |
var summary = 'with (xmllist) function::name assignments'; |
| 11 |
var actual = 'No Exception'; |
| 12 |
var expect = 'No Exception'; |
| 13 |
|
| 14 |
printBugNumber(BUGNUMBER); |
| 15 |
START(summary); |
| 16 |
|
| 17 |
var tests = [<></>, <><a/></>, <><a/><b/></>]; |
| 18 |
|
| 19 |
function do_one(x) |
| 20 |
{ |
| 21 |
x.function::f = Math.sin; |
| 22 |
with (x) { |
| 23 |
function::toString = function::f = function() { return "test"; }; |
| 24 |
} |
| 25 |
|
| 26 |
if (String(x) !== "test") |
| 27 |
throw "Failed to set toString"; |
| 28 |
|
| 29 |
if (x.f() !== "test") |
| 30 |
throw "Failed to set set function f"; |
| 31 |
|
| 32 |
if (x.function::toString != x.function::f) |
| 33 |
throw "toString and f are different"; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
for (var i = 0; i != tests.length; ++i) |
| 38 |
do_one(tests[i]); |
| 39 |
|
| 40 |
TEST(1, expect, actual); |
| 41 |
END(); |