diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-07 12:08:56 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-07 12:08:56 +0000 |
commit | 99f93da0f3a510df51c5a057e7597c570a636f9d (patch) | |
tree | e6b92aab766762382e9e6ac69f01f7b26e3fb0eb /javascript/jsapi/window.bnd | |
parent | 40076ea422458fde1799fd383b475586ee112c3f (diff) | |
download | netsurf-99f93da0f3a510df51c5a057e7597c570a636f9d.tar.gz netsurf-99f93da0f3a510df51c5a057e7597c570a636f9d.tar.bz2 |
correctly handle location
Diffstat (limited to 'javascript/jsapi/window.bnd')
-rw-r--r-- | javascript/jsapi/window.bnd | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd index d7f47ce44..6153e90aa 100644 --- a/javascript/jsapi/window.bnd +++ b/javascript/jsapi/window.bnd @@ -42,7 +42,6 @@ binding window { internal "JSObject *" document; internal "JSObject *" navigator; internal "JSObject *" console; - internal "JSObject *" location; property unshared type EventHandler; } @@ -58,9 +57,6 @@ api mark %{ if (private->console != NULL) { JSAPI_GCMARK(private->console); } - if (private->location != NULL) { - JSAPI_GCMARK(private->location); - } } %} @@ -180,13 +176,6 @@ api new %{ return NULL; } - private->location = jsapi_new_Location(cx, NULL, newobject, bw, - llcache_handle_get_url(private->htmlc->base.llcache)); - if (private->location == NULL) { - free(private); - return NULL; - } - private->console = jsapi_new_Console(cx, NULL, newobject); if (private->console == NULL) { free(private); @@ -210,14 +199,6 @@ operation prompt %{ warn_user(message, NULL); %} -getter window %{ - jsret = obj; -%} - -getter self %{ - jsret = obj; -%} - /* boolean dispatchEvent(Event event); */ operation dispatchEvent %{ /* this implementation is unique to the window object as it is @@ -254,6 +235,20 @@ operation dispatchEvent %{ } %} +getter location %{ + jsval loc; + JS_GetProperty(cx, private->document, "location", &loc); + jsret = JSVAL_TO_OBJECT(loc); +%} + +getter window %{ + jsret = obj; +%} + +getter self %{ + jsret = obj; +%} + getter EventHandler %{ /* this implementation is unique to the window object as it is * not a dom node. |