From 636ddbb788a4a4dcd4dc4bc247159b6bb191ef8a Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 26 Dec 2022 18:50:20 +0100 Subject: DOM: implement many new methods --- src/js/javascript.nim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/js/javascript.nim') diff --git a/src/js/javascript.nim b/src/js/javascript.nim index d7ccc115..bf81a09d 100644 --- a/src/js/javascript.nim +++ b/src/js/javascript.nim @@ -1240,9 +1240,13 @@ proc rewriteExceptions(gen: var JSFuncGenerator, errors: var seq[string], node: if c.kind == nnkCommand and c[0].eqIdent ident("JS_ERR"): if gen.copied == nil: gen.copied = copy(gen.original) - node[i] = quote do: - zeroMem(addr result, sizeof(result)) - return + if gen.returnType.isSome: + node[i] = quote do: + zeroMem(addr result, sizeof(result)) + return + else: + node[i] = quote do: + return if c[1].strVal notin errors: errors.add(c[1].strVal) elif c.len > 0: -- cgit 1.4.1-2-gfad0