Debian Codegraph @

rhino/testsrc/tests/e4x/XML/13.4.4.12.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.12.js';
8
9 START("13.4.4.12 - XML descendants");
10
11 TEST(1, true, XML.prototype.hasOwnProperty("descendants"));
12
13 x =
14 <alpha>
15 <bravo>one</bravo>
16 <charlie>
17 two
18 <bravo>three</bravo>
19 </charlie>
20 </alpha>;
21
22 TEST(2, <bravo>three</bravo>, x.charlie.descendants("bravo"));
23 TEST(3, <><bravo>one</bravo><bravo>three</bravo></>, x.descendants("bravo"));
24
25 // Test *
26 correct = <><bravo>one</bravo>one<charlie>two<bravo>three</bravo></charlie>two<bravo>three</bravo>three</>;
27
28 XML.prettyPrinting = false;
29 TEST(4, correct, x.descendants("*"));
30 TEST(5, correct, x.descendants());
31 XML.prettyPrinting = true;
32
33 END();