Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * The with statement adds a computed object to the front of the
6 * scope chain of the current execution context
7 *
8 * @path ch12/12.10/S12.10_A1.10_T4.js
9 * @description Using iteration statement witthin "with" staement leading to completion by break
10 * iteration statement inside with statement - break completion
11 * @noStrict
12 */
14 this.p1 = 1;
15 this.p2 = 2;
16 this.p3 = 3;
17 var result = "result";
18 var myObj = {p1: 'a',
19 p2: 'b',
20 p3: 'c',
21 value: 'myObj_value',
22 valueOf : function(){return 'obj_valueOf';},
23 parseInt : function(){return 'obj_parseInt';},
24 NaN : 'obj_NaN',
25 Infinity : 'obj_Infinity',
26 eval : function(){return 'obj_eval';},
27 parseFloat : function(){return 'obj_parseFloat';},
28 isNaN : function(){return 'obj_isNaN';},
29 isFinite : function(){return 'obj_isFinite';}
30 }
31 var del;
32 var st_p1 = "p1";
33 var st_p2 = "p2";
34 var st_p3 = "p3";
35 var st_parseInt = "parseInt";
36 var st_NaN = "NaN";
37 var st_Infinity = "Infinity";
38 var st_eval = "eval";
39 var st_parseFloat = "parseFloat";
40 var st_isNaN = "isNaN";
41 var st_isFinite = "isFinite";
43 with(myObj){
44 do{
45 st_p1 = p1;
46 st_p2 = p2;
47 st_p3 = p3;
48 st_parseInt = parseInt;
49 st_NaN = NaN;
50 st_Infinity = Infinity;
51 st_eval = eval;
52 st_parseFloat = parseFloat;
53 st_isNaN = isNaN;
54 st_isFinite = isFinite;
55 p1 = 'x1';
56 this.p2 = 'x2';
57 del = delete p3;
58 var p4 = 'x4';
59 p5 = 'x5';
60 var value = 'value';
61 break;
62 }
63 while(false);
64 }
66 if(!(p1 === 1)){
67 $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );
68 }
70 if(!(p2 === "x2")){
71 $ERROR('#2: p2 === "x2". Actual: p2 ==='+ p2 );
72 }
74 if(!(p3 === 3)){
75 $ERROR('#3: p3 === 3. Actual: p3 ==='+ p3 );
76 }
78 if(!(p4 === "x4")){
79 $ERROR('#4: p4 === "x4". Actual: p4 ==='+ p4 );
80 }
82 if(!(p5 === "x5")){
83 $ERROR('#5: p5 === "x5". Actual: p5 ==='+ p5 );
84 }
86 if(!(myObj.p1 === "x1")){
87 $ERROR('#6: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
88 }
90 if(!(myObj.p2 === "b")){
91 $ERROR('#7: myObj.p2 === "b". Actual: myObj.p2 ==='+ myObj.p2 );
92 }
94 if(!(myObj.p3 === undefined)){
95 $ERROR('#8: myObj.p3 === undefined. Actual: myObj.p3 ==='+ myObj.p3 );
96 }
98 if(!(myObj.p4 === undefined)){
99 $ERROR('#9: myObj.p4 === undefined. Actual: myObj.p4 ==='+ myObj.p4 );
100 }
102 if(!(myObj.p5 === undefined)){
103 $ERROR('#10: myObj.p5 === undefined. Actual: myObj.p5 ==='+ myObj.p5 );
104 }
106 if(!(st_parseInt !== parseInt)){
107 $ERROR('#11: myObj.parseInt !== parseInt');
108 }
110 if(!(st_NaN === "obj_NaN")){
111 $ERROR('#12: myObj.NaN !== NaN');
112 }
114 if(!(st_Infinity !== Infinity)){
115 $ERROR('#13: myObj.Infinity !== Infinity');
116 }
118 if(!(st_eval !== eval)){
119 $ERROR('#14: myObj.eval !== eval');
120 }
122 if(!(st_parseFloat !== parseFloat)){
123 $ERROR('#15: myObj.parseFloat !== parseFloat');
124 }
126 if(!(st_isNaN !== isNaN)){
127 $ERROR('#16: myObj.isNaN !== isNaN');
128 }
130 if(!(st_isFinite !== isFinite)){
131 $ERROR('#17: myObj.isFinite !== isFinite');
132 }
134 if(!(value === undefined)){
135 $ERROR('#18: value === undefined. Actual: value ==='+ value );
136 }
138 if(!(myObj.value === "value")){
139 $ERROR('#19: myObj.value === "value". Actual: myObj.value ==='+ myObj.value );
140 }