js/src/jit-test/tests/jaeger/tableSwitchNeg.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.

     2 function f(a) {
     3     switch(a) {
     4         case -1: return 1;
     5         case -2: return 2;
     6         case -5: return 5;
     7         default: return 10;
     8     }
     9 }
    11 assertEq(f(-1), 1);
    12 assertEq(f(-2), 2);
    13 assertEq(f(-5), 5);
    15 assertEq(f(-3), 10);
    16 assertEq(f(-6), 10);
    17 assertEq(f(0), 10);
    18 assertEq(f(1), 10);
    20 assertEq(f(-2147483647), 10);
    21 assertEq(f(-2147483648), 10);
    22 assertEq(f(-2147483649), 10);
    24 assertEq(f(2147483647), 10);
    25 assertEq(f(2147483648), 10);
    26 assertEq(f(2147483649), 10);

mercurial