about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-18 11:40:28 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-18 11:40:28 +0200
commitaecd7e7d69cab7499f07d1ca40541402bbeb286b (patch)
tree80efbcb1c0c64b33fc382b9e268fccf4c994ba7d
parent1ae5f2a85d833631c399eab6d756b6fabf105aca (diff)
downloadchawan-aecd7e7d69cab7499f07d1ca40541402bbeb286b.tar.gz
Add typeerror to jsgctor
-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 9afff65a..deda1ca5 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -1442,7 +1442,7 @@ macro jsgctor*(fun: typed) =
   gen.jsCallAndRet = quote do:
     block `dl`:
       return ctx.toJS(`jfcl`)
-    return JS_UNDEFINED
+    return JS_ThrowTypeError(ctx, "Invalid parameters passed to constructor")
   discard gen.newJSProc(getJSParams())
   gen.registerConstructor()
   result = newStmtList(fun)