summaryrefslogtreecommitdiff
path: root/javascript/jsapi/bindings/window.bnd
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/jsapi/bindings/window.bnd')
-rw-r--r--javascript/jsapi/bindings/window.bnd84
1 files changed, 48 insertions, 36 deletions
diff --git a/javascript/jsapi/bindings/window.bnd b/javascript/jsapi/bindings/window.bnd
index beb2b128e..956932c77 100644
--- a/javascript/jsapi/bindings/window.bnd
+++ b/javascript/jsapi/bindings/window.bnd
@@ -18,25 +18,26 @@ preamble %{
%}
-operation confirm %{
- warn_user(message, NULL);
-%}
-
-operation alert %{
- warn_user(message, NULL);
-%}
-
-operation prompt %{
- warn_user(message, NULL);
-%}
-
-getter window %{
- jsret = obj;
-%}
+binding window {
+ type js_libdom; /* the binding type */
+
+ 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;
+}
-getter self %{
- jsret = obj;
-%}
api init %{
JSObject *user_proto;
@@ -85,6 +86,11 @@ api init %{
return NULL;
}
+ user_proto = jsapi_InitClass_Location(cx, prototype);
+ if (user_proto == NULL) {
+ return NULL;
+ }
+
user_proto = jsapi_InitClass_Console(cx, prototype);
if (user_proto == NULL) {
return NULL;
@@ -121,7 +127,11 @@ api new %{
return NULL;
}
- /** @todo forms, history, location */
+ private->location = jsapi_new_Location(cx, NULL, newobject, bw);
+ if (private->location == NULL) {
+ free(private);
+ return NULL;
+ }
private->console = jsapi_new_Console(cx, NULL, newobject);
if (private->console == NULL) {
@@ -129,25 +139,27 @@ api new %{
return NULL;
}
+ /** @todo forms, history */
+
LOG(("Created new window object %p", newobject));
%}
+operation confirm %{
+ warn_user(message, NULL);
+%}
-binding window {
- type js_libdom; /* the binding type */
-
- 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;
+operation alert %{
+ warn_user(message, NULL);
+%}
-}
+operation prompt %{
+ warn_user(message, NULL);
+%}
+
+getter window %{
+ jsret = obj;
+%}
+
+getter self %{
+ jsret = obj;
+%}