]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Array/regress-107138.js
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation.
17 * All Rights Reserved.
19 * Contributor(s): morse@netscape.com, pschwartau@netscape.com
20 * Date: 29 October 2001
22 * SUMMARY: Regression test for bug 107138
23 * See http://bugzilla.mozilla.org/show_bug.cgi?id=107138
25 * The bug: arr['1'] == undefined instead of arr['1'] == 'one'.
26 * The bug was intermittent and did not always occur...
28 * The cnSTRESS constant defines how many times to repeat this test.
30 //-----------------------------------------------------------------------------
35 var summary
= 'Regression test for bug 107138';
39 var actualvalues
= [];
41 var expectedvalues
= [];
44 var arr
= ['zero', 'one', 'two', 'three', 'four', 'five',
45 'six', 'seven', 'eight', 'nine', 'ten'];
48 // This bug was intermittent. Stress-test it.
49 for (var j
=0; j
<cnSTRESS
; j
++)
51 status
= inSection(j
+ cnDASH
+ 1);
56 status
= inSection(j
+ cnDASH
+ 2);
61 status
= inSection(j
+ cnDASH
+ 3);
66 status
= inSection(j
+ cnDASH
+ 4);
71 status
= inSection(j
+ cnDASH
+ 5);
76 status
= inSection(j
+ cnDASH
+ 6);
81 status
= inSection(j
+ cnDASH
+ 7);
86 status
= inSection(j
+ cnDASH
+ 8);
91 status
= inSection(j
+ cnDASH
+ 9);
96 status
= inSection(j
+ cnDASH
+ 10);
101 status
= inSection(j
+ cnDASH
+ 11);
106 status
= inSection(j
+ cnDASH
+ 12);
111 status
= inSection(j
+ cnDASH
+ 13);
116 status
= inSection(j
+ cnDASH
+ 14);
121 status
= inSection(j
+ cnDASH
+ 15);
126 status
= inSection(j
+ cnDASH
+ 16);
131 status
= inSection(j
+ cnDASH
+ 17);
136 status
= inSection(j
+ cnDASH
+ 18);
141 status
= inSection(j
+ cnDASH
+ 19);
146 status
= inSection(j
+ cnDASH
+ 20);
151 status
= inSection(j
+ cnDASH
+ 21);
156 status
= inSection(j
+ cnDASH
+ 22);
163 //-----------------------------------------------------------------------------
165 //-----------------------------------------------------------------------------
171 statusitems
[UBound
] = status
;
172 actualvalues
[UBound
] = actual
;
173 expectedvalues
[UBound
] = expect
;
181 printBugNumber (bug
);
182 printStatus (summary
);
184 for (var i
=0; i
<UBound
; i
++)
186 reportCompare(expectedvalues
[i
], actualvalues
[i
], statusitems
[i
]);