FWIW I was not able to reproduce this behavior? What exactly does your code 
look like?

See the source and the compiled version:
https://gist.github.com/thheller/4731f682665d38b1053c

Seems to me the shadowing kicked in correctly.

"eval" seems to be missing in :js-globals though.
https://github.com/clojure/clojurescript/blob/e7f3a5d70a11257d5b84f1562ac01b3a4379e6e4/src/clj/cljs/analyzer.clj#L235

Cheers,
/thomas

On Thursday, July 31, 2014 3:42:37 PM UTC+2, Sam Ritchie wrote:
>
>  Hey guys,
>
> I ran into this last night when trying to port some ancient JS in our 
> project over to cljs. I was defining an om component called 
> "users-typeahead", and in the (did-mount ...) implementation calling a bare 
> javascript function called js/users_typeahead. At the repl, the latter 
> worked great; INSIDE the did-mount implementation, js/users_typeahead 
> resolved to a reference to the enclosing function itself.
>
> My expectation was that, with Clojurescript's namespacing, js/func_name 
> would always resolve to the top-level global namespace. Instead, 
>
> Here's a minimal reproduction:
>
> (.log js/console "Hi!")
> ;; logs "Hi!"
>
> (defn console [s] (.log js/console s))
>
> (console "Hi!")
> ;; throws Compilation error: TypeError: undefined is not a function 
>
> What do you think? Expected behavior, or just an edge case to avoid?
>
>  -- 
> Sam Ritchie (@sritchie)
> Paddleguru Co-Founder
> 703.863.8561
> www.paddleguru.com
> Twitter <http://twitter.com/paddleguru> // Facebook 
> <http://facebook.com/paddleguru>
>  

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to