S11.2.4_A1.2_T2.js (1349B)
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 throw new Test262Error('#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 throw new Test262Error('#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 throw new Test262Error('#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 throw new Test262Error('#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 throw new Test262Error('#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 throw new Test262Error('#6: f_arg = function(x,y) {return arguments;} f_arg.length === 2. Actual: ' + (f_arg.length)); 42 } 43 44 reportCompare(0, 0);