about summary refs log tree commit diff stats
path: root/src/js/javascript.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-21 18:28:36 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-21 18:28:36 +0200
commit33388f9c5fab20a910353da58214b72681f9a8ff (patch)
tree3efe5bad39fd419557a3155628c80160155e9e5d /src/js/javascript.nim
parent242b46ca770a8b95539ece648f78af1eff8c844d (diff)
downloadchawan-33388f9c5fab20a910353da58214b72681f9a8ff.tar.gz
javascript: simplify
Diffstat (limited to 'src/js/javascript.nim')
-rw-r--r--src/js/javascript.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index cba2af59..bcea8801 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -1663,7 +1663,7 @@ proc makeJSCallAndRet(gen: var JSFuncGenerator, okstmt, errstmt: NimNode) =
         `okstmt`
       `errstmt`
 
-proc makeCtorJSCallAndRet(gen: var JSFuncGenerator, okstmt, errstmt: NimNode) =
+proc makeCtorJSCallAndRet(gen: var JSFuncGenerator, errstmt: NimNode) =
   let jfcl = gen.jsFunCallList
   let dl = gen.dielabel
   gen.jsCallAndRet = quote do:
@@ -1683,8 +1683,7 @@ macro jsctor*(fun: typed) =
   gen.finishFunCallList()
   let errstmt = quote do:
     return JS_ThrowTypeError(ctx, "Invalid parameters passed to constructor")
-  # no okstmt
-  gen.makeCtorJSCallAndRet(nil, errstmt)
+  gen.makeCtorJSCallAndRet(errstmt)
   discard gen.newJSProc(getJSParams())
   gen.registerConstructor()
   result = newStmtList(fun)