Debian Codegraph @

rhino/testsrc/tests/e4x/XML/13.4.4.29.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = '13.4.4.29.js';
8
9 START("13.4.4.29 - XML prependChild()");
10
11 TEST(1, true, XML.prototype.hasOwnProperty("prependChild"));
12
13 x =
14 <alpha>
15 <bravo>
16 <charlie>one</charlie>
17 </bravo>
18 </alpha>;
19
20 correct =
21 <alpha>
22 <bravo>
23 <foo>bar</foo>
24 <charlie>one</charlie>
25 </bravo>
26 </alpha>;
27
28 x.bravo.prependChild(<foo>bar</foo>);
29
30 TEST(2, correct, x);
31
32 emps =
33 <employees>
34 <employee>
35 <name>John</name>
36 </employee>
37 <employee>
38 <name>Sue</name>
39 </employee>
40 </employees>
41
42 correct =
43 <employees>
44 <employee>
45 <prefix>Mr.</prefix>
46 <name>John</name>
47 </employee>
48 <employee>
49 <name>Sue</name>
50 </employee>
51 </employees>
52
53 emps.employee.(name == "John").prependChild(<prefix>Mr.</prefix>);
54
55 TEST(3, correct, emps);
56
57 END();