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 * No matter how control leaves the embedded 'Statement',
6 * the scope chain is always restored to its former state
7 *
8 * @path ch12/12.10/S12.10_A3.11_T3.js
9 * @description Calling a function within "with" statement declared without the statement, leading to normal completion by "return"
10 * @noStrict
11 */
13 this.p1 = 1;
14 var result = "result";
15 var value = "value";
16 var myObj = {p1: 'a',
17 value: 'myObj_value',
18 valueOf : function(){return 'obj_valueOf';}
19 }
21 var f = function(){
22 return value;
23 p1 = 'x1';
24 }
26 with(myObj){
27 result = f();
28 }
30 if(!(p1 === 1)){
31 $ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );
32 }
34 if(!(myObj.p1 === "a")){
35 $ERROR('#2: myObj.p1 === "a". Actual: myObj.p1 ==='+ myObj.p1 );
36 }
38 if(!(result === "value")){
39 $ERROR('#3: result === "value". Actual: result ==='+ result );
40 }