diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-25 14:16:01 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-25 14:16:01 +0200 |
commit | 80ff0251133d20a11d2ab428ac6f27aa14c45782 (patch) | |
tree | 535c9e84c497ae7ed9b0e5642807744d0f6bd758 /src/html/env.nim | |
parent | 10bdd58bbe9f3736bbb3f73d2c500740724b696f (diff) | |
download | chawan-80ff0251133d20a11d2ab428ac6f27aa14c45782.tar.gz |
window: inherit from EventTarget
Diffstat (limited to 'src/html/env.nim')
-rw-r--r-- | src/html/env.nim | 5 |
1 files changed, 3 insertions, 2 deletions
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() |