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.

michael@0 1 #include "gdb-tests.h"
michael@0 2 #include "jsapi.h"
michael@0 3
michael@0 4 FRAGMENT(JSObject, simple) {
michael@0 5 JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx));
michael@0 6 JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
michael@0 7 JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx));
michael@0 8 JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
michael@0 9 global, "dys"));
michael@0 10 JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0));
michael@0 11 JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0,
michael@0 12 global, "formFollows"));
michael@0 13
michael@0 14 JSObject &plainRef = *plain;
michael@0 15 JSFunction &funcRef = *funcPtr;
michael@0 16 JSObject *plainRaw = plain;
michael@0 17 JSObject *funcRaw = func;
michael@0 18
michael@0 19 breakpoint();
michael@0 20
michael@0 21 (void) glob;
michael@0 22 (void) plain;
michael@0 23 (void) func;
michael@0 24 (void) anon;
michael@0 25 (void) funcPtr;
michael@0 26 (void) &plainRef;
michael@0 27 (void) &funcRef;
michael@0 28 (void) plainRaw;
michael@0 29 (void) funcRaw;
michael@0 30 }
michael@0 31
michael@0 32 FRAGMENT(JSObject, null) {
michael@0 33 JS::Rooted<JSObject *> null(cx, nullptr);
michael@0 34 JSObject *nullRaw = null;
michael@0 35
michael@0 36 breakpoint();
michael@0 37
michael@0 38 (void) null;
michael@0 39 (void) nullRaw;
michael@0 40 }

mercurial