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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /*
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
6 */
8 /* Deleting an identifier is a syntax error in strict mode code only. */
9 assertEq(testLenientAndStrict('delete x;',
10 parsesSuccessfully,
11 parseRaisesException(SyntaxError)),
12 true);
14 /*
15 * A reference expression surrounded by parens is itself a reference
16 * expression.
17 */
18 assertEq(testLenientAndStrict('delete (x);',
19 parsesSuccessfully,
20 parseRaisesException(SyntaxError)),
21 true);
23 /* Deleting other sorts of expressions are not syntax errors in either mode. */
24 assertEq(testLenientAndStrict('delete x.y;',
25 parsesSuccessfully,
26 parsesSuccessfully),
27 true);
28 assertEq(testLenientAndStrict('delete Object();',
29 returns(true),
30 returns(true)),
31 true);
33 /* Functions should inherit the surrounding code's strictness. */
34 assertEq(testLenientAndStrict('function f() { delete x; }',
35 parsesSuccessfully,
36 parseRaisesException(SyntaxError)),
37 true);
39 /* Local directives override the surrounding code's strictness. */
40 assertEq(testLenientAndStrict('function f() { "use strict"; delete x; }',
41 parseRaisesException(SyntaxError),
42 parseRaisesException(SyntaxError)),
43 true);
45 reportCompare(true, true);