js/src/jit-test/tests/jaeger/bug549393-1.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 // |jit-test| error: TypeError
michael@0 2 function start() {
michael@0 3 MAX_TOTAL_TIME = startTime = new Date
michael@0 4 do {
michael@0 5 if (rnd(0)) return (a[rnd()])()
michael@0 6 lastTime = new Date
michael@0 7 } while ( lastTime - startTime < MAX_TOTAL_TIME )
michael@0 8 }
michael@0 9 function MersenneTwister19937() {
michael@0 10 this.init_genrand = function() {
michael@0 11 for (mti = 1; mti < 4; mti++) {
michael@0 12 Array[mti] = 1
michael@0 13 }
michael@0 14 };
michael@0 15 this.genrand_int32_t = function() {
michael@0 16 if (mti > 4) {
michael@0 17 mti = 0
michael@0 18 }
michael@0 19 return Array[mti++];
michael@0 20 }
michael@0 21 } (function() {
michael@0 22 fuzzMT = new MersenneTwister19937;
michael@0 23 fuzzMT.init_genrand()
michael@0 24 rnd = function() {
michael@0 25 return Math.floor(fuzzMT.genrand_int32())
michael@0 26 }
michael@0 27 } ())
michael@0 28 function weighted(wa) {
michael@0 29 a = []
michael@0 30 for (i = 0; i < wa.length; ++i) {
michael@0 31 for (var j = 0; j < 8; ++j) {
michael@0 32 a.push(wa[i].fun)
michael@0 33 }
michael@0 34 }
michael@0 35 }
michael@0 36 statementMakers = weighted([{
michael@0 37 fun: function makeMixedTypeArray() { [[, , , , , , , , , , , , , , , , , , ,
michael@0 38 , , , , , ""][(a[rnd()])()]]}
michael@0 39 }])
michael@0 40 start()
michael@0 41
michael@0 42 /* Don't assert. */
michael@0 43

mercurial