S11.2.4_A1.2_T1.js (1202B)
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_T1 7 description: Function is declared with no FormalParameterList 8 ---*/ 9 10 var f_arg = function() { 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()() {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,2,3)[0] !== 1) { 21 throw new Test262Error('#1: f_arg = function()() {return arguments;} f_arg(1,2,3)[0] === 1. Actual: ' + (f_arg(1,2,3)[0])); 22 } 23 24 //CHECK#3 25 if (f_arg(1,2,3)[1] !== 2) { 26 throw new Test262Error('#3: f_arg = function()() {return arguments;} f_arg(1,2,3)[1] === 2. Actual: ' + (f_arg(1,2,3)[1])); 27 } 28 29 //CHECK#4 30 if (f_arg(1,2,3)[2] !== 3) { 31 throw new Test262Error('#4: f_arg = function()() {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()() {return arguments;} f_arg(1,2,3)[3] === undefined. Actual: ' + (f_arg(1,2,3)[3])); 37 } 38 39 reportCompare(0, 0);