about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-04 17:35:47 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-04 17:35:47 +0200
commitbe287807b339fd1d56be44bf474a291653feb084 (patch)
tree3632404e16be1301b540a7f28588b6c172d6aa48
parentd5bb0eac7d8fdfba4214c1c8daa9523aa11e3277 (diff)
downloadchawan-be287807b339fd1d56be44bf474a291653feb084.tar.gz
javascript: reference unforgeables in table
Conceptually, seqs are by-value. In practice I they are by-ref,
but let's not depend on this.
-rw-r--r--src/js/javascript.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index b1d16734..8031c288 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -200,8 +200,8 @@ proc addClassUnforgeable(ctx: JSContext, proto: JSValue,
   ctxOpaque.unforgeable.withValue(parent, uf):
     merged.add(uf[])
   if merged.len > 0:
-    let ufp = addr merged[0]
     ctxOpaque.unforgeable[classid] = merged
+    let ufp = addr ctxOpaque.unforgeable[classid][0]
     JS_SetPropertyFunctionList(ctx, proto, ufp, cint(merged.len))
 
 func newJSClass*(ctx: JSContext, cdef: JSClassDefConst, tname: string,