Created
December 5, 2016 17:13
-
-
Save amalloy/30d4d4808fcc7e18bebcc454de681dd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cljs.user=> (def obj (js-obj {})) | |
cljs.user=> (def foo (fn [x] (this-as this [this x]))) | |
cljs.user=> (set! (.-f obj) foo) | |
cljs.user=> (.f obj 1) | |
[#js {:f #object[cljs$user$foo "function cljs$user$foo(x){ | |
var this$ = this; | |
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$,x], null); | |
}"]} 1] | |
cljs.user=> ((.-f obj) obj 1) | |
[#object[Window [object Window]] #js {:f #object[cljs$user$foo "function cljs$user$foo(x){ | |
var this$ = this; | |
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [this$,x], null); | |
}"]}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment