Debian Codegraph @

rhino/testsrc/tests/e4x/Namespace/13.2.5.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.2.5.js';
8
9 START("13.2.5 - Properties of Namespace Instances");
10
11 n = new Namespace("ns", "http://someuri");
12 TEST(1, true, n.hasOwnProperty("prefix"));
13 TEST(2, true, n.hasOwnProperty("uri"));
14 TEST(3, true, n.propertyIsEnumerable("prefix"));
15 TEST(4, true, n.propertyIsEnumerable("uri"));
16
17 var prefixCount = 0;
18 var uriCount = 0;
19 var p;
20 for(p in n)
21 {
22 if(p == "prefix") prefixCount++;
23 if(p == "uri") uriCount++;
24 }
25
26 TEST(5, 1, prefixCount);
27 TEST(6, 1, uriCount);
28 TEST(7, "ns", n.prefix);
29 TEST(8, "http://someuri", n.uri);
30
31 END();