js/src/gdb/tests/test-jsval.cpp

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 #include "gdb-tests.h"
     2 #include "jsapi.h"
     4 FRAGMENT(jsval, simple) {
     5   JS::Rooted<jsval> fortytwo(cx, INT_TO_JSVAL(42));
     6   JS::Rooted<jsval> negone(cx, INT_TO_JSVAL(-1));
     7   JS::Rooted<jsval> undefined(cx, JSVAL_VOID);
     8   JS::Rooted<jsval> null(cx, JSVAL_NULL);
     9   JS::Rooted<jsval> js_true(cx, JSVAL_TRUE);
    10   JS::Rooted<jsval> js_false(cx, JSVAL_FALSE);
    11   JS::Rooted<jsval> elements_hole(cx, js::MagicValue(JS_ELEMENTS_HOLE));
    13   JS::Rooted<jsval> empty_string(cx);
    14   empty_string.setString(JS_NewStringCopyZ(cx, ""));
    15   JS::Rooted<jsval> friendly_string(cx);
    16   friendly_string.setString(JS_NewStringCopyZ(cx, "Hello!"));
    18   JS::Rooted<jsval> global(cx);
    19   global.setObject(*JS::CurrentGlobalOrNull(cx));
    21   // Some interesting value that floating-point won't munge.
    22   JS::Rooted<jsval> onehundredthirtysevenonehundredtwentyeighths(cx, DOUBLE_TO_JSVAL(137.0 / 128.0));
    24   breakpoint();
    26   (void) fortytwo;
    27   (void) negone;
    28   (void) undefined;
    29   (void) js_true;
    30   (void) js_false;
    31   (void) null;
    32   (void) elements_hole;
    33   (void) empty_string;
    34   (void) friendly_string;
    35   (void) global;
    36 }

mercurial