diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:33:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:38:00 +0200 |
commit | 1422f3393301cd6105b3939be194c7c119fcf967 (patch) | |
tree | 32969f2af8fe5293c13215a84229915a7970e828 /src/types | |
parent | ba2a62f6d3a2879c9506ea3fb5aa5552fc4674d9 (diff) | |
download | chawan-1422f3393301cd6105b3939be194c7c119fcf967.tar.gz |
javascript: refactor
Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/color.nim | 3 | ||||
-rw-r--r-- | src/types/cookie.nim | 3 | ||||
-rw-r--r-- | src/types/url.nim | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/types/color.nim b/src/types/color.nim index 664e2047..b89eef7a 100644 --- a/src/types/color.nim +++ b/src/types/color.nim @@ -3,8 +3,9 @@ import strutils import tables import bindings/quickjs -import js/exception +import js/error import js/javascript +import js/tojs import utils/twtstr type diff --git a/src/types/cookie.nim b/src/types/cookie.nim index 7fbfd6c0..141b62e5 100644 --- a/src/types/cookie.nim +++ b/src/types/cookie.nim @@ -2,6 +2,7 @@ import strutils import times import io/urlfilter +import js/error import js/javascript import js/regex import types/url @@ -204,7 +205,7 @@ proc serialize*(cookiejar: CookieJar, url: URL): string = result &= "=" result &= cookie.value -proc newCookie*(str: string, url: URL = nil): Result[Cookie, JSError] +proc newCookie*(str: string, url: URL = nil): JSResult[Cookie] {.jsctor.} = let cookie = new(Cookie) cookie.expires = -1 diff --git a/src/types/url.nim b/src/types/url.nim index f7cd550f..53b5253f 100644 --- a/src/types/url.nim +++ b/src/types/url.nim @@ -5,6 +5,7 @@ import options import unicode import math +import js/error import js/javascript import types/blob import utils/twtstr |