diff -r 000000000000 -r 6474c204b198 js/src/gdb/tests/test-jsid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/gdb/tests/test-jsid.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,37 @@ +#include "gdb-tests.h" +#include "jsapi.h" + +FRAGMENT(jsid, simple) { + JS::Rooted string(cx, JS_NewStringCopyZ(cx, "moon")); + JS::Rooted interned(cx, JS_InternJSString(cx, string)); + JS::Rooted string_id(cx, INTERNED_STRING_TO_JSID(cx, interned)); + jsid int_id = INT_TO_JSID(1729); + jsid void_id = JSID_VOID; + JS::Rooted object_id(cx, OBJECT_TO_JSID(JS::CurrentGlobalOrNull(cx))); + + breakpoint(); + + (void) string; + (void) interned; + (void) string_id; + (void) int_id; + (void) void_id; + (void) object_id; +} + +void +jsid_handles(JS::Handle jsid_handle, + JS::MutableHandle mutable_jsid_handle) +{ + // Prevent the linker from unifying this function with others that are + // equivalent in machine code but not type. + fprintf(stderr, "Called " __FILE__ ":jsid_handles\n"); + breakpoint(); +} + +FRAGMENT(jsid, handles) { + JS::Rooted string(cx, JS_NewStringCopyZ(cx, "shovel")); + JS::Rooted interned(cx, JS_InternJSString(cx, string)); + JS::Rooted string_id(cx, INTERNED_STRING_TO_JSID(cx, interned)); + jsid_handles(string_id, &string_id); +}