js/src/tests/test262/ch11/11.2/11.2.4/S11.2.4_A1.2_T2.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:7927644fdb02
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /**
5 * Arguments : (ArgumentList)
6 *
7 * @path ch11/11.2/11.2.4/S11.2.4_A1.2_T2.js
8 * @description Function is declared with FormalParameterList
9 */
10
11 f_arg = function(x,y) {
12 return arguments;
13 }
14
15 //CHECK#1
16 if (f_arg(1,2,3).length !== 3) {
17 $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1,2,3).length === 3. Actual: ' + (f_arg(1,2,3).length));
18 }
19
20 //CHECK#2
21 if (f_arg(1)[0] !== 1) {
22 $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1)[0] === 1. Actual: ' + (f_arg(1)[0]));
23 }
24
25 //CHECK#3
26 if (f_arg(1,2)[1] !== 2) {
27 $ERROR('#3: f_arg = function(x,y) {return arguments;} f_arg(1,2)[1] === 2. Actual: ' + (f_arg(1,2)[1]));
28 }
29
30 //CHECK#4
31 if (f_arg(1,2,3)[2] !== 3) {
32 $ERROR('#4: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[2] === 3. Actual: ' + (f_arg(1,2,3)[2]));
33 }
34
35 //CHECK#5
36 if (f_arg(1,2,3)[3] !== undefined) {
37 $ERROR('#5: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[3] === undefined. Actual: ' + (f_arg(1,2,3)[3]));
38 }
39
40 //CHECK#6
41 if (f_arg.length !== 2) {
42 $ERROR('#6: f_arg = function(x,y) {return arguments;} f_arg.length === 2. Actual: ' + (f_arg.length));
43 }
44

mercurial