1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch10/10.1/S10.1.6_A1_T2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * The activation object is initialised with a property with name arguments and attributes {DontDelete} 1.9 + * 1.10 + * @path ch10/10.1/S10.1.6_A1_T2.js 1.11 + * @description Checking funtion which returns property "arguments" 1.12 + */ 1.13 + 1.14 +var ARG_STRING = "value of the argument property"; 1.15 + 1.16 +function f1() { 1.17 + this.constructor.prototype.arguments = ARG_STRING; 1.18 + return arguments; 1.19 +} 1.20 + 1.21 +//CHECK#1 1.22 +if ((new f1(1,2,3,4,5)).length !== 5) 1.23 + $ERROR('#1: (new f1(1,2,3,4,5)).length===5, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); 1.24 + 1.25 +//CHECK#2 1.26 +if ((new f1(1,2,3,4,5))[3] !== 4) 1.27 + $ERROR('#2: (new f1(1,2,3,4,5))[3]===4, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); 1.28 + 1.29 +//CHECK#3 1.30 +var x = new f1(1,2,3,4,5); 1.31 +if (delete x[3] !== true) 1.32 + $ERROR('#3.1: Function parameters have attribute {DontDelete}'); 1.33 + 1.34 +if (x[3] === 4) 1.35 + $ERROR('#3.2: Function parameters have attribute {DontDelete}'); 1.36 +