|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 //----------------------------------------------------------------------------- |
|
7 var BUGNUMBER = 260106; |
|
8 var summary = 'Elisons in Array literals should not be enumed'; |
|
9 var actual = ''; |
|
10 var expect = ''; |
|
11 var status; |
|
12 var prop; |
|
13 var array; |
|
14 |
|
15 printBugNumber(BUGNUMBER); |
|
16 printStatus (summary); |
|
17 |
|
18 status = summary + ' ' + inSection(1) + ' [,1] '; |
|
19 array = [,1]; |
|
20 actual = ''; |
|
21 expect = '1'; |
|
22 for (prop in array) |
|
23 { |
|
24 if (prop != 'length') |
|
25 { |
|
26 actual += prop; |
|
27 } |
|
28 } |
|
29 reportCompare(expect, actual, status); |
|
30 |
|
31 status = summary + ' ' + inSection(2) + ' [,,1] '; |
|
32 array = [,,1]; |
|
33 actual = ''; |
|
34 expect = '2'; |
|
35 for (prop in array) |
|
36 { |
|
37 if (prop != 'length') |
|
38 { |
|
39 actual += prop; |
|
40 } |
|
41 } |
|
42 reportCompare(expect, actual, status); |
|
43 |
|
44 status = summary + ' ' + inSection(3) + ' [1,] '; |
|
45 array = [1,]; |
|
46 actual = ''; |
|
47 expect = '0'; |
|
48 for (prop in array) |
|
49 { |
|
50 if (prop != 'length') |
|
51 { |
|
52 actual += prop; |
|
53 } |
|
54 } |
|
55 reportCompare(expect, actual, status); |
|
56 |
|
57 status = summary + ' ' + inSection(4) + ' [1,,] '; |
|
58 array = [1,,]; |
|
59 actual = ''; |
|
60 expect = '0'; |
|
61 for (prop in array) |
|
62 { |
|
63 if (prop != 'length') |
|
64 { |
|
65 actual += prop; |
|
66 } |
|
67 } |
|
68 reportCompare(expect, actual, status); |