diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/gdb/tests/test-JSObject.cpp | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/gdb/tests/test-JSObject.cpp')
-rw-r--r-- | js/src/gdb/tests/test-JSObject.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/src/gdb/tests/test-JSObject.cpp b/js/src/gdb/tests/test-JSObject.cpp new file mode 100644 index 000000000..2be10e89c --- /dev/null +++ b/js/src/gdb/tests/test-JSObject.cpp @@ -0,0 +1,43 @@ +#include "gdb-tests.h" +#include "jsapi.h" + +FRAGMENT(JSObject, simple) { + JS::Rooted<JSObject*> glob(cx, JS::CurrentGlobalOrNull(cx)); + JS::Rooted<JSObject*> plain(cx, JS_NewPlainObject(cx)); + JS::Rooted<JSObject*> global(cx, JS::CurrentGlobalOrNull(cx)); + JS::Rooted<JSObject*> func(cx, (JSObject*) JS_NewFunction(cx, (JSNative) 1, 0, 0, + "dys")); + JS::Rooted<JSObject*> anon(cx, (JSObject*) JS_NewFunction(cx, (JSNative) 1, 0, 0, nullptr)); + JS::Rooted<JSFunction*> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0, + "formFollows")); + + JSObject& plainRef = *plain; + JSFunction& funcRef = *funcPtr; + JSObject* plainRaw = plain; + JSObject* funcRaw = func; + + static const JSClass cls = { "\xc7X" }; + JS::RootedObject badClassName(cx, JS_NewObject(cx, &cls)); + + breakpoint(); + + (void) glob; + (void) plain; + (void) func; + (void) anon; + (void) funcPtr; + (void) &plainRef; + (void) &funcRef; + (void) plainRaw; + (void) funcRaw; +} + +FRAGMENT(JSObject, null) { + JS::Rooted<JSObject*> null(cx, nullptr); + JSObject* nullRaw = null; + + breakpoint(); + + (void) null; + (void) nullRaw; +} |