Debian Codegraph @

rhino/testsrc/tests/e4x/Expressions/11.2.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 = '11.2.2.js';
8
9 START("11.2.2 - Function Calls");
10
11
12 rectangle = <rectangle>
13 <x>50</x>
14 <y>75</y>
15 <length>20</length>
16 <width>30</width>
17 </rectangle>;
18
19
20 TEST(1, 1, rectangle.length());
21
22 TEST(2, <length>20</length>, rectangle.length);
23
24 shipto = <shipto>
25 <name>Fred Jones</name>
26 <street>123 Foobar Ave.</street>
27 <citystatezip>Redmond, WA, 98008</citystatezip>
28 </shipto>;
29
30
31 upperName = shipto.name.toUpperCase();
32 TEST(3, "FRED JONES", upperName);
33
34 upperName = shipto.name.toString().toUpperCase();
35 TEST(4, "FRED JONES", upperName);
36 upperName = shipto.name.toUpperCase();
37 TEST(5, "FRED JONES", upperName);
38
39 citystatezip = shipto.citystatezip.split(", ");
40 state = citystatezip[1];
41 TEST(6, "WA", state);
42 zip = citystatezip[2];
43 TEST(7, "98008", zip);
44
45 citystatezip = shipto.citystatezip.toString().split(", ");
46 state = citystatezip[1];
47 TEST(8, "WA", state);
48 zip = citystatezip[2];
49 TEST(9, "98008", zip);
50
51 // Test method name/element name conflicts
52
53 x =
54 <alpha>
55 <name>Foo</name>
56 <length>Bar</length>
57 </alpha>;
58
59 TEST(10, <name>Foo</name>, x.name);
60 TEST(11, QName("alpha"), x.name());
61 TEST(12, <length>Bar</length>, x.length);
62 TEST(13, 1, x.length());
63 TEST(14, x, x.(name == "Foo"));
64 x.name = "foobar";
65 TEST(15, <name>foobar</name>, x.name);
66 TEST(16, QName("alpha"), x.name());
67
68
69
70 END();