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 849
849
(get-in env [:js-globals name]))}}
850
850
(when-let [tag (-> name meta :tag )]
851
851
{:ret-tag tag})))
852
+ env (update-in env [:fn-scope ] (fnil conj []) name-var)
852
853
locals (if (and locals name) (assoc locals name name-var) locals)
853
854
type (-> form meta ::type )
854
855
protocol-impl (-> form meta ::protocol-impl )
884
885
(warning :variadic-max-arity env {:name name-var}))
885
886
(when (not= (distinct param-counts) param-counts)
886
887
(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
888
890
:tag 'function
889
891
:recur-frames *recur-frames* :loop-lets *loop-lets*
890
892
:jsdoc [(when variadic " @param {...*} var_args" )]
Original file line number Diff line number Diff line change 324
324
; ; actual: (not (= #{file-reloading dev client} #{file-reloading dev client core}))
325
325
(is (= (set (a/ns-dependents 'utils))
326
326
#{'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