diff options
author | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-11-20 13:44:27 +0000 |
---|---|---|
committer | Vincent Sanders <vincent.sanders@collabora.co.uk> | 2012-11-20 13:44:27 +0000 |
commit | e510204a381a7253d2cf69deeed01b043a4b80ad (patch) | |
tree | 7d956d8d7fe867511305a8c1d4d92c5862d20fb4 /test | |
parent | a044206384cb02aaaaab65f813878ddcd44b1dd1 (diff) | |
download | nsgenbind-e510204a381a7253d2cf69deeed01b043a4b80ad.tar.gz nsgenbind-e510204a381a7253d2cf69deeed01b043a4b80ad.tar.bz2 |
add unshared option
Diffstat (limited to 'test')
-rw-r--r-- | test/data/bindings/window.bnd | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/test/data/bindings/window.bnd b/test/data/bindings/window.bnd index 956932c..b843aaf 100644 --- a/test/data/bindings/window.bnd +++ b/test/data/bindings/window.bnd @@ -23,21 +23,36 @@ binding window { interface Window; /* Web IDL interface to generate */ - /* private are parameters to constructor stored in private - * context structure. - * - * internal are value stored in private context structure but not - * passed to constructor but are considered for property - * getters/setters. - */ private "struct browser_window *" bw; private "struct html_content *" htmlc; + internal "JSObject *" document; internal "JSObject *" navigator; internal "JSObject *" console; internal "JSObject *" location; + + unshared type EventHandler; } +api mark %{ + if (private != NULL) { + if (private->document != NULL) { + JSAPI_GCMARK(private->document); + } + if (private->navigator != NULL) { + JSAPI_GCMARK(private->navigator); + } + if (private->console != NULL) { + JSAPI_GCMARK(private->console); + } + if (private->location != NULL) { + JSAPI_GCMARK(private->location); + } + } +%} + +api global %{ +%} api init %{ JSObject *user_proto; @@ -101,6 +116,26 @@ api init %{ return NULL; } + user_proto = jsapi_InitClass_HTMLCollection(cx, prototype); + if (user_proto == NULL) { + return NULL; + } + + user_proto = jsapi_InitClass_NodeList(cx, prototype); + if (user_proto == NULL) { + return NULL; + } + + user_proto = jsapi_InitClass_Text(cx, prototype); + if (user_proto == NULL) { + return NULL; + } + + user_proto = jsapi_InitClass_Node(cx, prototype); + if (user_proto == NULL) { + return NULL; + } + %} api new %{ @@ -114,7 +149,7 @@ api new %{ private->document = jsapi_new_Document(cx, NULL, newobject, - htmlc->document, + (dom_document *)dom_node_ref(htmlc->document), htmlc); if (private->document == NULL) { free(private); |