Uploaded image for project: 'ClojureScript'
  1. CLJS-1785

Warn on reference to js/foo shadowed by local binding

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Completed
    • Affects versions: 1.9.76
    • Fix versions: None
    • Labels:
      None
    • Environment:

      OS X

      Description

      When a local binding shadows a JS global, and an attempt is made to access said global with js/foo, it would be nice to get a warning indicating that the global is inaccessible.

      Example:

      (defn simple-repro []
        (let [location (str js/location.pathname)]
          location))
      

      Per discussion in Clojurians Slack, this is the same issue as http://dev.clojure.org/jira/browse/CLJS-833.

      The previous issue was closed because the suggested solution was inadequate, but per discussion it seems appropriate to provide a warning so it is less surprising.

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              alex+import import
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: