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