Warn on reference to js/foo shadowed by local binding

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:

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.

Environment

OS X

Activity

Show:

import January 29, 2019 at 2:03 PM

Comment made by: dan

Testing this on ClojureScript 1.10.439 only gives me warnings in the letfn case

cljs.user=> (letfn [(parseInt [s] (js/parseInt s))] (parseInt "123"))
WARNING: js/parseInt is shadowed by a local at line 1 <cljs repl>
RangeError: Maximum call stack size exceeded

cljs.user=> (let [parseInt (fn [s] (js/parseInt s))] (parseInt "123"))
RangeError: Maximum call stack size exceeded

Completed

Details

Assignee

Reporter

Affects versions

Priority

Created September 21, 2016 at 4:39 PM
Updated January 29, 2019 at 2:03 PM
Resolved January 29, 2019 at 2:03 PM