js/src/jit-test/tests/basic/testBug673066.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.

     1 function f(code) {
     2     a = code.replace(/s/, "");
     3     wtt = a
     4     code = code.replace(/\/\*DUPTRY\d+\*\//, function(k) {
     5         n = parseInt(k.substr(8), 0);
     6         return g("try{}catch(e){}", n)
     7     });
     8     f = eval("(function(){" + code + "})")
     9     if (typeof disassemble == 'function') {
    10         disassemble("-r", f)
    11     }
    12 }
    13 function g(s, n) {
    14     if (n == 0) {
    15         return s
    16     }
    17     s2 = s + s
    18     r = n % 2
    19     d = (n - r) / 2
    20     m = g(s2, d)
    21     return r ? m + s : m
    22 }
    23 f("switch(''){default:break;/*DUPTRY525*/}")

mercurial