diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2021-02-16 20:57:29 +0300 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2021-02-16 20:57:29 +0300 |
| commit | c5ac672b4e0e83fa92d629216c3e07abc2756489 (patch) | |
| tree | c2a7fe1eb3dc9be011937e92635b0da72dd5083e /init.fnl | |
| parent | 7feb5aabe6e71ad6e65c72ca3cc977541c0991c4 (diff) | |
fix(core): check if nil is used as table key
Diffstat (limited to 'init.fnl')
| -rw-r--r-- | init.fnl | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -958,12 +958,14 @@ use." (fn* core.assoc "Associate key `k` with value `v` in `tbl`." ([tbl k v] + (assert (not (nil? k)) "attempt to use nil as key") (setmetatable (doto tbl (tset k v)) {:cljlib/type :table})) ([tbl k v & kvs] (assert (= (% (length kvs) 2) 0) (.. "no value supplied for key " (. kvs (length kvs)))) + (assert (not (nil? k)) "attempt to use nil as key") (tset tbl k v) (var [k v] [nil nil]) (var (i k) (next kvs)) |