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 | // |reftest| skip-if(Android) |
michael@0 | 2 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 3 | |
michael@0 | 4 | /* |
michael@0 | 5 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 6 | * http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | /* |
michael@0 | 10 | * In strict mode code, 'let' and 'const' declarations may not bind |
michael@0 | 11 | * 'eval' or 'arguments'. |
michael@0 | 12 | */ |
michael@0 | 13 | assertEq(testLenientAndStrict('let eval;', |
michael@0 | 14 | parsesSuccessfully, |
michael@0 | 15 | parseRaisesException(SyntaxError)), |
michael@0 | 16 | true); |
michael@0 | 17 | assertEq(testLenientAndStrict('let x,eval;', |
michael@0 | 18 | parsesSuccessfully, |
michael@0 | 19 | parseRaisesException(SyntaxError)), |
michael@0 | 20 | true); |
michael@0 | 21 | assertEq(testLenientAndStrict('let arguments;', |
michael@0 | 22 | parsesSuccessfully, |
michael@0 | 23 | parseRaisesException(SyntaxError)), |
michael@0 | 24 | true); |
michael@0 | 25 | assertEq(testLenientAndStrict('let x,arguments;', |
michael@0 | 26 | parsesSuccessfully, |
michael@0 | 27 | parseRaisesException(SyntaxError)), |
michael@0 | 28 | true); |
michael@0 | 29 | assertEq(testLenientAndStrict('const eval;', |
michael@0 | 30 | parsesSuccessfully, |
michael@0 | 31 | parseRaisesException(SyntaxError)), |
michael@0 | 32 | true); |
michael@0 | 33 | assertEq(testLenientAndStrict('const x,eval;', |
michael@0 | 34 | parsesSuccessfully, |
michael@0 | 35 | parseRaisesException(SyntaxError)), |
michael@0 | 36 | true); |
michael@0 | 37 | assertEq(testLenientAndStrict('const arguments;', |
michael@0 | 38 | parsesSuccessfully, |
michael@0 | 39 | parseRaisesException(SyntaxError)), |
michael@0 | 40 | true); |
michael@0 | 41 | assertEq(testLenientAndStrict('const x,arguments;', |
michael@0 | 42 | parsesSuccessfully, |
michael@0 | 43 | parseRaisesException(SyntaxError)), |
michael@0 | 44 | true); |
michael@0 | 45 | |
michael@0 | 46 | /* |
michael@0 | 47 | * In strict mode code, 'let' declarations appearing in 'for' |
michael@0 | 48 | * or 'for in' statements may not bind 'eval' or 'arguments'. |
michael@0 | 49 | */ |
michael@0 | 50 | assertEq(testLenientAndStrict('for (let eval in [])break;', |
michael@0 | 51 | parsesSuccessfully, |
michael@0 | 52 | parseRaisesException(SyntaxError)), |
michael@0 | 53 | true); |
michael@0 | 54 | assertEq(testLenientAndStrict('for (let [eval] in [])break;', |
michael@0 | 55 | parsesSuccessfully, |
michael@0 | 56 | parseRaisesException(SyntaxError)), |
michael@0 | 57 | true); |
michael@0 | 58 | assertEq(testLenientAndStrict('for (let {x:eval} in [])break;', |
michael@0 | 59 | parsesSuccessfully, |
michael@0 | 60 | parseRaisesException(SyntaxError)), |
michael@0 | 61 | true); |
michael@0 | 62 | assertEq(testLenientAndStrict('for (let arguments in [])break;', |
michael@0 | 63 | parsesSuccessfully, |
michael@0 | 64 | parseRaisesException(SyntaxError)), |
michael@0 | 65 | true); |
michael@0 | 66 | assertEq(testLenientAndStrict('for (let [arguments] in [])break;', |
michael@0 | 67 | parsesSuccessfully, |
michael@0 | 68 | parseRaisesException(SyntaxError)), |
michael@0 | 69 | true); |
michael@0 | 70 | assertEq(testLenientAndStrict('for (let {x:arguments} in [])break;', |
michael@0 | 71 | parsesSuccessfully, |
michael@0 | 72 | parseRaisesException(SyntaxError)), |
michael@0 | 73 | true); |
michael@0 | 74 | |
michael@0 | 75 | reportCompare(true, true); |