Debian Codegraph @

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