Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/call/S11.2.4_A1.2_T2.js

raw
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 info: "Arguments : (ArgumentList)"
6 es5id: 11.2.4_A1.2_T2
7 description: Function is declared with FormalParameterList
8 ---*/
9
10 var f_arg = function(x,y) {
11 return arguments;
12 }
13
14 //CHECK#1
15 if (f_arg(1,2,3).length !== 3) {
16 $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1,2,3).length === 3. Actual: ' + (f_arg(1,2,3).length));
17 }
18
19 //CHECK#2
20 if (f_arg(1)[0] !== 1) {
21 $ERROR('#1: f_arg = function(x,y) {return arguments;} f_arg(1)[0] === 1. Actual: ' + (f_arg(1)[0]));
22 }
23
24 //CHECK#3
25 if (f_arg(1,2)[1] !== 2) {
26 $ERROR('#3: f_arg = function(x,y) {return arguments;} f_arg(1,2)[1] === 2. Actual: ' + (f_arg(1,2)[1]));
27 }
28
29 //CHECK#4
30 if (f_arg(1,2,3)[2] !== 3) {
31 $ERROR('#4: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[2] === 3. Actual: ' + (f_arg(1,2,3)[2]));
32 }
33
34 //CHECK#5
35 if (f_arg(1,2,3)[3] !== undefined) {
36 $ERROR('#5: f_arg = function(x,y) {return arguments;} f_arg(1,2,3)[3] === undefined. Actual: ' + (f_arg(1,2,3)[3]));
37 }
38
39 //CHECK#6
40 if (f_arg.length !== 2) {
41 $ERROR('#6: f_arg = function(x,y) {return arguments;} f_arg.length === 2. Actual: ' + (f_arg.length));
42 }