diff options
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/dukky.c | 4 | ||||
-rw-r--r-- | javascript/duktape/window.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/javascript/dukky.c b/javascript/dukky.c index 6536fa784..e5836be6e 100644 --- a/javascript/dukky.c +++ b/javascript/dukky.c @@ -333,7 +333,6 @@ jscontext *js_newcontext(int timeout, jscallback *cb, void *cbctx) duk_put_global_string(ctx, PROTO_MAGIC); /* Create prototypes here? */ DUKKY_NEW_PROTOTYPE(event_target, "EventTarget"); - DUKKY_NEW_PROTOTYPE(window, "Window"); DUKKY_NEW_PROTOTYPE(node, "Node"); DUKKY_NEW_PROTOTYPE(character_data, "CharacterData"); DUKKY_NEW_PROTOTYPE(text, "Text"); @@ -344,6 +343,9 @@ jscontext *js_newcontext(int timeout, jscallback *cb, void *cbctx) DUKKY_NEW_PROTOTYPE(html_unknown_element, "HTMLUnknownElement"); DUKKY_NEW_PROTOTYPE(html_collection, "HTMLCollection"); DUKKY_NEW_PROTOTYPE(node_list, "NodeList"); + + /* Finally window's prototype */ + DUKKY_NEW_PROTOTYPE(window, "Window"); return ret; } diff --git a/javascript/duktape/window.c b/javascript/duktape/window.c index e52fcb00d..3bad2ab9a 100644 --- a/javascript/duktape/window.c +++ b/javascript/duktape/window.c @@ -77,6 +77,9 @@ DUKKY_FUNC(window, __proto) STEAL_THING(undefined); /* Populate window's prototypical functionality */ DUKKY_POPULATE_FULL_PROPERTY(window, document); + /* Exposed prototypes */ + DUKKY_GET_PROTOTYPE(node); + duk_put_prop_string(ctx, 0, "Node"); /* Set this prototype's prototype (left-parent)*/ DUKKY_GET_PROTOTYPE(event_target); duk_set_prototype(ctx, 0); |