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 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | //----------------------------------------------------------------------------- |
michael@0 | 8 | var BUGNUMBER = 667131; |
michael@0 | 9 | var summary = 'yield ignored if maybeNoteLegacyGenerator called too late'; |
michael@0 | 10 | var actual = ''; |
michael@0 | 11 | var expect = ''; |
michael@0 | 12 | |
michael@0 | 13 | function testGenerator(f, desc) { |
michael@0 | 14 | reportCompare(f.isGenerator(), true, desc + ": is generator"); |
michael@0 | 15 | reportCompare(typeof f(), "object", desc + ": calling doesn't crash"); |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | function reported1() { |
michael@0 | 19 | (function(){})([yield[]], ("")) |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | function reported2() { |
michael@0 | 23 | (function(){})(let(w = "") yield, (e)) |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function simplified1() { |
michael@0 | 27 | print([yield], (0)) |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | function simplified2() { |
michael@0 | 31 | print(let(w) yield, (0)) |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function f1(a) { [x for (x in yield) for (y in (a))] } |
michael@0 | 35 | function f2(a) { [x for (x in yield) if (y in (a))] } |
michael@0 | 36 | function f3(a) { ([x for (x in yield) for (y in (a))]) } |
michael@0 | 37 | function f4(a) { ([x for (x in yield) if (y in (a))]) } |
michael@0 | 38 | |
michael@0 | 39 | function f7() { print({a:yield},(0)) } |
michael@0 | 40 | |
michael@0 | 41 | function f8() { ([yield], (0)) } |
michael@0 | 42 | function f9() { (let(w)yield, (0)) } |
michael@0 | 43 | |
michael@0 | 44 | testGenerator(reported1, "reported function with array literal"); |
michael@0 | 45 | testGenerator(reported2, "reported function with let-expression"); |
michael@0 | 46 | testGenerator(simplified1, "reported function with array literal, simplified"); |
michael@0 | 47 | testGenerator(simplified2, "reported function with let-expression, simplified"); |
michael@0 | 48 | testGenerator(f1, "top-level array comprehension with paren expr in for-block"); |
michael@0 | 49 | testGenerator(f2, "top-level array comprehension with paren expr in if-block"); |
michael@0 | 50 | testGenerator(f3, "parenthesized array comprehension with paren expr in for-block"); |
michael@0 | 51 | testGenerator(f4, "parenthesized array comprehension with paren expr in if-block"); |
michael@0 | 52 | testGenerator(f7, "object literal"); |
michael@0 | 53 | testGenerator(f8, "array literal in paren exp"); |
michael@0 | 54 | testGenerator(f9, "let-expression in paren exp"); |