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 | load(libdir + "asserts.js"); |
michael@0 | 2 | |
michael@0 | 3 | assertThrowsInstanceOf(function () { |
michael@0 | 4 | eval("function f(...rest=23) {}"); |
michael@0 | 5 | }, SyntaxError); |
michael@0 | 6 | assertThrowsInstanceOf(function () { |
michael@0 | 7 | eval("function f([a]=4) {}"); |
michael@0 | 8 | }, SyntaxError); |
michael@0 | 9 | assertThrowsInstanceOf(function () { |
michael@0 | 10 | eval("function f(a=4, [b]) {}"); |
michael@0 | 11 | }, SyntaxError); |
michael@0 | 12 | assertThrowsInstanceOf(function () { |
michael@0 | 13 | eval("function f(a=yield 24) {}"); |
michael@0 | 14 | }, SyntaxError); |
michael@0 | 15 | assertThrowsInstanceOf(function () { |
michael@0 | 16 | eval("function f(a={a : 19 + (yield 24).prop}) {}"); |
michael@0 | 17 | }, SyntaxError); |
michael@0 | 18 | assertThrowsInstanceOf(function () { |
michael@0 | 19 | eval("function f(a=1,a=1) {}"); |
michael@0 | 20 | }, SyntaxError); |
michael@0 | 21 | assertThrowsInstanceOf(function () { |
michael@0 | 22 | eval("function f(a,a=1) {}"); |
michael@0 | 23 | }, SyntaxError); |
michael@0 | 24 | assertThrowsInstanceOf(function () { |
michael@0 | 25 | eval("function f(a=1,a) {}"); |
michael@0 | 26 | }, SyntaxError); |
michael@0 | 27 | assertThrowsInstanceOf(function () { |
michael@0 | 28 | eval("function f(a,a,b=1) {}"); |
michael@0 | 29 | }, SyntaxError); |
michael@0 | 30 | assertThrowsInstanceOf(function () { |
michael@0 | 31 | eval("function f(a,b=1,a=1) {}"); |
michael@0 | 32 | }, SyntaxError); |
michael@0 | 33 | assertThrowsInstanceOf(function () { |
michael@0 | 34 | eval("function f(a=1,b=1,a=1) {}"); |
michael@0 | 35 | }, SyntaxError); |
michael@0 | 36 | function silly_but_okay(a=(function () { yield 97; })) {} |