expose the location object through document as well as window

This commit is contained in:
Vincent Sanders 2015-09-10 08:51:56 +01:00
parent 73c6476112
commit 63dba3a061

View File

@ -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;