]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/FunctionObjects/15.3.5.3.js
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
23 File Name: 15.3.5.3.js
24 ECMA Section: Function.arguments
27 The value of the arguments property is normally null if there is no
28 outstanding invocation of the function in progress (that is, the
29 function has been called but has not yet returned). When a non-internal
30 Function object (15.3.2.1) is invoked, its arguments property is
31 "dynamically bound" to a newly created object that contains the arguments
32 on which it was invoked (see 10.1.6 and 10.1.8). Note that the use of this
33 property is discouraged; it is provided principally for compatibility
34 with existing old code.
36 See sections 10.1.6 and 10.1.8 for more extensive tests.
38 Author: christine@netscape.com
39 Date: 12 november 1997
42 var SECTION
= "15.3.5.3";
43 var VERSION
= "ECMA_1";
45 var TITLE
= "Function.arguments";
47 writeHeaderToLog( SECTION
+ " "+ TITLE
);
49 var testcases
= getTestCases();
52 function getTestCases() {
53 var array
=new Array();
56 var MYFUNCTION
= new Function( "return this.arguments" );
59 array
[item
++] = new TestCase( SECTION
, "var MYFUNCTION = new Function( 'return this.arguments' ); MYFUNCTION.arguments", null, MYFUNCTION
.arguments
);
64 for ( tc
=0; tc
< testcases
.length
; tc
++ ) {
65 testcases
[tc
].passed
= writeTestCaseResult(
68 testcases
[tc
].description
+" = "+
69 testcases
[tc
].actual
);
71 testcases
[tc
].reason
+= ( testcases
[tc
].passed
) ? "" : "wrong value ";