| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = '13.5.4.8.js'; |
| 8 |
|
| 9 |
START("13.5.4.8 - XMLList copy()"); |
| 10 |
|
| 11 |
TEST(1, true, XMLList.prototype.hasOwnProperty("copy")); |
| 12 |
|
| 13 |
emps = new XMLList(); |
| 14 |
emps += <employee id="0"><name>Jim</name><age>25</age></employee>; |
| 15 |
emps += <employee id="1"><name>Joe</name><age>20</age></employee>; |
| 16 |
|
| 17 |
correct = new XMLList(); |
| 18 |
correct += <employee id="0"><name>Jim</name><age>25</age></employee>; |
| 19 |
correct += <employee id="1"><name>Joe</name><age>20</age></employee>; |
| 20 |
|
| 21 |
TEST(2, emps, emps.copy()); |
| 22 |
TEST(3, correct, emps.copy()); |
| 23 |
|
| 24 |
|
| 25 |
emps = new XMLList(); |
| 26 |
emps += <employee id="0"><name>Jim</name><age>25</age></employee>; |
| 27 |
emps += <employee id="1"><name>Joe</name><age>20</age></employee>; |
| 28 |
|
| 29 |
correct = new XMLList(); |
| 30 |
correct += <employee id="0"><name>Jim</name><age>25</age></employee>; |
| 31 |
correct += <employee id="1"><name>Joe</name><age>20</age></employee>; |
| 32 |
|
| 33 |
x = emps.copy(); |
| 34 |
|
| 35 |
emps += <employee id="2"><name>Sue</name><age>32</age></employee>; |
| 36 |
|
| 37 |
TEST(4, correct, x); |
| 38 |
|
| 39 |
END(); |