]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Regress/regress-102725.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / js1_5 / Regress / regress-102725.js
1 /*
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/
6 *
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.
11 *
12 * The Original Code is mozilla.org code.
13 *
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.
18 *
19 * Contributor(s): dbaron@fas.harvard.edu, pschwartau@netscape.com
20 * Date: 09 October 2001
21 *
22 * SUMMARY: Regression test for Bugzilla bug 102725
23 * See http://bugzilla.mozilla.org/show_bug.cgi?id=102725
24 * "gcc -O2 problems converting numbers to strings"
25 *
26 */
27 //-----------------------------------------------------------------------------
28 var UBound = 0;
29 var bug = 102725;
30 var summary = 'Testing converting numbers to strings';
31 var status = '';
32 var statusitems = [];
33 var actual = '';
34 var actualvalues = [];
35 var expect= '';
36 var expectedvalues = [];
37
38
39 /*
40 * Successive calls to foo.toString() were producing different answers!
41 */
42 status = inSection(1);
43 foo = (new Date()).getTime();
44 actual = foo.toString();
45 expect = foo.toString();
46 addThis();
47
48
49
50 //-----------------------------------------------------------------------------
51 test();
52 //-----------------------------------------------------------------------------
53
54
55
56 function addThis()
57 {
58 statusitems[UBound] = status;
59 actualvalues[UBound] = actual;
60 expectedvalues[UBound] = expect;
61 UBound++;
62 }
63
64
65 function test()
66 {
67 enterFunc ('test');
68 printBugNumber (bug);
69 printStatus (summary);
70
71 for (var i=0; i<UBound; i++)
72 {
73 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
74 }
75
76 exitFunc ('test');
77 }