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 | function getter() { return 1; } |
michael@0 | 2 | function setter() { } |
michael@0 | 3 | function getDescriptor(name) { |
michael@0 | 4 | if (name != 'prop') |
michael@0 | 5 | throw "Unknown property: " + name; |
michael@0 | 6 | return { configurable: true, enumerable: true, get: getter, set: setter }; |
michael@0 | 7 | } |
michael@0 | 8 | function getNames() { return ['prop']; } |
michael@0 | 9 | var handler = { |
michael@0 | 10 | getOwnPropertyDescriptor: getDescriptor, |
michael@0 | 11 | getPropertyDescriptor: getDescriptor, |
michael@0 | 12 | getOwnPropertyNames: getNames, |
michael@0 | 13 | getPropertyNames: getNames, |
michael@0 | 14 | defineProperty: function() {}, |
michael@0 | 15 | delete: function() {} |
michael@0 | 16 | }; |
michael@0 | 17 | |
michael@0 | 18 | // Make sure that __lookup{Getter,Setter}__ works on proxies. |
michael@0 | 19 | var proxy = Proxy.create(handler); |
michael@0 | 20 | assertEq(Object.prototype.__lookupGetter__.call(proxy, 'prop'), getter); |
michael@0 | 21 | assertEq(Object.prototype.__lookupSetter__.call(proxy, 'prop'), setter); |