Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | } |