Debian Codegraph @

rhino/testsrc/tests/e4x/XMLList/13.5.4.11.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.11.js';
8
9 START("13.5.4.11 - XMLList hasOwnProperty()");
10
11 TEST(1, true, XMLList.prototype.hasOwnProperty("hasOwnProperty"));
12
13
14 x =
15 <>
16 <alpha attr1="value1">
17 <bravo>one</bravo>
18 <charlie>
19 two
20 three
21 <echo>four</echo>
22 </charlie>
23 <delta />
24 </alpha>
25 <delta>
26 <echo>five</echo>
27 </delta>
28 </>;
29
30 // Returns true for elements/attributes
31 TEST(2, true, x.hasOwnProperty("bravo"));
32 TEST(3, true, x.hasOwnProperty("@attr1"));
33 TEST(4, false, x.hasOwnProperty("foobar"));
34 TEST(5, true, x.hasOwnProperty("echo"));
35
36 // Test for XML Prototype Object - returns true for XML methods.
37 TEST(5, true, XMLList.prototype.hasOwnProperty("toString"));
38 TEST(6, false, XMLList.prototype.hasOwnProperty("foobar"));
39
40 END();