Debian Codegraph @

rhino/testsrc/tests/e4x/XMLList/13.5.4.16.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.5.4.16.js';
8
9 START("13.5.4.16 - XMLList parent()");
10
11 TEST(1, true, XMLList.prototype.hasOwnProperty("parent"));
12
13 // Empty should return undefined
14 x = new XMLList();
15 TEST(2, undefined, x.parent());
16
17 // If all XMLList items have same parent, then return that parent.
18 x =
19 <alpha>
20 <bravo>one</bravo>
21 <charlie>two</charlie>
22 <bravo>three<charlie>four</charlie></bravo>
23 </alpha>;
24
25 y = new XMLList();
26 y += x.bravo;
27 y += x.charlie;
28
29 TEST(3, x, y.parent());
30
31 // If items have different parents then return undefined
32 y = new XMLList();
33 y += x.bravo;
34 y += x.bravo.charlie;
35
36 TEST(4, undefined, y.parent());
37
38 y = x..charlie;
39
40 TEST(5, undefined, y.parent());
41
42 END();