diff -r 000000000000 -r 6474c204b198 js/src/gdb/tests/test-JSObject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/gdb/tests/test-JSObject.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,40 @@ +#include "gdb-tests.h" +#include "jsapi.h" + +FRAGMENT(JSObject, simple) { + JS::Rooted glob(cx, JS::CurrentGlobalOrNull(cx)); + JS::Rooted plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr())); + JS::Rooted global(cx, JS::CurrentGlobalOrNull(cx)); + JS::Rooted func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, + global, "dys")); + JS::Rooted anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0)); + JS::Rooted funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0, + global, "formFollows")); + + JSObject &plainRef = *plain; + JSFunction &funcRef = *funcPtr; + JSObject *plainRaw = plain; + JSObject *funcRaw = func; + + breakpoint(); + + (void) glob; + (void) plain; + (void) func; + (void) anon; + (void) funcPtr; + (void) &plainRef; + (void) &funcRef; + (void) plainRaw; + (void) funcRaw; +} + +FRAGMENT(JSObject, null) { + JS::Rooted null(cx, nullptr); + JSObject *nullRaw = null; + + breakpoint(); + + (void) null; + (void) nullRaw; +}