aboutsummaryrefslogtreecommitdiffstats
path: root/src/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/html')
-rw-r--r--src/html/env.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/html/env.nim b/src/html/env.nim
index 7ce0bb4f..311496af 100644
--- a/src/html/env.nim
+++ b/src/html/env.nim
@@ -228,11 +228,11 @@ func getParent(window: Window): Window {.jsfget: "parent".} =
# See twtstr for the actual implementations.
proc atob(ctx: JSContext; window: Window; data: string): JSValue {.jsfunc.} =
- let r = atob0(data)
- if r.isNone:
+ var s = ""
+ if (let r = s.atob(data); r.isNone):
let ex = newDOMException($r.error, "InvalidCharacterError")
return JS_Throw(ctx, ctx.toJS(ex))
- return ctx.toJS(NarrowString(r.get))
+ return ctx.toJS(NarrowString(s))
proc btoa(ctx: JSContext; window: Window; data: JSValue): JSValue
{.jsfunc.} =