Debian Codegraph @

rhino/testsrc/tests/e4x/Types/9.1.1.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 = '9.1.1.3.js';
8
9 START("9.1.1.3 - XML [[Delete]]");
10
11 // .@
12 x =
13 <alpha attr1="value1">one</alpha>;
14
15 delete x.@attr1;
16 TEST_XML(1, "", x.@attr1);
17 TEST(2, <alpha>one</alpha>, x);
18
19 // ..@
20 x =
21 <alpha attr1="value1">
22 one
23 <bravo attr2="value2">
24 two
25 <charlie attr3="value3">three</charlie>
26 </bravo>
27 </alpha>;
28
29 correct =
30 <alpha attr1="value1">
31 one
32 <bravo attr2="value2">
33 two
34 <charlie>three</charlie>
35 </bravo>
36 </alpha>;
37
38 delete x..@attr3;
39 TEST(3, correct, x);
40
41 // ..@*
42 x =
43 <alpha attr1="value1">
44 one
45 <bravo attr2="value2">
46 two
47 <charlie attr3="value3">three</charlie>
48 </bravo>
49 </alpha>;
50
51 correct =
52 <alpha>
53 one
54 <bravo>
55 two
56 <charlie>three</charlie>
57 </bravo>
58 </alpha>;
59
60 delete x..@*;
61 TEST(4, correct, x);
62
63 x =
64 <BODY>
65 <HR id="i1"/>
66 <HR id="i2"/>
67 <HR id="i3"/>
68 <HR id="i4"/>
69 </BODY>;
70
71 correct =
72 <BODY></BODY>;
73
74 delete x..HR;
75 TEST(5, correct, x);
76
77 x =
78 <BODY>
79 ECMA-357
80 <HR id="i1"/>
81 <HR id="i2"/>
82 <HR id="i3"/>
83 <HR id="i4"/>
84 </BODY>;
85
86 correct =
87 <BODY>
88 ECMA-357
89 </BODY>;
90
91 delete x..HR;
92 TEST(6, correct.toXMLString(), x.toXMLString());
93
94 x =
95 <BODY>
96 ECMA-357
97 <HR id="i1"/>
98 <HR id="i2"/>
99 <HR id="i3"/>
100 <HR id="i4"/>
101 </BODY>;
102
103 correct =
104 <BODY>ECMA-357</BODY>;
105
106 delete x.HR;
107 TEST(7, correct, x);
108
109 x =
110 <BODY>
111 ECMA-357
112 <HR id="i1"/>
113 <HR id="i2"/>
114 <HR id="i3"/>
115 <HR id="i4"/>
116 </BODY>;
117
118 correct =
119 <BODY></BODY>;
120
121 delete x..*;
122 TEST(8, correct, x);
123
124 x =
125 <BODY>
126 ECMA-357
127 <HR id="i1"/>
128 <HR id="i2"/>
129 <HR id="i3"/>
130 <HR id="i4"/>
131 </BODY>;
132
133 correct =
134 <BODY></BODY>;
135
136 delete x.*;
137 TEST(9, correct, x);
138
139 x =
140 <BODY>
141 <UL>
142 <LI id="i1"/>
143 <LI id="i2"/>
144 <LI id="i3"/>
145 </UL>
146 </BODY>;
147
148 correct =
149 <BODY>
150 <UL>
151 <LI id="i1"/>
152 <LI id="i2"/>
153 <LI id="i3"/>
154 </UL>
155 </BODY>;
156
157 delete x.LI;
158 TEST(10, correct, x);
159
160 x =
161 <BODY>
162 <UL>
163 <LI id="i1"/>
164 <LI id="i2"/>
165 <LI id="i3"/>
166 </UL>
167 </BODY>;
168
169 correct =
170 <BODY>
171 <UL></UL>
172 </BODY>;
173
174 delete x..LI;
175 TEST(11, correct, x);
176
177 END();