diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-24 20:43:19 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-24 21:45:23 +0100 |
commit | cc7eacf75ebee5b3846e26b4fe338279a34bf939 (patch) | |
tree | 1f805566927f79ba2500e039561d93c18b00e7f9 /src/loader/cgi.nim | |
parent | 78a977b76dc4cb695f406666e035c880cce8cdd5 (diff) | |
download | chawan-cc7eacf75ebee5b3846e26b4fe338279a34bf939.tar.gz |
js: proper distinction between Opt/Option
until now, this had very strange (and inconsistent) semantics: * err() was used for exception propagation, but also as a null value * Option accepted undefined as a none value, but not null * Opt and Option were used interchangeably (and mostly randomly) Now, Result is always used for error reporting, and err(nil) means JS_EXCEPTION. (Opt is a special case of Result where we don't care about the error type, and is not used in JS.) Option on the other hand means "nullable variation of normally non-nullable type", and translates to JS_NULL. In JS we mainly use it for turning strings nullable.
Diffstat (limited to 'src/loader/cgi.nim')
-rw-r--r-- | src/loader/cgi.nim | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim index 8d6d60b3..3e3ec4fc 100644 --- a/src/loader/cgi.nim +++ b/src/loader/cgi.nim @@ -11,7 +11,6 @@ import loader/headers import loader/loaderhandle import loader/request import types/formdata -import types/opt import types/url import utils/twtstr |