From 0df3439eb26914466b91ce529e7f3366094030d6 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 9 Aug 2015 18:54:37 +0100 Subject: Fix constructor injection to use new constructor type, add test --- javascript/duktape/Window.bnd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'javascript/duktape') 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() -- cgit v1.2.3