1
// Copyright 2009 the Sputnik authors. All rights reserved.
2
// This code is governed by the BSD license found in the LICENSE file.
5
* No matter how control leaves the embedded 'Statement',
6
* the scope chain is always restored to its former state
8
* @path ch12/12.10/S12.10_A3.5_T2.js
9
* @description Using "with" statement within "for-in" statement, leading to completion by exception
15
var result = "result";
20
valueOf : function(){return 'obj_valueOf';}
24
for(var prop in myObj){
34
//////////////////////////////////////////////////////////////////////////////
37
$ERROR('#1: result === 1. Actual: result ==='+ result );
40
//////////////////////////////////////////////////////////////////////////////
42
//////////////////////////////////////////////////////////////////////////////
45
$ERROR('#2: p1 === 1. Actual: p1 ==='+ p1 );
48
//////////////////////////////////////////////////////////////////////////////
50
//////////////////////////////////////////////////////////////////////////////
52
if(myObj.p1 !== "x1"){
53
$ERROR('#3: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
56
//////////////////////////////////////////////////////////////////////////////