1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/gdb/tests/test-JSObject.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +#include "gdb-tests.h" 1.5 +#include "jsapi.h" 1.6 + 1.7 +FRAGMENT(JSObject, simple) { 1.8 + JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx)); 1.9 + JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr())); 1.10 + JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx)); 1.11 + JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, 1.12 + global, "dys")); 1.13 + JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0)); 1.14 + JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0, 1.15 + global, "formFollows")); 1.16 + 1.17 + JSObject &plainRef = *plain; 1.18 + JSFunction &funcRef = *funcPtr; 1.19 + JSObject *plainRaw = plain; 1.20 + JSObject *funcRaw = func; 1.21 + 1.22 + breakpoint(); 1.23 + 1.24 + (void) glob; 1.25 + (void) plain; 1.26 + (void) func; 1.27 + (void) anon; 1.28 + (void) funcPtr; 1.29 + (void) &plainRef; 1.30 + (void) &funcRef; 1.31 + (void) plainRaw; 1.32 + (void) funcRaw; 1.33 +} 1.34 + 1.35 +FRAGMENT(JSObject, null) { 1.36 + JS::Rooted<JSObject *> null(cx, nullptr); 1.37 + JSObject *nullRaw = null; 1.38 + 1.39 + breakpoint(); 1.40 + 1.41 + (void) null; 1.42 + (void) nullRaw; 1.43 +}