js/src/tests/test262/ch12/12.10/S12.10_A3.5_T4.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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.5_T4.js
     9  * @description Using "with" statement within "for-in" statement, leading to completion by break
    10  * @noStrict
    11  */
    13 this.p1 = 1;
    15 var result = "result";
    17 var myObj = {
    18     p1: 'a', 
    19     value: 'myObj_value',
    20     valueOf : function(){return 'obj_valueOf';}
    21 }
    23 for(var prop in myObj){
    24     with(myObj){
    25         p1 = 'x1';
    26         break;
    27     }
    28 }
    30 //////////////////////////////////////////////////////////////////////////////
    31 //CHECK#1
    32 if(p1 !== 1){
    33   $ERROR('#1: p1 === 1. Actual:  p1 ==='+ p1  );
    34 }
    35 //
    36 //////////////////////////////////////////////////////////////////////////////
    38 //////////////////////////////////////////////////////////////////////////////
    39 //CHECK#2
    40 if(myObj.p1 !== "x1"){
    41   $ERROR('#2: myObj.p1 === "x1". Actual:  myObj.p1 ==='+ myObj.p1  );
    42 }
    43 //
    44 //////////////////////////////////////////////////////////////////////////////

mercurial