<< Back to previous view

[CLJS-680] shadowing of js/foo Created: 15/Nov/13  Updated: 16/Nov/13  Resolved: 16/Nov/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

(defn generic-report [f]
  (fn [msgs]
    (let [msgs (str msgs)]
      (f msgs))))

(defn alert [& msgs]
  ((generic-report js/alert) msgs))

This will result in an infinite loop, this is because the code generated by alert will create a local called alert, and js/alert also becomes alert in the generated code.

Comment by David Nolen [ 16/Nov/13 7:59 PM ]

fixed, https://github.com/clojure/clojurescript/commit/08b310f24b184d39082eac91b1d8a2dba7ae38af

Generated at Tue Jan 23 06:19:26 CST 2018 using JIRA 4.4#649-r158309.