File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 26272627 nil )]
26282628 (when (and (not (string/starts-with? (str prop) " cljs$" ))
26292629 (not= 'js target-tag))
2630+ ; ; Cannot determine type of the target
26302631 (when (and (get-in env [:locals target])
26312632 (or (nil? target-tag)
26322633 ('#{any} target-tag)))
26332634 (warning :infer-warning env
26342635 {:warn-type :target :form form}))
2635- (let [[pre' pre] ((juxt (comp butlast butlast) identity) ; ; drop prototype from pre'
2636+ ; ; Unresolveable property on existing extern
2637+ (let [[pre' pre] ((juxt butlast identity) ; ; drop prototype from pre'
26362638 (-> tag meta :prefix ))]
26372639 (when (and (has-extern? pre') (not (has-extern? pre)))
26382640 (warning :infer-warning env
26392641 {:warn-type :property :form form
2640- :type (symbol " js" (string/join " ." pre'))
2642+ :type (symbol " js"
2643+ (string/join " ."
2644+ (cond-> pre' (= 'prototype (last pre')) butlast)))
26412645 :property prop}))))
26422646 (when (js-tag? tag)
26432647 (let [pre (-> tag meta :prefix )]
26652669 :args argexprs
26662670 :children children
26672671 :tag (if (js-tag? tag)
2668- (or (js-tag (-> tag meta :prefix ) :ret-tag ) tag )
2672+ (or (js-tag (-> tag meta :prefix ) :ret-tag ) 'js )
26692673 tag)}))))
26702674
26712675(defmethod parse '.
Original file line number Diff line number Diff line change 676676 (a/analyze (a/empty-env ) '(def foo (js/woz )))))
677677 :tag )))
678678 (is (= 'js
679- (-> (binding [a/*cljs-ns* a/*cljs-ns*]
680- (e/with-compiler-env externs-cenv
681- (a/analyze (a/empty-env ) '(def foo js/boz))))
682- :tag ))))
679+ (-> (binding [a/*cljs-ns* a/*cljs-ns*]
680+ (e/with-compiler-env externs-cenv
681+ (a/analyze (a/empty-env ) '(def foo js/boz))))
682+ :tag )))
683+ (is (nil? (-> (binding [a/*cljs-ns* a/*cljs-ns*]
684+ (a/no-warn
685+ (e/with-compiler-env externs-cenv
686+ (a/analyze (a/empty-env )
687+ '(let [z (.baz ^js/Foo.Bar x)]
688+ z)))))
689+ :tag meta :prefix ))))
683690
684691(comment
685692 (require '[cljs.compiler :as cc])
You can’t perform that action at this time.
0 commit comments