js/src/gdb/tests/test-JSObject.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(JSObject, simple) {
     5   JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx));
     6   JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
     7   JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx));
     8   JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
     9                                                               global, "dys"));
    10   JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0));
    11   JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0,
    12                                                       global, "formFollows"));
    14   JSObject &plainRef = *plain;
    15   JSFunction &funcRef = *funcPtr;
    16   JSObject *plainRaw = plain;
    17   JSObject *funcRaw = func;
    19   breakpoint();
    21   (void) glob;
    22   (void) plain;
    23   (void) func;
    24   (void) anon;
    25   (void) funcPtr;
    26   (void) &plainRef;
    27   (void) &funcRef;
    28   (void) plainRaw;
    29   (void) funcRaw;
    30 }
    32 FRAGMENT(JSObject, null) {
    33   JS::Rooted<JSObject *> null(cx, nullptr);
    34   JSObject *nullRaw = null;
    36   breakpoint();
    38   (void) null;
    39   (void) nullRaw;
    40 }

mercurial