js/src/tests/test262/ch13/13.2/S13.2.2_A17_T3.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

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_T3.js
     8  * @description In the check 4 we populate field getRight in __obj object since var getRight declaration adds variable to function scope
     9  * but getRight in statement resolves within with(__obj) scope and searchs getRight in __obj first
    10  */
    12 p1="alert";
    14 this.__obj={p1:1,getRight:function(){return "right";}};
    16 var getRight=function(){return "napravo";};
    18 resukt=(function(){
    19     with(__obj){
    20         p1="w1";
    21         var getRight=function(){return false;};
    22         return p1;
    23     }
    24 })();
    26 //////////////////////////////////////////////////////////////////////////////
    27 //CHECK#1
    28 if (p1!=="alert") {
    29 	$ERROR('#1: p1 === "alert". Actual: p1==='+p1);
    30 }
    31 //
    32 //////////////////////////////////////////////////////////////////////////////
    34 //////////////////////////////////////////////////////////////////////////////
    35 //CHECK#2
    36 if (getRight()!=="napravo") {
    37 	$ERROR('#2: getRight() === "napravo". Actual: getRight()==='+getRight());
    38 }
    39 //
    40 //////////////////////////////////////////////////////////////////////////////
    42 //////////////////////////////////////////////////////////////////////////////
    43 //CHECK#3
    44 if (__obj.p1!=="w1") {
    45 	$ERROR('#3: __obj.p1 === "w1". Actual: __obj.p1 ==='+__obj.p1);
    46 }
    47 //
    48 //////////////////////////////////////////////////////////////////////////////
    50 //////////////////////////////////////////////////////////////////////////////
    51 //CHECK#4
    52 if (__obj.getRight()!==false) {
    53 	$ERROR('#4: __obj.getRight() === false. Actual: __obj.getRight()==='+__obj.getRight());
    54 }
    55 //
    56 //////////////////////////////////////////////////////////////////////////////
    58 //////////////////////////////////////////////////////////////////////////////
    59 //CHECK#5
    60 if (resukt !== "w1") {
    61 	$ERROR('#5: resukt === "w1". Actual: resukt ==='+resukt);
    62 }
    63 //
    64 //////////////////////////////////////////////////////////////////////////////
    66 var resukt;

mercurial