Permalink
Browse files

Initial version of extend-object. Works.

  • Loading branch information...
1 parent 359d1fd commit dc5c94cb291e75112bd498a8fbcfe365218832e7 @fogus fogus committed Sep 2, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/cljs/cljs/core.cljs
@@ -3217,4 +3217,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 dc5c94c

Please sign in to comment.