Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * The initial value of the created property length is the number
6 * of actual parameter values supplied by the caller
7 *
8 * @path ch10/10.6/S10.6_A6.js
9 * @description Create function, that returned arguments.length
10 */
12 function f1(){
13 return arguments.length;
14 }
16 //CHECK#1
17 if(!(f1() === 0)){
18 $ERROR('#1: argument.length === 0');
19 }
21 //CHECK#2
22 if(!(f1(0) === 1)){
23 $ERROR('#2: argument.length === 1');
24 }
26 //CHECK#3
27 if(!(f1(0, 1) === 2)){
28 $ERROR('#3: argument.length === 2');
29 }
31 //CHECK#4
32 if(!(f1(0, 1, 2) === 3)){
33 $ERROR('#4: argument.length === 3');
34 }
36 //CHECK#5
37 if(!(f1(0, 1, 2, 3) === 4)){
38 $ERROR('#5: argument.length === 4');
39 }
41 var f2 = function(){return arguments.length;};
43 //CHECK#6
44 if(!(f2() === 0)){
45 $ERROR('#6: argument.length === 0');
46 }
48 //CHECK#7
49 if(!(f2(0) === 1)){
50 $ERROR('#7: argument.length === 1');
51 }
53 //CHECK#8
54 if(!(f2(0, 1) === 2)){
55 $ERROR('#8: argument.length === 2');
56 }
58 //CHECK#9
59 if(!(f2(0, 1, 2) === 3)){
60 $ERROR('#9: argument.length === 3');
61 }
63 //CHECK#10
64 if(!(f2(0, 1, 2, 3) === 4)){
65 $ERROR('#10: argument.length === 4');
66 }