Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Multiple Variables should Referring to a Single Object |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch08/8.7/S8.7_A1.js |
michael@0 | 8 | * @description Create object and refers to the other object, modify a property in the original object. |
michael@0 | 9 | * We now see that that change is represented in both variables |
michael@0 | 10 | */ |
michael@0 | 11 | |
michael@0 | 12 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 13 | //CHECK# |
michael@0 | 14 | // Set obj to an empty object |
michael@0 | 15 | // |
michael@0 | 16 | var obj = new Object(); |
michael@0 | 17 | // objRef now refers to the other object |
michael@0 | 18 | // |
michael@0 | 19 | var objRef = obj; |
michael@0 | 20 | // Modify a property in the original object |
michael@0 | 21 | objRef.oneProperty = -1; |
michael@0 | 22 | obj.oneProperty = true; |
michael@0 | 23 | // We now see that that change is represented in both variables |
michael@0 | 24 | // (Since they both refer to the same object) |
michael@0 | 25 | if(objRef.oneProperty !== true){ |
michael@0 | 26 | $ERROR('#1: var obj = new Object(); var objRef = obj; objRef.oneProperty = -1; obj.oneProperty = true; objRef.oneProperty === true. Actual: ' + (objRef.oneProperty)); |
michael@0 | 27 | }; |
michael@0 | 28 | // |
michael@0 | 29 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 30 |