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/io/request.nim | |
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/io/request.nim')
-rw-r--r-- | src/io/request.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/io/request.nim b/src/io/request.nim index f609360b..6b89eb6b 100644 --- a/src/io/request.nim +++ b/src/io/request.nim @@ -5,6 +5,7 @@ import tables import bindings/quickjs import io/headers +import js/error import js/javascript import types/formdata import types/url @@ -194,7 +195,7 @@ func createPotentialCORSRequest*(url: URL, destination: RequestDestination, cors #TODO init as an actual dictionary func newRequest*[T: string|Request](ctx: JSContext, resource: T, - init = none(JSValue)): Result[Request, JSError] {.jsctor.} = + init = none(JSValue)): JSResult[Request] {.jsctor.} = when T is string: let url = ?newURL(resource) if url.username != "" or url.password != "": |