From 1cfe1655e1ef6f7ae69b9c87731d571e1ef3ca8c Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 13 Oct 2023 17:41:02 +0200 Subject: Refactor Console * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary) --- src/html/env.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/html/env.nim') diff --git a/src/html/env.nim b/src/html/env.nim index 49f6bba3..24e1482d 100644 --- a/src/html/env.nim +++ b/src/html/env.nim @@ -7,6 +7,7 @@ import html/dom import html/event import io/promise import js/base64 +import js/console import js/domexception import js/error import js/intl @@ -130,7 +131,7 @@ proc addScripting*(window: Window, selector: Selector[int]) = ctx.setGlobal(global, window) JS_FreeValue(ctx, global) ctx.addDOMExceptionModule() - ctx.addconsoleModule() + ctx.addConsoleModule() ctx.addNavigatorModule() ctx.addEventModule() ctx.addDOMModule() @@ -150,9 +151,10 @@ proc runJSJobs*(window: Window) = proc newWindow*(scripting: bool, selector: Selector[int], attrs: WindowAttributes, navigate: proc(url: URL) = nil, loader = none(FileLoader)): Window = + let err = newFileStream(stderr) let window = Window( attrs: attrs, - console: console(err: newFileStream(stderr)), + console: newConsole(err), navigator: Navigator(), loader: loader, settings: EnvironmentSettings( -- cgit 1.4.1-2-gfad0