Permalink
Browse files

Initial version of extend-object. Works.

  • Loading branch information...
1 parent db46aae commit 63462a30a4c63782c4e2c06831ac038a552db0be @fogus fogus committed Sep 2, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/cljs/cljs/core.cljs
@@ -3220,4 +3220,7 @@ reduces them without incurring seq initialization"
(defn extend-object
""
[obj fn-map]
- )
+ (doseq [[key-name f] fn-map]
+ (let [str-name (name key-name)
+ bind-fn (goog.bind f obj)]
+ (js* "~{obj}[~{str-name}] = ~{bind-fn}"))))

0 comments on commit 63462a3

Please sign in to comment.