michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * A property is created with name length with property michael@0: * attributes { DontEnum } and no others michael@0: * michael@0: * @path ch10/10.6/S10.6_A5_T2.js michael@0: * @description Checking if enumerating the arguments.length property fails michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: function f1(){ michael@0: for(var x in arguments){ michael@0: if (x === "length"){ michael@0: return false; michael@0: } michael@0: } michael@0: return true; michael@0: } michael@0: michael@0: try{ michael@0: if(!f1()){ michael@0: $ERROR("#1: A property length don't have attribute { DontEnum }"); michael@0: } michael@0: } michael@0: catch(e){ michael@0: $ERROR("#1: arguments object don't exists"); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: var f2 = function(){ michael@0: for(var x in arguments){ michael@0: if (x === "length"){ michael@0: return false; michael@0: } michael@0: } michael@0: return true; michael@0: } michael@0: michael@0: try{ michael@0: if(!f2()){ michael@0: $ERROR("#2: A property length don't have attribute { DontEnum }"); michael@0: } michael@0: } michael@0: catch(e){ michael@0: $ERROR("#2: arguments object don't exists"); michael@0: } michael@0: