|
1 #include "gdb-tests.h" |
|
2 #include "jsapi.h" |
|
3 |
|
4 FRAGMENT(JSObject, simple) { |
|
5 JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx)); |
|
6 JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr())); |
|
7 JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx)); |
|
8 JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, |
|
9 global, "dys")); |
|
10 JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0)); |
|
11 JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0, |
|
12 global, "formFollows")); |
|
13 |
|
14 JSObject &plainRef = *plain; |
|
15 JSFunction &funcRef = *funcPtr; |
|
16 JSObject *plainRaw = plain; |
|
17 JSObject *funcRaw = func; |
|
18 |
|
19 breakpoint(); |
|
20 |
|
21 (void) glob; |
|
22 (void) plain; |
|
23 (void) func; |
|
24 (void) anon; |
|
25 (void) funcPtr; |
|
26 (void) &plainRef; |
|
27 (void) &funcRef; |
|
28 (void) plainRaw; |
|
29 (void) funcRaw; |
|
30 } |
|
31 |
|
32 FRAGMENT(JSObject, null) { |
|
33 JS::Rooted<JSObject *> null(cx, nullptr); |
|
34 JSObject *nullRaw = null; |
|
35 |
|
36 breakpoint(); |
|
37 |
|
38 (void) null; |
|
39 (void) nullRaw; |
|
40 } |