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.
1 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 * Contributor:
5 * Jeff Walden <jwalden+code@mit.edu>
6 */
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 721322;
10 var summary =
11 'f.arguments must trigger an arguments object in non-strict mode functions';
13 print(BUGNUMBER + ": " + summary);
15 /**************
16 * BEGIN TEST *
17 **************/
19 var obj =
20 {
21 test: function()
22 {
23 var args = obj.test.arguments;
24 assertEq(args !== null, true);
25 assertEq(args[0], 5);
26 assertEq(args[1], undefined);
27 assertEq(args.length, 2);
28 }
29 };
30 obj.test(5, undefined);
32 var sobj =
33 {
34 test: function()
35 {
36 "use strict";
38 try
39 {
40 var args = sobj.test.arguments;
41 throw new Error("access to arguments property of strict mode " +
42 "function didn't throw");
43 }
44 catch (e)
45 {
46 assertEq(e instanceof TypeError, true,
47 "should have thrown TypeError, instead got: " + e);
48 }
49 }
50 };
51 sobj.test(5, undefined);
53 /******************************************************************************/
55 if (typeof reportCompare === "function")
56 reportCompare(true, true);
58 print("Tests complete");