Replace unknown symbols with nil

This commit is contained in:
Julien Eluard 2018-10-14 15:45:39 +02:00
parent 4de10d1d4b
commit c502b85fe7
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
2 changed files with 10 additions and 3 deletions

View File

@ -63,7 +63,8 @@
:properties {:view :view}}}
:events {'alert
{:permissions [:read]
:value :alert}}}}
:value :alert
:arguments {:value :string}}}}}
m))
(defn render-extension [m el el-errors]

View File

@ -30,8 +30,14 @@
(assoc m o resolved-value)
(merge m o))))
(defn let-block [{:keys [env ctx ext]} children]
(walk/prewalk-replace (reduce-kv assoc-binding {} env) children))
(defn replace-atom [values o]
(cond (contains? values o) (get values o)
(symbol? o) nil
:else o))
(defn let-block [{:keys [env]} children]
(let [values (reduce-kv assoc-binding {} env)] ;
(walk/prewalk #(replace-atom values %) children)))
(defn properties? [o]
(= 'properties o))