File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 856856 ))))
857857 )
858858
859- (defn infer-test-helper [{:keys [forms externs warnings]}]
859+ (defn infer-test-helper [{:keys [forms externs warnings warn ]}]
860860 (let [test-cenv (atom {::a/externs
861861 (externs/externs-map
862862 (closure/load-externs {:externs (or externs [])}))})]
863863 (a/with-warning-handlers [(collecting-warning-handler (or warnings (atom [])))]
864864 (binding [a/*cljs-ns* a/*cljs-ns*
865- a/*cljs-warnings* (assoc a/*cljs-warnings* :infer-warning true )]
865+ a/*cljs-warnings* (assoc a/*cljs-warnings*
866+ :infer-warning (if (nil? warn) true warn))]
866867 (e/with-compiler-env test-cenv
867868 (a/analyze-form-seq forms)
868869 (with-out-str
972973
973974(comment
974975
976+ (let [ws (atom [])
977+ res (infer-test-helper
978+ {:forms '[(ns warn-on-infer-test.app )
979+ (set! *warn-on-infer* true )
980+ (defn wrap-baz [x]
981+ (.baz x))]
982+ :externs [" src/test/externs/test.js" ]
983+ :warnings ws
984+ :warn false })]
985+ (println (pr-str res) @ws))
986+
975987 )
You can’t perform that action at this time.
0 commit comments