I think you could just use (aset the-object "methodName" (fn [] ...)). I don't know how javascript handles "this" in such a case, hopefully you can do without it.
There are plenty of examples of interacting with js objects in ClojureScript here: http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/ /Linus How to mock a Javascript method during test? I tried '(with-redefs [js/object.methodName (fn [] ...)] ...)'. Doing so I get following error: Caused by: clojure.lang.ExceptionInfo: Invalid local name: object.methodName ... -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.