| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = '15.3.5.1.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: 15.3.5.1.js |
| 10 | ECMA Section: Function.length |
| 11 | Description: |
| 12 | |
| 13 | The value of the length property is usually an integer that indicates the |
| 14 | "typical" number of arguments expected by the function. However, the |
| 15 | language permits the function to be invoked with some other number of |
| 16 | arguments. The behavior of a function when invoked on a number of arguments |
| 17 | other than the number specified by its length property depends on the function. |
| 18 | |
| 19 | this test needs a 1.2 version check. |
| 20 | |
| 21 | http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204 |
| 22 | |
| 23 | |
| 24 | Author: [email protected] |
| 25 | Date: 12 november 1997 |
| 26 | */ |
| 27 | |
| 28 | var SECTION = "15.3.5.1"; |
| 29 | var VERSION = "ECMA_1"; |
| 30 | var TITLE = "Function.length"; |
| 31 | var BUGNUMBER="104204"; |
| 32 | startTest(); |
| 33 | |
| 34 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 35 | |
| 36 | var f = new Function( "a","b", "c", "return f.length"); |
| 37 | |
| 38 | new TestCase( SECTION, |
| 39 | 'var f = new Function( "a","b", "c", "return f.length"); f()', |
| 40 | 3, |
| 41 | f() ); |
| 42 | |
| 43 | |
| 44 | new TestCase( SECTION, |
| 45 | 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', |
| 46 | 3, |
| 47 | f(1,2,3,4,5) ); |
| 48 | |
| 49 | test(); |
| 50 |