]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_3/Function/regress-94506.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. All
19 * Contributor(s): deneen@alum.bucknell.edu, shaver@mozilla.org
20 * Date: 08 August 2001
22 * SUMMARY: When we invoke a function, the arguments object should take
23 * a back seat to any local identifier named "arguments".
25 * See http://bugzilla.mozilla.org/show_bug.cgi?id=94506
27 //-----------------------------------------------------------------------------
30 var summary
= 'Testing functions employing identifiers named "arguments"';
34 var actualvalues
= [];
36 var expectedvalues
= [];
37 var TYPE_OBJECT
= typeof new Object();
41 // use a parameter named "arguments"
42 function F1(arguments
)
48 // use a local variable named "arguments"
56 // same thing in a different order. CHANGES THE RESULT!
64 // use the global variable above named "arguments"
73 * In Sections 1 and 2, expect the local identifier, not the arguments object.
74 * In Sections 3 and 4, expect the arguments object, not the the identifier.
77 status
= 'Section 1 of test';
83 status
= 'Section 2 of test';
89 status
= 'Section 3 of test';
95 status
= 'Section 4 of test';
101 // Let's try calling F1 without providing a parameter -
102 status
= 'Section 5 of test';
108 // Let's try calling F1 with too many parameters -
109 status
= 'Section 6 of test';
110 actual
= F1(3,33,333);
116 //-----------------------------------------------------------------------------
118 //-----------------------------------------------------------------------------
123 statusitems
[UBound
] = status
;
124 actualvalues
[UBound
] = actual
;
125 expectedvalues
[UBound
] = expect
;
133 printBugNumber (bug
);
134 printStatus (summary
);
136 for (var i
= 0; i
< UBound
; i
++)
138 reportCompare(expectedvalues
[i
], actualvalues
[i
], statusitems
[i
]);