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/ 5 * 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. 10 * 11 * The Original Code is Mozilla Communicator client code, released March 12 * 31, 1998. 13 * 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 17 * Rights Reserved. 18 * 19 * Contributor(s): 20 * 21 */ 22 /** 23 File Name: 15.3.5.3.js 24 ECMA Section: Function.arguments 25 Description: 26 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. 35 36 See sections 10.1.6 and 10.1.8 for more extensive tests. 37 38 Author: christine (at) netscape.com 39 Date: 12 november 1997 40 */ 41 42 var SECTION = "15.3.5.3"; 43 var VERSION = "ECMA_1"; 44 startTest(); 45 var TITLE = "Function.arguments"; 46 47 writeHeaderToLog( SECTION + " "+ TITLE); 48 49 var testcases = getTestCases(); 50 test(); 51 52 function getTestCases() { 53 var array =new Array(); 54 var item = 0; 55 56 var MYFUNCTION = new Function( "return this.arguments" ); 57 58 59 array[item++] = new TestCase( SECTION, "var MYFUNCTION = new Function( 'return this.arguments' ); MYFUNCTION.arguments", null, MYFUNCTION.arguments ); 60 61 return array; 62 } 63 function test() { 64 for ( tc=0; tc < testcases.length; tc++ ) { 65 testcases[tc].passed = writeTestCaseResult( 66 testcases[tc].expect, 67 testcases[tc].actual, 68 testcases[tc].description +" = "+ 69 testcases[tc].actual ); 70 71 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "; 72 } 73 stopTest(); 74 return ( testcases ); 75 } 76