File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 849849 (get-in env [:js-globals name]))}}
850850 (when-let [tag (-> name meta :tag )]
851851 {:ret-tag tag})))
852+ env (update-in env [:fn-scope ] (fnil conj []) name-var)
852853 locals (if (and locals name) (assoc locals name name-var) locals)
853854 type (-> form meta ::type )
854855 protocol-impl (-> form meta ::protocol-impl )
884885 (warning :variadic-max-arity env {:name name-var}))
885886 (when (not= (distinct param-counts) param-counts)
886887 (warning :overload-arity env {:name name-var})))
887- {:env env :op :fn :form form :name name-var :methods methods :variadic variadic
888+ {:env env
889+ :op :fn :form form :name name-var :methods methods :variadic variadic
888890 :tag 'function
889891 :recur-frames *recur-frames* :loop-lets *loop-lets*
890892 :jsdoc [(when variadic " @param {...*} var_args" )]
Original file line number Diff line number Diff line change 324324 ; ; actual: (not (= #{file-reloading dev client} #{file-reloading dev client core}))
325325 (is (= (set (a/ns-dependents 'utils))
326326 #{'file-reloading 'dev 'client 'core}))))
327+
328+ ; ; =============================================================================
329+ ; ; Namespace metadata
330+
331+ (deftest test-fn-scope
332+ (is (= (get-in
333+ (a/analyze ns-env
334+ '(fn foo []
335+ (fn bar [])))
336+ [:children 0 :children 0 :env :fn-scope ])
337+ '[{:name foo, :info {:shadow nil }} {:name bar, :info {:shadow nil }}]))
338+ (is (= (get-in
339+ (a/analyze ns-env
340+ '(defn foo []
341+ (fn bar [])))
342+ [:init :children 0 :children 0 :env :fn-scope ])
343+ '[{:name foo, :info {:shadow nil }} {:name bar, :info {:shadow nil }}])))
You can’t perform that action at this time.
0 commit comments