Permalink
Browse files

Added tests for this, including use of self-call

  • Loading branch information...
1 parent db0025a commit d87492a31b81249fa303aa2752e3dfb9054335bd @fogus fogus committed Sep 16, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/cljs/cljs/core_test.cljs
@@ -731,11 +731,13 @@
(let [obj (js* "{}")]
(extend-object obj
{:foo #(do 42)
- :bar #(+ 100 (. js/this (foo)))
- :baz #(+ % %2)})
+ :bar #(+ 100 (. js/this (foo))) ;; warning is good here
+ :baz #(+ % %2)
+ :qux #(+ 100 (. obj baz 1 2))}) ;; avoids warning
(assert (= 42 (. obj (foo))))
(assert (= 142 (. obj (bar))))
- (assert (= 3 (. obj baz 1 2))))
+ (assert (= 3 (. obj baz 1 2)))
+ (assert (= 103 (. obj (qux)))))
:ok)

0 comments on commit d87492a

Please sign in to comment.