michael@0: // |reftest| skip -- obsolete test 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: 15.3.5.1.js michael@0: ECMA Section: Function.length michael@0: Description: michael@0: michael@0: The value of the length property is usually an integer that indicates the michael@0: "typical" number of arguments expected by the function. However, the michael@0: language permits the function to be invoked with some other number of michael@0: arguments. The behavior of a function when invoked on a number of arguments michael@0: other than the number specified by its length property depends on the function. michael@0: michael@0: This checks the pre-ecma behavior Function.length. michael@0: michael@0: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204 michael@0: michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: michael@0: var SECTION = "function/length.js"; michael@0: var VERSION = "ECMA_1"; michael@0: var TITLE = "Function.length"; michael@0: var BUGNUMBER="104204"; michael@0: michael@0: startTest(); michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: var f = new Function( "a","b", "c", "return f.length"); michael@0: michael@0: if ( version() <= 120 ) { michael@0: michael@0: new TestCase( SECTION, michael@0: 'var f = new Function( "a","b", "c", "return f.length"); f()', michael@0: 0, michael@0: f() ); michael@0: michael@0: new TestCase( SECTION, michael@0: 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', michael@0: 5, michael@0: f(1,2,3,4,5) ); michael@0: } else { michael@0: michael@0: new TestCase( SECTION, michael@0: 'var f = new Function( "a","b", "c", "return f.length"); f()', michael@0: 3, michael@0: f() ); michael@0: michael@0: new TestCase( SECTION, michael@0: 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', michael@0: 3, michael@0: f(1,2,3,4,5) ); michael@0: michael@0: michael@0: } michael@0: test();