diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-21 18:28:36 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-21 18:28:36 +0200 |
commit | 33388f9c5fab20a910353da58214b72681f9a8ff (patch) | |
tree | 3efe5bad39fd419557a3155628c80160155e9e5d /src/js/javascript.nim | |
parent | 242b46ca770a8b95539ece648f78af1eff8c844d (diff) | |
download | chawan-33388f9c5fab20a910353da58214b72681f9a8ff.tar.gz |
javascript: simplify
Diffstat (limited to 'src/js/javascript.nim')
-rw-r--r-- | src/js/javascript.nim | 5 |
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) |