Debian Codegraph @

rhino/testsrc/tests/e4x/Types/9.1.1.2.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 = '9.1.1.2.js';
8
9 START('9.1.1.2 - XML [[Put]]');
10
11
12 // .
13 var x =
14 <alpha attr1="value1" attr2="value2">
15 <bravo>
16 one
17 <charlie>two</charlie>
18 </bravo>
19 </alpha>;
20
21 var correct =
22 <charlie>new</charlie>;
23
24 x.bravo.charlie = "new"
25 TEST(1, correct, x.bravo.charlie)
26 x.bravo = <delta>three</delta>
27 TEST(2, "three", x.delta.toString())
28
29 // .@
30 x = <alpha attr1="value1" attr2="value2"><bravo>one<charlie>two</charlie></bravo></alpha>
31 x.@attr1 = "newValue"
32 TEST_XML(3, "newValue", x.@attr1)
33
34 // From Martin
35
36 XML.prettyPrinting = false;
37
38 var god = <god><name>Kibo</name></god>;
39 god.name = <><prename>James</prename><nickname>Kibo</nickname></>;
40
41 var expect = '<god><prename>James</prename><nickname>Kibo</nickname></god>';
42 actual = god;
43 TEST_XML(4, expect, actual);
44
45 END();