From 80ff0251133d20a11d2ab428ac6f27aa14c45782 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 25 Oct 2023 14:16:01 +0200 Subject: window: inherit from EventTarget --- src/html/env.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/html/env.nim') diff --git a/src/html/env.nim b/src/html/env.nim index 0543a60c..694b09cf 100644 --- a/src/html/env.nim +++ b/src/html/env.nim @@ -130,13 +130,14 @@ proc addScripting*(window: Window, selector: Selector[int]) = ) ) var global = JS_GetGlobalObject(ctx) - ctx.registerType(Window, asglobal = true) + ctx.addEventModule() + let eventTargetCID = ctx.getClass("EventTarget") + ctx.registerType(Window, asglobal = true, parent = eventTargetCID) ctx.setGlobal(global, window) JS_FreeValue(ctx, global) ctx.addDOMExceptionModule() ctx.addConsoleModule() ctx.addNavigatorModule() - ctx.addEventModule() ctx.addDOMModule() ctx.addURLModule() ctx.addHTMLModule() -- cgit 1.4.1-2-gfad0