File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 34
34
(def -cljs-macros-loaded (atom false ))
35
35
36
36
(def ^:dynamic *cljs-warnings*
37
- {:unprovided true
37
+ {:preamble-missing true
38
+ :unprovided true
38
39
:undeclared-var false
39
40
:undeclared-ns false
40
41
:undeclared-ns-form true
60
61
61
62
(defmulti error-message (fn [warning-type & _] warning-type))
62
63
64
+ (defmethod error-message :preamble-missing
65
+ [warning-type info]
66
+ (str " Preamble resource file not found: " (string/join " " (:missing info))))
67
+
63
68
(defmethod error-message :unprovided
64
69
[warning-type info]
65
- (str " Required namespace not provided for " (clojure. string/join " " (:unprovided info))))
70
+ (str " Required namespace not provided for " (string/join " " (:unprovided info))))
66
71
67
72
(defmethod error-message :undeclared-var
68
73
[warning-type info]
Original file line number Diff line number Diff line change @@ -523,7 +523,10 @@ should contain the source for the given namespace name."
523
523
inputs)))))
524
524
525
525
(defn preamble-from-paths [paths]
526
- (str (apply str (map #(slurp (io/resource %)) paths)) " \n " ))
526
+ (when-let [missing (seq (remove io/resource paths))]
527
+ (ana/warning :preamble-missing @env/*compiler* {:missing (sort missing)}))
528
+ (let [resources (remove nil? (map io/resource paths))]
529
+ (str (string/join (map slurp resources)) " \n " )))
527
530
528
531
(defn make-preamble [{:keys [target preamble hashbang]}]
529
532
(str (when (and (= :nodejs target) (not (false ? hashbang)))
You can’t perform that action at this time.
0 commit comments