Permalink
Browse files

Initial version of extend-object. Works.

  • Loading branch information...
fogus committed Sep 2, 2011
1 parent 562cd0b commit c2678215a4f432d87482060e39f6456d37ea78e7
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/cljs/cljs/core.cljs
View
@@ -3269,4 +3269,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 c267821

Please sign in to comment.