diff options
author | bptato <nincsnevem662@gmail.com> | 2023-07-03 17:12:11 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-07-03 17:12:11 +0200 |
commit | 307003b8043998283ea0d7a64bcd5f8c2c3f554d (patch) | |
tree | c8e6fea0d13d8d16e3f7ade79d4c1b63efaa1eff /src/js/javascript.nim | |
parent | 3d8ef802d87d4fc4c71aa6bc9e5dcececdddd0bf (diff) | |
download | chawan-307003b8043998283ea0d7a64bcd5f8c2c3f554d.tar.gz |
nim_finalize_for_js: use withValue
Diffstat (limited to 'src/js/javascript.nim')
-rw-r--r-- | src/js/javascript.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim index ac8069b7..bc2896bd 100644 --- a/src/js/javascript.nim +++ b/src/js/javascript.nim @@ -1801,8 +1801,8 @@ proc nim_finalize_for_js*[T](obj: ptr T) = let p = v[] let val = JS_MKPTR(JS_TAG_OBJECT, p) let classid = JS_GetClassID(val) - if classid in rtOpaque.fins: - rtOpaque.fins[classid](val) + rtOpaque.fins.withValue(classid, fin): + fin[](val) JS_SetOpaque(val, nil) rtOpaque.plist.del(cast[pointer](obj)) JS_FreeValueRT(rt, val) |