Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | #include "gdb-tests.h" |
michael@0 | 2 | #include "jsapi.h" |
michael@0 | 3 | |
michael@0 | 4 | FRAGMENT(jsid, simple) { |
michael@0 | 5 | JS::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "moon")); |
michael@0 | 6 | JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string)); |
michael@0 | 7 | JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned)); |
michael@0 | 8 | jsid int_id = INT_TO_JSID(1729); |
michael@0 | 9 | jsid void_id = JSID_VOID; |
michael@0 | 10 | JS::Rooted<jsid> object_id(cx, OBJECT_TO_JSID(JS::CurrentGlobalOrNull(cx))); |
michael@0 | 11 | |
michael@0 | 12 | breakpoint(); |
michael@0 | 13 | |
michael@0 | 14 | (void) string; |
michael@0 | 15 | (void) interned; |
michael@0 | 16 | (void) string_id; |
michael@0 | 17 | (void) int_id; |
michael@0 | 18 | (void) void_id; |
michael@0 | 19 | (void) object_id; |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | void |
michael@0 | 23 | jsid_handles(JS::Handle<jsid> jsid_handle, |
michael@0 | 24 | JS::MutableHandle<jsid> mutable_jsid_handle) |
michael@0 | 25 | { |
michael@0 | 26 | // Prevent the linker from unifying this function with others that are |
michael@0 | 27 | // equivalent in machine code but not type. |
michael@0 | 28 | fprintf(stderr, "Called " __FILE__ ":jsid_handles\n"); |
michael@0 | 29 | breakpoint(); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | FRAGMENT(jsid, handles) { |
michael@0 | 33 | JS::Rooted<JSString *> string(cx, JS_NewStringCopyZ(cx, "shovel")); |
michael@0 | 34 | JS::Rooted<JSString *> interned(cx, JS_InternJSString(cx, string)); |
michael@0 | 35 | JS::Rooted<jsid> string_id(cx, INTERNED_STRING_TO_JSID(cx, interned)); |
michael@0 | 36 | jsid_handles(string_id, &string_id); |
michael@0 | 37 | } |