michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 10.1.3-1.js michael@0: ECMA Section: 10.1.3 michael@0: Description: michael@0: michael@0: For each formal parameter, as defined in the FormalParameterList, create michael@0: a property of the variable object whose name is the Identifier and whose michael@0: attributes are determined by the type of code. The values of the michael@0: parameters are supplied by the caller. If the caller supplies fewer michael@0: parameter values than there are formal parameters, the extra formal michael@0: parameters have value undefined. If two or more formal parameters share michael@0: the same name, hence the same property, the corresponding property is michael@0: given the value that was supplied for the last parameter with this name. michael@0: If the value of this last parameter was not supplied by the caller, michael@0: the value of the corresponding property is undefined. michael@0: michael@0: michael@0: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104191 michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: michael@0: var SECTION = "10.1.3-1"; michael@0: var VERSION = "ECMA_1"; michael@0: var TITLE = "Variable Instantiation: Formal Parameters"; michael@0: var BUGNUMBER="104191"; michael@0: startTest(); michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: var myfun1 = new Function( "a", "a", "return a" ); michael@0: var myfun2 = new Function( "a", "b", "a", "return a" ); michael@0: michael@0: function myfun3(a, b, a) { michael@0: return a; michael@0: } michael@0: michael@0: // myfun1, myfun2, myfun3 tostring michael@0: michael@0: michael@0: new TestCase( michael@0: SECTION, michael@0: String(myfun2) +"; myfun2(2,4,8)", michael@0: 8, michael@0: myfun2(2,4,8) ); michael@0: michael@0: new TestCase( michael@0: SECTION, michael@0: "myfun2(2,4)", michael@0: void 0, michael@0: myfun2(2,4)); michael@0: michael@0: new TestCase( michael@0: SECTION, michael@0: String(myfun3) +"; myfun3(2,4,8)", michael@0: 8, michael@0: myfun3(2,4,8) ); michael@0: michael@0: new TestCase( michael@0: SECTION, michael@0: "myfun3(2,4)", michael@0: void 0, michael@0: myfun3(2,4) ); michael@0: michael@0: test(); michael@0: