js/src/tests/test262/ch08/8.7/S8.7_A1.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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  * Multiple Variables should Referring to a Single Object
     6  *
     7  * @path ch08/8.7/S8.7_A1.js
     8  * @description Create object and refers to the other object, modify a property in the original object.
     9  *  We now see that that change is represented in both variables
    10  */
    12 //////////////////////////////////////////////////////////////////////////////
    13 //CHECK#
    14 // Set obj to an empty object
    15 //
    16 var obj = new Object();
    17 // objRef now refers to the other object
    18 //
    19 var objRef = obj;
    20 // Modify a property in the original object
    21 objRef.oneProperty = -1;
    22 obj.oneProperty = true;
    23 // We now see that that change is represented in both variables
    24 // (Since they both refer to the same object)
    25 if(objRef.oneProperty !== true){
    26   $ERROR('#1: var obj = new Object(); var objRef = obj; objRef.oneProperty = -1; obj.oneProperty = true; objRef.oneProperty === true. Actual: ' + (objRef.oneProperty));
    27 };
    28 //
    29 //////////////////////////////////////////////////////////////////////////////

mercurial