From e510204a381a7253d2cf69deeed01b043a4b80ad Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 20 Nov 2012 13:44:27 +0000 Subject: add unshared option --- test/data/bindings/window.bnd | 51 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'test/data') 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); -- cgit v1.2.3