summaryrefslogtreecommitdiff
path: root/javascript/duktape/Window.bnd
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-08-09 18:54:37 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-08-09 18:54:37 +0100
commit0df3439eb26914466b91ce529e7f3366094030d6 (patch)
tree9a8a8011efff300ad46f994718304b646bac62e9 /javascript/duktape/Window.bnd
parent3d7de6cf8d67bd7761a907cb171d8a4af8088a08 (diff)
downloadnetsurf-0df3439eb26914466b91ce529e7f3366094030d6.tar.gz
netsurf-0df3439eb26914466b91ce529e7f3366094030d6.tar.bz2
Fix constructor injection to use new constructor type, add test
Diffstat (limited to 'javascript/duktape/Window.bnd')
-rw-r--r--javascript/duktape/Window.bnd9
1 files changed, 7 insertions, 2 deletions
diff --git a/javascript/duktape/Window.bnd b/javascript/duktape/Window.bnd
index 95b55b2e2..fee5d2105 100644
--- a/javascript/duktape/Window.bnd
+++ b/javascript/duktape/Window.bnd
@@ -31,9 +31,14 @@ init Window("struct browser_window *" win, "struct html_content *" htmlc)
prototype Window()
%{
+#define EXPOSE(v) \
+ duk_get_global_string(ctx, #v); \
+ duk_put_prop_string(ctx, 0, #v)
/* steal undefined */
- duk_get_global_string(ctx, "undefined");
- duk_put_prop_string(ctx, 0, "undefined");
+ EXPOSE(undefined);
+ EXPOSE(eval);
+ EXPOSE(Object);
+#undef EXPOSE
%}
getter Window::document()