From 644f8256db9c7216cfc8a67ba6cb380a96ba28c5 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 24 Jun 2023 16:41:13 +0200 Subject: Working Nim-QuickJS GC integration I believe this works correctly. Hopefully I'm not wrong. --- src/display/client.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/display/client.nim') diff --git a/src/display/client.nim b/src/display/client.nim index ff8aacf3..81d400b1 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -59,6 +59,7 @@ type pager {.jsget.}: Pager line {.jsget.}: LineEdit config {.jsget.}: Config + store {.jsget, jsset.}: URL jsrt: JSRuntime jsctx: JSContext fdmap: Table[int, Container] @@ -549,7 +550,7 @@ proc newClient*(config: Config, dispatcher: Dispatcher): Client = result.pager = newPager(config, result.attrs, dispatcher, ctx) var global = JS_GetGlobalObject(ctx) ctx.registerType(Client, asglobal = true) - setOpaque(ctx, global, result) + setGlobal(ctx, global, result) ctx.setProperty(global, "client", global) JS_FreeValue(ctx, global) -- cgit 1.4.1-2-gfad0