Debian Codegraph @

rhino/testsrc/tests/e4x/XML/13.4.4.24.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.24.js';
8
9 START("13.4.4.24 - XML namespaceDeclarations()");
10
11 TEST(1, true, XML.prototype.hasOwnProperty("namespaceDeclarations"));
12
13 x =
14 <foo:alpha xmlns:foo="http://foo/" xmlns:bar="http://bar/">
15 <foo:bravo>one</foo:bravo>
16 </foo:alpha>;
17
18 y = x.namespaceDeclarations();
19
20 TEST(2, 2, y.length);
21 TEST(3, "object", typeof(y[0]));
22 TEST(4, "object", typeof(y[1]));
23
24 // Spec section is silent on whether these declarations must go into the array in the order
25 // in which they are in the file. We have to test differently here because some versions of Java
26 // pick different versions.
27
28 TEST(5, true, y.some(function(e) {
29 return ((e.prefix === 'foo') &&
30 (Namespace("http://foo/") == e));
31 }));
32
33 TEST(6, true, y.some(function(e) {
34 return ((e.prefix === 'bar') &&
35 (Namespace("http://bar/") == e));
36 }));
37
38 END();