Browse files

Added obj as return

  • Loading branch information...
fogus committed Sep 4, 2011
1 parent e434da6 commit ae054a538818c236061ed2020d54ea57a1d579c1
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/cljs/cljs/core.cljs
@@ -3218,10 +3218,13 @@ reduces them without incurring seq initialization"
[multifn] (-prefers multifn))
(defn extend-object
- ""
+ "Takes a JavaScript object and a map of names to functions and
+ attaches said functions as methods on the object. The attached
+ methods will resolve the implict this as the 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}"))))
+ (js* "~{obj}[~{str-name}] = ~{bind-fn}")))
+ obj)

0 comments on commit ae054a5

Please sign in to comment.