File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 10381038 (when (contains? locals (-> sym name symbol))
10391039 (warning :js-shadowed-by-local env {:name sym}))
10401040 (let [pre (->> (string/split (name sym) #"\. " ) (map symbol) vec)]
1041- (when-not (has-extern? pre)
1041+ (when (and (not (has-extern? pre))
1042+ ; ; ignore exists? usage
1043+ (not (-> sym meta ::no-resolve )))
10421044 (swap! env/*compiler* update-in
10431045 (into [::namespaces (-> env :ns :name ) :externs ] pre) merge {}))
10441046 (merge
29282930 (vary-meta (normalize-js-tag target-tag)
29292931 update-in [:prefix ] (fnil conj '[Object]) prop))
29302932 nil )]
2931- (when (not (string/starts-with? (str prop) " cljs$" ))
2933+ (when (and (not= 'constructor prop)
2934+ (not (string/starts-with? (str prop) " cljs$" )))
29322935 ; ; Adding to Object
29332936 (when (= 'Object (first (-> tag meta :prefix )))
29342937 (warning :infer-warning env
Original file line number Diff line number Diff line change 18191819 (.. ~other ~(to-property field))))
18201820 base-fields)
18211821 (= (.-__extmap ~this)
1822- (.-__extmap ~other)))))
1822+ (.-__extmap ~( with-meta other { :tag tagname}) )))))
18231823 'IMeta
18241824 `(~'-meta [this#] ~'__meta)
18251825 'IWithMeta
Original file line number Diff line number Diff line change 10761076 :warnings ws
10771077 :warn false })]
10781078 (is (= (unsplit-lines [" Object.Component;" ]) res))))
1079+
1080+ (deftest test-cljs-2767-deftype-defrecord
1081+ (let [ws (atom [])
1082+ res (infer-test-helper
1083+ {:forms '[(ns cjls-2767.core )
1084+ (defrecord Foo [])]
1085+ :externs [" src/test/externs/test.js" ]
1086+ :warnings ws
1087+ :with-core? true })]
1088+ (is (empty? @ws))
1089+ (is (not (string/includes? res " cljs.core" ))))
1090+ (let [ws (atom [])
1091+ res (infer-test-helper
1092+ {:forms '[(ns cjls-2767.core )
1093+ (deftype Foo [])]
1094+ :externs [" src/test/externs/test.js" ]
1095+ :warnings ws
1096+ :with-core? true })]
1097+ (is (empty? @ws))
1098+ (is (not (string/includes? res " cljs.core" )))))
You can’t perform that action at this time.
0 commit comments