|
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 |
|
7 /** |
|
8 File Name: 10.1.3-1.js |
|
9 ECMA Section: 10.1.3 |
|
10 Description: |
|
11 |
|
12 For each formal parameter, as defined in the FormalParameterList, create |
|
13 a property of the variable object whose name is the Identifier and whose |
|
14 attributes are determined by the type of code. The values of the |
|
15 parameters are supplied by the caller. If the caller supplies fewer |
|
16 parameter values than there are formal parameters, the extra formal |
|
17 parameters have value undefined. If two or more formal parameters share |
|
18 the same name, hence the same property, the corresponding property is |
|
19 given the value that was supplied for the last parameter with this name. |
|
20 If the value of this last parameter was not supplied by the caller, |
|
21 the value of the corresponding property is undefined. |
|
22 |
|
23 |
|
24 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104191 |
|
25 |
|
26 Author: christine@netscape.com |
|
27 Date: 12 november 1997 |
|
28 */ |
|
29 |
|
30 var SECTION = "10.1.3-1"; |
|
31 var VERSION = "ECMA_1"; |
|
32 var TITLE = "Variable Instantiation: Formal Parameters"; |
|
33 var BUGNUMBER="104191"; |
|
34 startTest(); |
|
35 |
|
36 writeHeaderToLog( SECTION + " "+ TITLE); |
|
37 |
|
38 var myfun1 = new Function( "a", "a", "return a" ); |
|
39 var myfun2 = new Function( "a", "b", "a", "return a" ); |
|
40 |
|
41 function myfun3(a, b, a) { |
|
42 return a; |
|
43 } |
|
44 |
|
45 // myfun1, myfun2, myfun3 tostring |
|
46 |
|
47 |
|
48 new TestCase( |
|
49 SECTION, |
|
50 String(myfun2) +"; myfun2(2,4,8)", |
|
51 8, |
|
52 myfun2(2,4,8) ); |
|
53 |
|
54 new TestCase( |
|
55 SECTION, |
|
56 "myfun2(2,4)", |
|
57 void 0, |
|
58 myfun2(2,4)); |
|
59 |
|
60 new TestCase( |
|
61 SECTION, |
|
62 String(myfun3) +"; myfun3(2,4,8)", |
|
63 8, |
|
64 myfun3(2,4,8) ); |
|
65 |
|
66 new TestCase( |
|
67 SECTION, |
|
68 "myfun3(2,4)", |
|
69 void 0, |
|
70 myfun3(2,4) ); |
|
71 |
|
72 test(); |
|
73 |