From c5ac672b4e0e83fa92d629216c3e07abc2756489 Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Tue, 16 Feb 2021 20:57:29 +0300 Subject: fix(core): check if nil is used as table key --- init.fnl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'init.fnl') diff --git a/init.fnl b/init.fnl index 7d5a7f9..4d67d9a 100644 --- a/init.fnl +++ b/init.fnl @@ -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)) -- cgit v1.2.3