about summary refs log tree commit diff stats
path: root/src/js/tojs.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-21 19:17:10 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-21 19:17:10 +0200
commit470aeef2d72614cb8f904d8ef19583312410d981 (patch)
tree20cebeb73b89000d4ee43b1d95c98d271ae84483 /src/js/tojs.nim
parent31b359224632fd4e3c2aac667483ed249121efaa (diff)
downloadchawan-470aeef2d72614cb8f904d8ef19583312410d981.tar.gz
js: fix some incorrect defineProperty usage
It consumes a value, so we must dup those that we pass.
Diffstat (limited to 'src/js/tojs.nim')
-rw-r--r--src/js/tojs.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/js/tojs.nim b/src/js/tojs.nim
index 4cbd2045..2ee8fd47 100644
--- a/src/js/tojs.nim
+++ b/src/js/tojs.nim
@@ -106,6 +106,7 @@ makeToJSP(Result)
 makeToJSP(JSValue)
 makeToJSP(JSDict)
 
+# Note: this consumes `prop'.
 proc defineProperty(ctx: JSContext; this: JSValue; name: JSAtom;
     prop: JSValue; flags = cint(0)) =
   if JS_DefinePropertyValue(ctx, this, name, prop, flags) <= 0: