summaryrefslogtreecommitdiff
path: root/javascript/duktape/Document.bnd
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-09-10 08:51:56 +0100
committerVincent Sanders <vince@kyllikki.org>2015-09-10 08:51:56 +0100
commit63dba3a0618a2116ec395937b04f65740fe529f3 (patch)
tree6005e2dc268b1a1a09cc8d77621fe33a0ab834d7 /javascript/duktape/Document.bnd
parent73c6476112181bd5e151be719dde7d5cd48e14c3 (diff)
downloadnetsurf-63dba3a0618a2116ec395937b04f65740fe529f3.tar.gz
netsurf-63dba3a0618a2116ec395937b04f65740fe529f3.tar.bz2
expose the location object through document as well as window
Diffstat (limited to 'javascript/duktape/Document.bnd')
-rw-r--r--javascript/duktape/Document.bnd13
1 files changed, 13 insertions, 0 deletions
diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd
index 6d11ea9c8..0b478d5f5 100644
--- a/javascript/duktape/Document.bnd
+++ b/javascript/duktape/Document.bnd
@@ -154,6 +154,19 @@ getter Document::body()
return 0; /* coerced to undefined */
%}
+getter Document::location()
+%{
+ /* retrieve the location object from the root object (window) */
+ duk_push_global_object(ctx);
+ duk_get_prop_string(ctx, -1, "location");
+ if (duk_is_undefined(ctx, -1)) {
+ duk_pop(ctx);
+ return 0;
+ }
+ return 1;
+%}
+
+
method Document::getElementById()
%{
dom_string *elementId_dom;