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 | // The Computer Language Shootout |
michael@0 | 2 | // http://shootout.alioth.debian.org/ |
michael@0 | 3 | // contributed by Isaac Gouy |
michael@0 | 4 | |
michael@0 | 5 | function ack(m,n){ |
michael@0 | 6 | if (m==0) { return n+1; } |
michael@0 | 7 | if (n==0) { return ack(m-1,1); } |
michael@0 | 8 | return ack(m-1, ack(m,n-1) ); |
michael@0 | 9 | } |
michael@0 | 10 | |
michael@0 | 11 | function fib(n) { |
michael@0 | 12 | if (n < 2){ return 1; } |
michael@0 | 13 | return fib(n-2) + fib(n-1); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | function tak(x,y,z) { |
michael@0 | 17 | if (y >= x) return z; |
michael@0 | 18 | return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y)); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | /* BEGIN LOOP */ |
michael@0 | 22 | for ( var i = 3; i <= 5; i++ ) { |
michael@0 | 23 | ack(3,i); |
michael@0 | 24 | fib(17.0+i); |
michael@0 | 25 | tak(3*i+3,2*i+2,i+1); |
michael@0 | 26 | } |
michael@0 | 27 | /* END LOOP */ |