Debian Codegraph @

rhino/testsrc/tests/e4x/Namespace/regress-350442.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 = 'regress-350442.js';
8
9 var BUGNUMBER = 350442;
10 var summary = 'toXMLString with namespace definitions';
11 var actual, expect;
12
13 printBugNumber(BUGNUMBER);
14 START(summary);
15
16 expect = false;
17 actual = false;
18
19 try
20 {
21 var t1 = <tag1 xmlns="http://ns1"/>;
22 var n2 = new Namespace("http://ns2");
23 t1.@n2::a1="a1 from ns2";
24
25 var t1XMLString = t1.toXMLString();
26
27 var attrMatch = /xmlns:([^=]+)="http:\/\/ns2"/.exec(t1XMLString);
28 if (!attrMatch)
29 throw "No @n2::a1 attribute present";
30
31 var nsRegexp = new RegExp(attrMatch[1] + ':a1="a1 from ns2"');
32 if (!nsRegexp.test(t1XMLString))
33 throw "No namespace declaration present for @ns2::a1";
34 }
35 catch (e)
36 {
37 actual = e;
38 }
39
40 TEST(1, expect, actual);
41
42 END();