Debian Codegraph @

rhino/testsrc/tests/e4x/XML/13.4.4.31.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.31.js';
8
9 START("13.4.4.31 - XML removeNamespace()");
10
11 TEST(1, true, XML.prototype.hasOwnProperty("removeNamespace"));
12
13 x =
14 <alpha xmlns:foo="http://foo/">
15 <bravo>one</bravo>
16 </alpha>;
17
18 correct =
19 <alpha>
20 <bravo>one</bravo>
21 </alpha>;
22
23 x.removeNamespace("http://foo/");
24
25 TEST(2, correct, x);
26
27 // Shouldn't remove namespace if referenced
28 x =
29 <foo:alpha xmlns:foo="http://foo/">
30 <bravo>one</bravo>
31 </foo:alpha>;
32
33 correct =
34 <foo:alpha xmlns:foo="http://foo/">
35 <bravo>one</bravo>
36 </foo:alpha>;
37
38 x.removeNamespace("http://foo/");
39
40 TEST(3, correct, x);
41
42 END();