Debian Codegraph @

rhino/testsrc/tests/e4x/TypeConversion/10.3.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 = '10.3.js';
8
9 START("10.3 - toXML");
10
11 var x;
12
13 // boolean
14 x = new Boolean(true);
15 TEST_XML(1, "true", new XML(x));
16
17 // number
18 x = new Number(123);
19 TEST_XML(2, "123", new XML(x));
20
21 // String
22 x = new String("<alpha><bravo>one</bravo></alpha>");
23 TEST(3, <alpha><bravo>one</bravo></alpha>, new XML(x));
24
25 // XML
26 x = new XML(<alpha><bravo>one</bravo></alpha>);
27 TEST(4, <alpha><bravo>one</bravo></alpha>, new XML(x));
28
29 // XMLList
30 x = new XMLList(<alpha><bravo>one</bravo></alpha>);
31 TEST(5, <alpha><bravo>one</bravo></alpha>, new XML(x));
32
33 try {
34 x = new XMLList(<alpha>one</alpha> + <bravo>two</bravo>);
35 new XML(x);
36 SHOULD_THROW(6);
37 } catch (ex) {
38 TEST(6, "TypeError", ex.name);
39 }
40
41 END();