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): pschwartau@netscape.com
22 * SUMMARY: Regression test for Bugzilla bug 85880
24 * Rhino interpreted mode was nulling out the arguments object of a
25 * function if it happened to call another function inside its body.
27 * See http://bugzilla.mozilla.org/show_bug.cgi?id=85880
30 //-------------------------------------------------------------------------------------------------
33 var summary = 'Arguments object of g(){f()} should not be null';
34 var cnNonNull = 'Arguments != null';
35 var cnNull = 'Arguments == null';
40 var actualvalues = [];
42 var expectedvalues = [];
54 status = 'Section A of test';
55 actual = (f2() == null);
59 status = 'Section B of test';
60 actual = (f2(0) == null);
70 status = 'Section C of test';
71 actual = (f3() == null);
75 status = 'Section D of test';
76 actual = (f3(0) == null);
88 status = 'Section E of test';
89 actual = (f4() == null);
93 status = 'Section F of test';
94 actual = (f4(0) == null);
108 status = 'Section G of test';
109 actual = (f5() == null);
113 status = 'Section H of test';
114 actual = (f5(0) == null);
120 //-------------------------------------------------------------------------------------------------
122 //-------------------------------------------------------------------------------------------------
127 statusitems[UBound] = status;
128 actualvalues[UBound] = isThisNull(actual);
129 expectedvalues[UBound] = isThisNull(expect);
137 printBugNumber (bug);
138 printStatus (summary);
140 for (var i = 0; i < UBound; i++)
142 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
149 function isThisNull(bool)
151 return bool? cnNull : cnNonNull