|
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 * A property is created with name callee with property |
|
6 * attributes { DontEnum } and no others |
|
7 * |
|
8 * @path ch10/10.6/S10.6_A3_T2.js |
|
9 * @description Checking if enumerating the arguments.callee property fails |
|
10 */ |
|
11 |
|
12 //CHECK#1 |
|
13 function f1(){ |
|
14 for(var x in arguments){ |
|
15 if (x === "callee"){ |
|
16 return false; |
|
17 } |
|
18 } |
|
19 return true; |
|
20 } |
|
21 |
|
22 try{ |
|
23 if(!f1()){ |
|
24 $ERROR("#1: A property callee don't have attribute { DontEnum }"); |
|
25 } |
|
26 } |
|
27 catch(e){ |
|
28 $ERROR("#1: arguments object don't exists"); |
|
29 } |
|
30 |
|
31 //CHECK#2 |
|
32 var f2 = function(){ |
|
33 for(var x in arguments){ |
|
34 if (x === "callee"){ |
|
35 return false; |
|
36 } |
|
37 } |
|
38 return true; |
|
39 } |
|
40 |
|
41 try{ |
|
42 if(!f2()){ |
|
43 $ERROR("#2: A property callee don't have attribute { DontEnum }"); |
|
44 } |
|
45 } |
|
46 catch(e){ |
|
47 $ERROR("#2: arguments object don't exists"); |
|
48 } |
|
49 |