diff options
author | bptato <nincsnevem662@gmail.com> | 2024-01-24 12:33:05 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-01-24 12:33:05 +0100 |
commit | fe2d01b8d6d569bf8855979ab0e83ae03b62eb73 (patch) | |
tree | 54cc010bd0883333878581bdf609c93d79edb8f1 /src/loader/response.nim | |
parent | 2ff8f87f82cf971160eeced2ded6189d19e72162 (diff) | |
download | chawan-fe2d01b8d6d569bf8855979ab0e83ae03b62eb73.tar.gz |
js: allow specifying static function name, small refactoring
* static function names can now be defined using the syntax `Class:functionName' (or just use `Class' to take the default name * fix URL.canParse with 1 argument only * do not store JSFuncGenerator for constructors; just put the function node in BoundFunctions
Diffstat (limited to 'src/loader/response.nim')
-rw-r--r-- | src/loader/response.nim | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/loader/response.nim b/src/loader/response.nim index 6fa6a974..a8bc31e4 100644 --- a/src/loader/response.nim +++ b/src/loader/response.nim @@ -60,7 +60,7 @@ proc newResponse*(res: int, request: Request, fd = -1, stream: Stream = nil): fd: fd ) -func makeNetworkError*(): Response = +func makeNetworkError*(): Response {.jsstfunc: "Response:error".} = #TODO use "create" function #TODO headers immutable return Response( @@ -71,9 +71,6 @@ func makeNetworkError*(): Response = headersGuard: GUARD_IMMUTABLE ) -proc error(): Response {.jsstfunc: "Response".} = - return makeNetworkError() - func sok(response: Response): bool {.jsfget: "ok".} = return response.status in 200u16 .. 299u16 |