Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
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 * FunctionExpression containing "with" statement is admitted
6 *
7 * @path ch13/13.2/S13.2.2_A17_T2.js
8 * @description Throwing an exception within "with" statement
9 */
11 this.p1="alert";
13 __obj={p1:1,getRight:function(){return "right";}};
15 getRight=function(){return "napravo";};
17 try {
18 (function(){
19 with(__obj){
20 p1="w1";
21 getRight=function(){return false;}
22 throw p1;
23 }
24 })();
25 } catch (e) {
26 resukt = p1;
27 }
30 //////////////////////////////////////////////////////////////////////////////
31 //CHECK#1
32 if (p1!=="alert") {
33 $ERROR('#1: p1 === "alert". Actual: p1==='+p1);
34 }
35 //
36 //////////////////////////////////////////////////////////////////////////////
38 //////////////////////////////////////////////////////////////////////////////
39 //CHECK#2
40 if (getRight()!=="napravo") {
41 $ERROR('#2: getRight() === "napravo". Actual: getRight() === '+getRight());
42 }
43 //
44 //////////////////////////////////////////////////////////////////////////////
46 //////////////////////////////////////////////////////////////////////////////
47 //CHECK#3
48 if (__obj.p1!=="w1") {
49 $ERROR('#3: __obj.p1 === "w1". Actual: __obj.p1 ==='+__obj.p1);
50 }
51 //
52 //////////////////////////////////////////////////////////////////////////////
54 //////////////////////////////////////////////////////////////////////////////
55 //CHECK#4
56 if (__obj.getRight()!==false) {
57 $ERROR('#4: __obj.getRight() === false. Actual: __obj.getRight() === '+__obj.getRight());
58 }
59 //
60 //////////////////////////////////////////////////////////////////////////////
62 //////////////////////////////////////////////////////////////////////////////
63 //CHECK#5
64 if (resukt !== "alert") {
65 $ERROR('#5: resukt === "alert". Actual: resukt ==='+resukt);
66 }
67 //
68 //////////////////////////////////////////////////////////////////////////////
70 var resukt;