about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-11 19:39:56 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-11 19:39:56 +0100
commitb7570a38b70059fbb9a3fb3d32df153ad5f9706f (patch)
tree0bcb774fd862afa92944268636d11d3b08f0cd7b /src/js
parent091764fd976831e0b6d86f4e364dceb4e9c1114f (diff)
downloadchawan-b7570a38b70059fbb9a3fb3d32df153ad5f9706f.tar.gz
Use errDOMException template everywhere
Diffstat (limited to 'src/js')
-rw-r--r--src/js/base64.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/js/base64.nim b/src/js/base64.nim
index f72131c3..c9375c13 100644
--- a/src/js/base64.nim
+++ b/src/js/base64.nim
@@ -14,13 +14,13 @@ proc atob*(data: string): DOMResult[NarrowString] =
     let ds = NarrowString(base64.decode(data))
     return ok(ds)
   except ValueError:
-    return err(newDOMException("Invalid character in string",
-      "InvalidCharacterError"))
+    return errDOMException("Invalid character in string",
+      "InvalidCharacterError")
 
 proc btoa*(data: JSString): DOMResult[string] =
   if JS_IsStringWideChar(data):
-    return err(newDOMException("Invalid character in string",
-      "InvalidCharacterError"))
+    return errDOMException("Invalid character in string",
+      "InvalidCharacterError")
   let len = int(JS_GetStringLength(data))
   if len == 0:
     return ok("")