ClojureScript

shadowing of js/foo

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

(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.

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: