aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-27 22:58:36 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-27 22:59:13 +0200
commit9265c4a9910a969843c77cdc58177162478ef146 (patch)
tree9365b9216ed18b5c9b140d789c3fcc92ee9e5072 /src/js
parent756ac1277b8e19769827dd08a764105e4c4720a6 (diff)
downloadchawan-9265c4a9910a969843c77cdc58177162478ef146.tar.gz
Remove unused function stub & comment
Diffstat (limited to 'src/js')
-rw-r--r--src/js/javascript.nim10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index 9c7819f0..352a000e 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -287,21 +287,12 @@ proc writeException*(ctx: JSContext, s: Stream) =
JS_FreeValue(ctx, stack)
JS_FreeValue(ctx, ex)
-# Detect cases where both a js object's and the corresponding nim
-# object's refcount is one.
-# TODO TODO TODO this still leaks memory in case the ref count of either object
-# cannot reach 1 because of cycles. Not sure how to fix this, maybe a hack
-# with gc_mark could work?
-proc collectInteropCycles*(rt: JSRuntime) =
- return
-
proc runJSJobs*(rt: JSRuntime, err: Stream) =
while JS_IsJobPending(rt):
var ctx: JSContext
let r = JS_ExecutePendingJob(rt, addr ctx)
if r == -1:
ctx.writeException(err)
- rt.collectInteropCycles()
func isInstanceOf*(ctx: JSContext, obj: JSValue, class: string): bool =
let clazz = ctx.getClass(class)
@@ -351,7 +342,6 @@ func newJSClass*(ctx: JSContext, cdef: JSClassDefConst, tname: string,
ctxOpaque.typemap[nimt] = result
ctxOpaque.creg[tname] = result
if finalizer != nil:
- #TODO this is wrong, classids are allocated per ctx, not rt
rtOpaque.fins[result] = finalizer
var proto: JSValue
if parent != 0: