|
1 // |reftest| skip -- obsolete test |
|
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
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 checks the pre-ecma behavior Function.length. |
|
20 |
|
21 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204 |
|
22 |
|
23 |
|
24 Author: christine@netscape.com |
|
25 Date: 12 november 1997 |
|
26 */ |
|
27 |
|
28 var SECTION = "function/length.js"; |
|
29 var VERSION = "ECMA_1"; |
|
30 var TITLE = "Function.length"; |
|
31 var BUGNUMBER="104204"; |
|
32 |
|
33 startTest(); |
|
34 writeHeaderToLog( SECTION + " "+ TITLE); |
|
35 |
|
36 var f = new Function( "a","b", "c", "return f.length"); |
|
37 |
|
38 if ( version() <= 120 ) { |
|
39 |
|
40 new TestCase( SECTION, |
|
41 'var f = new Function( "a","b", "c", "return f.length"); f()', |
|
42 0, |
|
43 f() ); |
|
44 |
|
45 new TestCase( SECTION, |
|
46 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', |
|
47 5, |
|
48 f(1,2,3,4,5) ); |
|
49 } else { |
|
50 |
|
51 new TestCase( SECTION, |
|
52 'var f = new Function( "a","b", "c", "return f.length"); f()', |
|
53 3, |
|
54 f() ); |
|
55 |
|
56 new TestCase( SECTION, |
|
57 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', |
|
58 3, |
|
59 f(1,2,3,4,5) ); |
|
60 |
|
61 |
|
62 } |
|
63 test(); |