From 63dba3a0618a2116ec395937b04f65740fe529f3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 10 Sep 2015 08:51:56 +0100 Subject: expose the location object through document as well as window --- javascript/duktape/Document.bnd | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- cgit v1.2.3