diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-09-10 08:51:56 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-09-10 08:51:56 +0100 |
commit | 63dba3a0618a2116ec395937b04f65740fe529f3 (patch) | |
tree | 6005e2dc268b1a1a09cc8d77621fe33a0ab834d7 | |
parent | 73c6476112181bd5e151be719dde7d5cd48e14c3 (diff) | |
download | netsurf-63dba3a0618a2116ec395937b04f65740fe529f3.tar.gz netsurf-63dba3a0618a2116ec395937b04f65740fe529f3.tar.bz2 |
expose the location object through document as well as window
-rw-r--r-- | javascript/duktape/Document.bnd | 13 |
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; |